Building test cases

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Building test cases

Postby PeterR » Wed Apr 17, 2019 1:56 pm

I want to run legacy Catch2 unit tests on target.
The unit code is in .cpp files.

I have the UUT directory structure:

/esp/app/components/<component-name>/src
/esp/app/components/<component-name>/include

And the test harness is stored here:
/esp/app/components/<component-name>/test/src
/esp/app/components/<component-name>/test/include

I attempt to compile from within: /esp/app/components/<component-name>/test
Project makefile is:

Code: Select all

PROJECT_NAME := test-unit

COMPONENT_SRCDIRS := ./src ./../src
COMPONENT_ADD_INCLUDEDIRS := ./include

include $(IDF_PATH)/make/project.mk
The build makes the IDF components but on link complains that there is no app_main(). The build does not attempt to build
esp/app/components/<component-name>/src .cpp files.

Takes an ages to recompile the IDF each time so worked solution/advise welcome!
I want unit tests to be built from within a sub directory. Eventually I may want all test combining as below but compilation & memory limitations mean one at a time.

I note that the IDF has a Unity setup https://docs.espressif.com/projects/esp ... tests.html
The legacy tests are Catch2 though.
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: No registered users and 132 guests