I am trying to implement test driven development for my Microchip embedded system process and am trying to do that via Ceedling (Unity, CMock, etc.). I have been trying to follow along with this tutorial: https://spin.atomicobject.com/2012/10/22/getting-started-with-tdd-for-microchips-pics/ but am having some issues. I have followed all of the steps up to the last but am having trouble getting my code to link properly (at least I believe linking is the issue). Below is the output when I do "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.
The tutorial I am following is a bit dated so there is probably something I am missing that changed from when the tutorial was posted. Any assistance would be much appreciated!
UPDATE:
I had my yaml file set up improperly as I had :release_build: FALSE in my project section but had :test build: section commented out. If I commented out the :release_build: FALSE then it compiles and links properly however I get a different error:
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.
I am also using Ceedling with XC16 and Ceedling does not succeed to create
release
directory inbuild
. Manually creatingrelease
should fix your issue as this is the destination to .map files.