尝试使用 xc16-gcc 编译/链接时出现 Ceedling 错误

时间:2021-04-20 13:55:22

标签: c ruby xc16 cmock ceedling

我正在尝试为我的 Microchip 嵌入式系统进程实施测试驱动开发,并尝试通过 Ceedling(Unity、CMock 等)来实现。我一直在尝试遵循本教程:https://spin.atomicobject.com/2012/10/22/getting-started-with-tdd-for-microchips-pics/,但遇到了一些问题。我已按照所有步骤进行到最后一步,但无法正确链接我的代码(至少我认为链接是问题所在)。以下是我执行“ceedling test:all”时的输出

Test 'test_gpio_access.c'
-------------------------
Linking test_gpio_access.out...
c:\program files\microchip\xc16\v1.50\bin\bin\..\bin/elf-ld.exe: cannot open map file ./build/release/TestOutput.map: No such file or directory
ERROR: Shell command failed.
> Shell executed command:
'xc16-gcc -mcpu=24HJ128GP202 build/test/out/c/test_gpio_access_runner.o build/test/out/c/test_gpio_access.o build/test/out/c/unity.o build/test/out/c/gpio_access.o build/test/out/c/cmock.o -o "./build/release/TestBuild.out" -Wl,-Tp24HJ128GP202.gld,-Map=./build/release/TestOutput.map,--report-mem'
> And exited with status: [255].

NOTICE: If the linker reports missing symbols, the following may be to blame:
  1. Test lacks #include statements corresponding to needed source files.
  2. Project search paths do not contain source files corresponding to #include statements in the test.
  3. Test does not #include needed mocks.

我正在关注的教程有点过时了,所以我可能遗漏了一些与教程发布时有所不同的东西。任何帮助将不胜感激!

更新:

我的 yaml 文件设置不正确,因为我的项目部分有 :release_build: FALSE 但 :test build: 部分被注释掉了。如果我注释掉 :release_build: FALSE 那么它会正确编译和链接,但是我得到一个不同的错误:

C:\Software\PIC_Demo>ceedling test:all


Test 'test_gpio_access.c'
-------------------------
Linking test_gpio_access.out...
Running test_gpio_access.out...

ERROR: Test executable "test_gpio_access.out" failed.
> Produced no final test result counts in $stdout:
test_gpio_access.c:21:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_A0:PASStest_gpio_access.c:27:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_A1:PASStest_gpio_access.c:33:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_A2:PASStest_gpio_access.c:39:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_A3:PASStest_gpio_access.c:45:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_A4:PASStest_gpio_access.c:53:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_A0:PASStest_gpio_access.c:63:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_A1:PASStest_gpio_access.c:73:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_A2:PASStest_gpio_access.c:83:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_A3:PASStest_gpio_access.c:93:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_A4:PASStest_gpio_access.c:106:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_B0:PASStest_gpio_access.c:112:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_B1:PASStest_gpio_access.c:118:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_B2:PASStest_gpio_access.c:124:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_B3:PASStest_gpio_access.c:130:test_GPIO_SetBit_should_set_corresponding_SFR_bit_for_B4:PASStest_gpio_access.c:138:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_B0:PASStest_gpio_access.c:148:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_B1:PASStest_gpio_access.c:158:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_B2:PASStest_gpio_access.c:168:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_B3:PASStest_gpio_access.c:178:test_GPIO_ClearBit_should_clear_the_corresponding_SFR_bit_for_B4:PASS-----------------------20 Tests 0 Failures 0 Ignored OK
> And exited with status: [0] (count of failed tests).
> This is often a symptom of a bad memory access in source or test code.

0 个答案:

没有答案