The Build Wrapper ctcwrap

In productive use, the instrumenting tool ctc is often not used directly, but has to integrate with an existing build process. ctcwrap is, for Linux, the tool that can be used for that purpose. On Windows, ctclaunch is recommended first.

ctcwrap is used as follows:
ctcwrap [ctc options] build command
For example, if the normal way to do the build would be
nmake -a
the wrapped build for multicondition coverage in verbose mode would be done as follows
ctcwrap -i m -v nmake -a

Whenever compilation and link commands are emitted during the nmake build, the ctcwrap machinery catches them and emits the same commands, but prepends them with a call to ctc. The makefile need not to be written in some special way. The only requirement is that the compile and link commands are emitted without an explicit path.

The command that ctcwrap is applied on can be also something else than invoking a make utility. For example it can be running a script file, which runs inner script files, which invoke make files, which finally emit the compile/link commands that the ctcwrap machinery converts to behave "ctc-wise".

The ctcwrap utility is prepared to recognize certain set of compile and link commands. For example, at Windows these commands include cl and link. On Unixes, gcc, g++, ld are among the recognized commands.

The set of commands can be configured: On Windows, this is done in the file %CTCHOME%\wrapcmds.txt. On Unix platforms, it is configured via symbolic links to the ctcagent.

Note: If the build system invokes the compiler and linker with explicit path, the ctcwrap arrangement described above does not work. In these cases, ctclaunch is an alternative on Windows.