Examples for several build systems
It is easy to integrate Testwell CTC++ with the following build systems using ctclaunch. An exemplary generic description how to do that is given for them.
In all examples, multicondition is used as instrumentation mode, given to ctclaunch with option -i m.
NMAKE
If a normal build is done with
nmake the instrumented version
is built with ctclaunch -i m nmakeCMake
If CMake is configured
with:
cmake -S . -B build -GNinjaconfigure another build
directory likecmake -S . -B build-cov -GNinjaIf a Ninja call is used to build in the build directory
like
cd build
ninjathen the instrumented version is built
withcd build-cov
ctclaunch -i m ninjaIf the build is done by a CMake call like
cmake --build build
the instrumented version can be built with
ctclaunch -i m cmake --build build-cov
With the additional build directory, you can switch between instrumented and not instrumented builds without the need for a full rebuild.
IarBuild
When the IAR add-on is used on Windows, ctclaunch is
the recommended method to build instrumented
programs:
ctclaunch -iar -i m iarbuild myproject.ewpMSBuild
If a rebuild is done with
msbuild MySolution.sln -t:Rebuild
the instrumented rebuild is done with
ctclaunch -i m msbuild MySolution.sln -t:Rebuilddevenv.exe
When
devenv is used directly for the build with
devenv MySolution.sln /build the instrumented version is
built with ctclaunch devenv MySolution.sln /build