Host/Target builds
Posted: Fri May 03, 2019 3:25 pm
I am developing a application which will be used on a number of platforms.
Presently the target is ESP32 and I use a Visual Studio host (not cross) build for subsystem and unit testing and debugging.
The 'best' structure I have come up with is:
/esp/<project-name>/components/my-component
/esp/<project-name>/components/my-component/tests
/esp/<project-name>/components/my-component/tests/main
/esp/<project-name>/components/my-component/tests/studio - Visual Studio Win32 test project & stubs
/esp/<project-name>/components/my-component/tests contains the standard ESP32 Makefile
/esp/<project-name>/components/my-component/tests/main contains 'component.mk'
Component.mk manages to build the UUT with:
COMPONENT_SRCDIRS := ../../../my-component/src
I would prefer to keep unit tests under the unit in question. That will make SCM management easier.
My approach will soon become a painful however. As I grow into integration tests I have to add more and more source code directories. And everything will be built into the one folder.
I tried:
EXTRA_COMPONENTS_DIR := ../../../ ../../ ../ etc
but have failed to get 'my-component' to build, only using COMPONENT_SRCDIRS
I could script of course but would prefer the simple life.
Anyone host/target developing? What directory strategy do you use and which secret invocations?
Presently the target is ESP32 and I use a Visual Studio host (not cross) build for subsystem and unit testing and debugging.
The 'best' structure I have come up with is:
/esp/<project-name>/components/my-component
/esp/<project-name>/components/my-component/tests
/esp/<project-name>/components/my-component/tests/main
/esp/<project-name>/components/my-component/tests/studio - Visual Studio Win32 test project & stubs
/esp/<project-name>/components/my-component/tests contains the standard ESP32 Makefile
/esp/<project-name>/components/my-component/tests/main contains 'component.mk'
Component.mk manages to build the UUT with:
COMPONENT_SRCDIRS := ../../../my-component/src
I would prefer to keep unit tests under the unit in question. That will make SCM management easier.
My approach will soon become a painful however. As I grow into integration tests I have to add more and more source code directories. And everything will be built into the one folder.
I tried:
EXTRA_COMPONENTS_DIR := ../../../ ../../ ../ etc
but have failed to get 'my-component' to build, only using COMPONENT_SRCDIRS
I could script of course but would prefer the simple life.
Anyone host/target developing? What directory strategy do you use and which secret invocations?