I am following the book "Test-Driven Development for Embedded C" and I have some problem with linking. I have a test function:
TEST(LedDriver, OutOfBoundsProducesRuntimeError) {
LedDriver_TurnOn(-1);
TEST_ASSERT_EQUAL_STRING("LED Driver: out-of-bounds LED", RuntimeErrorStub_GetLastError());
TEST_ASSERT_EQUAL(-1, RuntimeErrorStub_GetLastParameter());
}
At top of the file I have header
#include "RuntimeErrorStub.h"
where I have prototype:
const char * RuntimeErrorStub_GetLastError(void);
but I got an error:
compiling LedDriverTest.c
Linking SandBox_Unity_tests
objs/./unity/LedDriver/LedDriverTest.o: In function
`TEST_LedDriver_OutOfBoundsProducesRuntimeError_':
/home/milosz/Downloads/code/SandBox/unity/LedDriver/LedDriverTest.c:121: undefined reference to
`RuntimeErrorStub_GetLastError'
/home/milosz/Downloads/code/SandBox/unity/LedDriver/LedDriverTest.c:123: undefined reference to
`RuntimeErrorStub_GetLastParameter'
collect2: error: ld returned 1 exit status
../unity.framework/extras/fixture/build/MakefileWorker.mk:270: recipe for target
'SandBox_Unity_tests' failed
In make file I have appropriate include paths.
Aucun commentaire:
Enregistrer un commentaire