I’m working on a fairly large project with many sub-components (libraries, executables, associated tests). Right now, the ALL target includes everything, so a typical workflow involves
test stages, roughly mapping to
make tests commands.
Is there a recommended way to split the
build step into two parts, such that test executables are only built in a secondary stage ? I’m essentially looking for a way to have a streamlined
build command that would build only the main targets and its dependencies, and then let the
test target not only run the already compiled tests, but actually include the compilation ?
I’m aware of the EXCLUDE_FROM_ALL property, but am unsure of how to use that properly, or rather, how to introduce a new target that depends on all test executables, such that making that will do the right thing.
Are there any recipes for such a use-case ?