I am trying to setup unit tests for my app using the instructions from here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_unity_testing.html
To get a better understanding I wanted to run the example included in the nrf tree: https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/tests/unity/example_test/src/example_test.c
But running west build -b native_posix -t run
Gives me:
[1/67] Building C object CMakeFiles/app.dir/runner/runner_example_test.c.obj
FAILED: CMakeFiles/app.dir/runner/runner_example_test.c.obj
ccache /usr/bin/gcc -DBUILD_VERSION=v2.1.99-ncs1 -DKERNEL -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D__ZEPHYR__=1 -Imocks -I../src -I.././src/uut -I../. -IREDACTED/ncs/zephyr/include -Izephyr/include/generated -IREDACTED/ncs/zephyr/soc/posix/inf_clock -IREDACTED/ncs/zephyr/boards/posix/native_posix -IREDACTED/ncs/nrf/include -IREDACTED/ncs/zephyr/../test/cmock/vendor/unity/src -IREDACTED/ncs/zephyr/../test/cmock/src -Os -imacrosREDACTED/ncs/nrf/tests/unity/example_test/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -imacrosREDACTED/ncs/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-address-of-packed-member -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=REDACTED/ncs/nrf/tests/unity/example_test=CMAKE_SOURCE_DIR -fmacro-prefix-map=REDACTED/ncs/zephyr=ZEPHYR_BASE -ffunction-sections -fdata-sections -m32 -include REDACTED/ncs/zephyr/arch/posix/include/posix_cheats.h -fno-freestanding -std=c11 -MD -MT CMakeFiles/app.dir/runner/runner_example_test.c.obj -MF CMakeFiles/app.dir/runner/runner_example_test.c.obj.d -o CMakeFiles/app.dir/runner/runner_example_test.c.obj -c runner/runner_example_test.c
In file included from <command-line>:
REDACTED/ncs/zephyr/arch/posix/include/posix_cheats.h:44:19: error: conflicting types for ‘zephyr_app_main’
44 | #define main(...) zephyr_app_main(__VA_ARGS__)
| ^~~~~~~~~~~~~~~
runner/runner_example_test.c:91:5: note: in expansion of macro ‘main’
91 | int main(void)
| ^~~~
REDACTED/ncs/zephyr/arch/posix/include/posix_cheats.h:55:6: note: previous declaration of ‘zephyr_app_main’ was here
55 | void zephyr_app_main(void);
| ^~~~~~~~~~~~~~~
[6/67] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
ninja: build stopped: subcommand failed.
ERROR: command exited with status 1: /usr/bin/cmake --build REDACTED/ncs.1.2.0/nrf/tests/unity/example_test/build --target run
Which is the same error that I was getting when trying to run my own test. Shouldn't the included example work?