I’m trying to set up a custom test framework (which is simply a different version of Unity than what’s hardcoded into PlatformIO, see my previous issue).
Using the official test runner example I cannot make it work.
The compilation error I’m getting is:
g++ -o .pio\build\test_native\test\testMain.o -c -std=c++11 -DPLATFORMIO=60105 -DPIO_UNIT_TESTING -DUNIT_TEST -Iinclude -Isrc -Ilib\AbstractSensor\src -I.pio\libdeps\test_native\Unity\src -I.pio\libdeps\test_native\ArduinoFake\src -Itest -I.pio\libdeps\test_native\Unity\extras\fixture\src -I.pio\libdeps\test_native\Unity\extras\memory\src test\testMain.cpp g++ -o .pio\build\test_native\program.exe .pio\build\test_native\test\testMain.o -L.pio\build\test_native -Wl,--start-group .pio\build\test_native\lib274\libArduinoFake.a .pio\build\test_native\lib19b\libUnity.a -Wl,--end-group C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .pio\build\test_native\test\testMain.o:testMain.cpp:(.text+0xc8): undefined reference to `UnityTestRunner' collect2.exe: error: ld returned 1 exit status *** [.pio\build\test_native\program.exe] Error 1
UnityTestRunner seems to be implemented in unity_fixture.c and defined in unity_fixture.h which is included into my test source.
Not sure if it’s relevant here, but my platformio.ini contains this environment for the unit tests:
[env:test_native] platform = native test_framework = custom lib_ignore = Arduino Wire lib_extra_dirs = lib/ include/ build_flags = -std=c++11 -I.pio/libdeps/test_native/Unity/extras/fixture/src -I.pio/libdeps/test_native/Unity/extras/memory/src lib_deps = fabiobatsilva/ArduinoFake@^0.3.1 https://github.com/ThrowTheSwitch/Unity.git lib_compat_mode = off lib_ldf_mode = chain
Any suggestions on how to make it work? I’ve run out of ideas.
Thanks in advance!