乐鑫技术交流
直播中

刘静

7年用户 1293经验值
私信 关注
[问答]

有没有办法使用ESP-IDF单元测试方式来测试主应用程序中的功能?

有没有办法使用 ESP-IDF 单元测试方式来测试主应用程序中的功能,而不是 components 文件夹中的组件?

示例:

我想对“add_four.c”

项目结构中的函数进行单元测试:
代码:全选
main        
  test
    CMakeLists.txt
    component.mk
    test_add_four.c        - has TEST_CASE{TEST_ASSERT_EQUAL(9, add_four(5))}
  add_four.c
  add_four.h
  CMakeLists.txt
  main.c                - main application app_main()

test
  main
    CMakeLists.txt
    main_test.c                -  test application app_main()
  CMakeLists.txt

更多回帖

发帖
×
20
完善资料,
赚取积分