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 nmake

CMake

If CMake is configured with:
cmake -S . -B build -GNinja
configure another build directory like
cmake -S . -B build-cov -GNinja
If a Ninja call is used to build in the build directory like
cd build
ninja
then the instrumented version is built with
cd build-cov
ctclaunch -i m ninja

If 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.ewp

MSBuild

If a rebuild is done with
msbuild MySolution.sln -t:Rebuild
the instrumented rebuild is done with
ctclaunch -i m msbuild MySolution.sln -t:Rebuild

devenv.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