c - 尝试使用 xc16-gcc 编译/链接时出现 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.
解决方案
推荐阅读
- r - quanteda::corpus 中的对象类更改
- nagios - Nagios 配置文件语法
- python - 每当窗口大小发生变化时,如何让 textInput 调整以适应静态小部件
- clojure - Clojure-您将如何从链接中提取天气数据,然后计算出每个日历月中最热的一天
- c++ - c++使用remove方法,其中包含动态文件名
- c++ - C++如何实现回调?
- javascript - 重新加载
- 带有事件处理函数
- c# - C# for 循环:检查 DateTimePicker 是周末还是在数据库中
- r - 通过单击数据表行和操作按钮向数据框添加新行
- python - 从另一个字典的特定值创建新的 Python 字典