QBS is a build system that is part of Qt. To instrument a software project with Coco that is compiled with QBS, two changes are necessary:
modules.cpp.toolchainInstallPathmust be set to the directory in which the Coco wrappers reside. Which directory this is depends on operating system and compiler:
Under Linux, the path is
/opt/SquishCoco/wrapper/bin, unless Coco is installed in a non-standard directory.
Under Windows, with Visual Studio, the path tends to be either
C:\Program Files\squishcoco\visualstudio_x64, depending on whether it is a 32-bit or a 64-bit build. (The first part of the code may also vary a bit, depending on the directory in which Coco is installed.)
There are other Compiler wrappers under Windows, like those for MinGW, which have their own subdirectory of
C:\Program Files\squishcocofor wrappers.
To set command line parameters for the compiler wrappers, the environment variable
COVERAGESCANNER_ARGSmust be set. To activate Coco, the value of
COVERAGESCANNER_ARGSmust contain at least the flag
In a project that is compiled with Qt Creator , one can set the QBS properties via the "Properties" field of the QBS build step.
The properties and their values must be separated by a colon but no spaces. If a path contains spaces, it is possible to surround them by quotation marks, so that the "Properties" entry under Windows could look like this:
COVERAGESCANNER_ARGS can be set in the "Build
Linux command line¶
When building from the command line, the
command is used. It
receives the QBS parameters as additional commmand line arguments.
Before it runs, the environment variable
be set. This is how it looks under Bash:
In general it is however better to write a script for the instrumented build.
Windows command line¶
In the Windows command shell, the syntax is a bit different. Again it is better to write a script.