CoverageScanner adaptation to a tool suite

To use Coco with a new kind of compiler or tool chain, you must write a new profile that adapts the CoverageScanner to the compiler. This section describes the content of profiles. For information about using profiles with Coco, see Invoking CoverageScanner.

Note: Some other commands that are not compilers, such as ld or ar, are also wrapped with the help of a profile because they are involved in the compilation process.

The profile lets CoverageScanner:

The profile is a text file with a name of the form <tool name>.cspro. It must be located in the Coco installation directory. A profile may contain:

  • Comments: Lines that start with a # character are treated as comments.
  • Global parameters: A profile parameter can be assigned a value with the following syntax: <parameter>=<value>

    Only one definition per line is allowed.

  • Parameters for a specific architecture: There are specific versions of parameters that are used only with a particular architecture. The name of the architecture is placed in brackets after the parameter, in the following way:

    <parameter>[<architecture>]=<value>

    Such a definition must be placed after the global parameter definition.

The architecture is determined automatically, unless you specify it with --cs-architecture.

Profile parameters for architecture settings

  • ARCHITECTURE=<string>: List of command line arguments which specify the architecture used during the compilation. This parameter should be placed in the first lines of the profile.
  • ARCHITECTURE_APPEND=<YES/NO/ALLOW>: If set, the argument of the command line option, which defines the architecture, is directly appended (no space characters are placed between the option and the arguments).

Profile parameters for instrumentation settings

  • COVERAGESCANNER_DUMP_ON_EVENT=<regular expression>: Regular expression which activate the Windows® event handler listening the global event Global\COVERAGE.
  • COVERAGESCANNER_RUNTIME_LOG=<regular expression>: Regular expression which activates the verbose mode of the CoverageScanner API.
  • COVERAGESCANNER_COVERAGE_ON=<regular expression>: Regular expression which activates the code coverage analysis (equivalent to --cs-on) if the expression matches a command line argument.
  • SOURCE_IGNORE_INSTRUMENTATION=<list>: List of source file which are not instrumented. The list is a list of wildcard expressions which matches absolute file paths. Access environment variables by placing their name between two dollar signs. For example, type $HOME$ to access the HOME environment variable.

Profile parameters for preprocessor settings

  • PREPROCESSOR_KEEP_DEFINES=<string>: List of preprocessor defines that are passed through the preprocessor and the compiler command. Only preprocessor defines that are present in the command line argument of CoverageScanner are taken into account.
  • PREPROCESSOR_HIDE_OPTION_NO_ARG=<string>: List of single options (without arguments) which should not be transmitted to the native preprocessor.
  • PREPROCESSOR_HIDE_OPTION_ONE_ARG=<string>: List of options with one argument which should not be transmitted to the native preprocessor.
  • PREPROCESSOR_HIDE_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options to hide is directly appended (no space characters are placed between the option and the arguments).
  • PREPROCESSOR_KEEP_OPTION_ONE_ARG=<string>: List of options with one argument which must be transmitted to the native preprocessor.
  • PREPROCESSOR_KEEP_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options which must be transmitted is directly appended (no space characters are placed between the option and the arguments).
  • PREPROCESSOR_DEFINE_OPTION=<string>: Preprocessor command line option which lets you define C or C++ symbols. For example: -D.
  • PREPROCESSOR_DEFINE_OPTION_APPEND=<YES/NO/ALLOW>: Allows appending the preprocessor symbols just after its command line option string (without spaces, -DNDEBUG).
  • PREPROCESSOR_INCLUDE_OPTION=<string>: Preprocessor command line option which lets you include directly some source files. For example: /FI.
  • PREPROCESSOR_INCLUDE_OPTION_APPEND=<YES/NO/ALLOW>: Allows appending the include file name just after its command line option string (without spaces: /FImyheader.h.
  • PREPROCESSOR_DEFINE_SEPARATOR_OPTION=<string>: Separator of the list of preprocessor symbols. For example, if set to ,, CoverageScanner will detect the symbols DEF1 and DEF2 when parsing the string DEF1,DEF2.
  • PREPROCESSOR_CMD=<string>: Preprocessor command line. CoverageScanner does only analyze preprocessed files. The command generated the C or C++ file used for the code coverage analysis.

    The following variables are available:

    • $TMP1$...$TMP9$: Temporary file names. The temporary files are removed on exit.
    • $OPTIONS$: Preprocessing options that are extracted from the command line arguments and contain the list of includes, preprocessor symbols, and so on.
    • $TOOL$: Compiler command (TOOL variable).
    • $ARCHITECTURE$: Architecture detected or specified by --cs-architecture.
    • $PROFILE_PATH$: Path of the profile file.
    • $SOURCE$: Source file name.
    • $OUTPUT$: Preprocessor output file name. If this variable is present in the command line, it contains the name of a temporary file used as output for the preprocessor. If not present, it is assumed that the preprocessor generates its output to stdout.

    The preprocessor output is stdout. If this parameter is omitted in the configuration, the preprocessor step is skipped.

    The preprocessor command must set the symbol __COVERAGESCANNER__ to 1. For example:

    $TOOL$ $OPTIONS$ -D__COVERAGESCANNER__=1 -E $SOURCE$

Profile parameters for linker settings

  • LINKER_HIDE_OPTION_NO_ARG=<string>: List of single options (without arguments) which should not be transmitted to the native linker.
  • LINKER_HIDE_OPTION_ONE_ARG=<string>: List of options with one argument which should not be transmitted to the native linker.
  • LINKER_HIDE_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options to hide is directly appended (no space characters are placed between the option and the arguments).
  • OBJ_EXT=<string>: List of extensions for object files separated with a semicolon. For example: .obj.
  • DYN_LIB_EXT=<string>: List of extensions for dynamic libraries separated with a semicolon. For example: .dll.
  • STATIC_LIB_EXT=<string>: List of extensions for static libraries separated with a semicolon. For example: .lib.
  • UNIX_LIBRARY_NAME=<YES/NO>: The library name follows the Unix standard.
  • LINK_LIBRARY_OPTION=<string>: Link option which selects libraries. For example: -l.
  • LINK_LIBRARY_OPTION_APPEND=<YES/NO/ALLOW>: Append the library directly after the link option string (-lfoo).
  • LINK_OUTPUT_OPTION=<string>: Linker output option. For example: -o.
  • LINK_OUTPUT_OPTION_APPEND=<YES/NO/ALLOW>: Append the linker output file directly after the option string (without spaces, -ofoo.o).
  • LINK_OUTPUT_DEFAULT=<string>: Linker output default filename.

    The following variables are available:

    • $TMP1$...$TMP9$: Temporary file names. The temporary files are removed on exit.
    • $BASENAME_SRC$: Base name of the first source file. The base name is the filename without extension. For example: $BASENAME_SRC$.exe
  • LINK_ADDITIONAL_ARGUMENTS=<list>: Additional arguments passed to the linker when instrumenting the source code.
  • DEFAULT_LIB_PATH=<string>: List of directories which contains the shared libraries. For example: /usr/library;/usr/share/library.
  • DLL_OPTION=<string>: Linker command line option which generates a shared library or a DLL. For example: /DLL.
  • DLL_OUTPUT_STATIC_LIB=<string>: Static library (associated with the DLL) output file name. For example: /IMPLIB:foo.lib.
  • DLL_OUTPUT_STATIC_LIB_APPEND=<YES/NO/ALLOW>: Append the static library (associated with the DLL) output file directly after the option string (without spaces, /IMPLIB:foo.lib).
  • STATIC_LIB_AS_DEFAULT=<YES/NO>: Instrumentation database name takes as base name the static library name associated with a DLL.
  • LIBRARY_PATH_OPTION=<string>: Link option which adds additional directories to the library search path. For example: -L.
  • LIBRARY_PATH_OPTION_APPEND=<YES/NO/ALLOW>: Append the directory name directly after the option string. For example: -L/foo.
  • AR_COMMAND_FORMAT_OPTION=<YES/NO>: The GNU librarian (ar) has a specific command line syntax which is supported when this option is set.
  • OUTPUT_IS_FIRST_ARGUMENT=<YES/NO>: The first argument of the command line is the destination file.
  • STDIN_MRI_SCRIPT_OPTION=<list>: Use an MRI script to generate a library. The script is provided by the standard input.
  • GENERATE_COVERAGESCANNER_LIBRARY=<YES/NO>: Generate the CoverageScanner library during the linking operation. Disable when generating static libraries.
  • SKIP_GENERATE_COVERAGESCANNER_LIBRARY_OPTION=<string>: Skip the generation of the CoverageScanner library.
  • LIBGEN_AUTODETECT_ARGS_OPTION_NO_ARG=<string>: List of single compilation options (without arguments) which should be used for the compilation of the CoverageScanner library.
  • LIBGEN_AUTODETECT_ARGS_OPTION_ONE_ARG=<string>: List of compilation options with one argument which should be used for the compilation of the CoverageScanner library.
  • LIBGEN_AUTODETECT_ARGS_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options is directly appended (no space characters are placed between the option and the arguments).
  • AUTODETECT_MS_RUNTIME_OPTION=<list>: List of command line options that select the runtime library (for Visual Studio®: /MT;/MD;/ML;/MLd;/MTd;/MDd)
  • INSTRUMENTATION_TABLES_LINKED_DURING_RUNTIME=<YES/NO>: Instead of linking all instrumentation tables when calling the linker, link it at application runtime.
  • INSTRUMENTATION_TABLES_LINKED_DURING_RUNTIME_SUPPORT=<YES/NO>: Specify whether linking all instrumentation tables at application runtime is supported.
  • PLUGIN_REGISTRATION_API=<YES/NO>: If set, __coveragescanner_register_library() and __coveragescanner_unregister_library() are provided by the CoverageScanner API to register instrumented plugins during the execution.
  • FILE_FORMAT_SPECIFIER=<YES/NO>: If set, file format specifiers (see command line option --cs-output) are supported at runtime.
  • INSTRUMENTATION_TABLES_OF_DLL_LINKED_DURING_RUNTIME=<YES/NO>: Instead of linking all instrumentation tables of DLL when calling the linker, link it at application runtime.
  • COVERAGESCANNER_REGISTRATION_UID=<YES/NO>: Generate a unique symbol in each static and dynamic library to retrieve the code coverage counters.
  • INJECT_COVERAGESCANNER_LIBRARY_AT_END=<YES/NO>: If YES, the CoverageScanner library is always inserted at the end of the linker command line arguments.
  • COSMIC_LINKER_SCRIPT=<YES/NO>: Support COSMIC linker scripts. CoverageScanner will try to recognize a script by trying to parse it.
  • COSMIC_LINKER_SCRIPT_EXT=<string>: File extension of the COSMIC linker file.
  • GNU_LINKER_SCRIPT=<YES/NO>: Support GNU linker scripts. CoverageScanner will try to recognize a script by trying to parse it.
  • GNU_LINKER_SCRIPT_OPTION=<string>: A GNU linker script.
  • GNU_LINKER_SCRIPT_OPTION_APPEND=<YES/NO/ALLOW>: Append the GNU linker script directly after the linker script command line option string. For example: -Tfoo.script.
  • VS_DEF_FILE_OPTION=<string>: Command line option for specifying the module definition file (.def file). For example: VS_DEF_FILE_OPTION=/DEF:.
  • VS_DEF_FILE_OPTION_APPEND=<YES/NO/ALLOW>: If set, the command line option for specifying the module definition file is directly appended to the file name (no space characters are placed between the option and the arguments).

Profile parameters for compiler settings

  • COMPILER_ONLY=<YES/NO>: If true, the native tool is only a compiler which has no linker capabilities.
  • COMPILER_HIDE_OPTION_ONE_ARG=<string>: List of options with one argument which should not be transmitted to the native compiler.
  • COMPILER_HIDE_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options to hide is directly appended (no space characters are placed between the option and the arguments).
  • BYTECODE_EMULATOR=<string>: If set, the call of the native toolchain is made by calling a byte code interpreter.

    For example: BYTECODE_EMULATOR=/math/to/mono.exe permits forcing the call of mcs.exe in a specific Mono emulator.

  • TOOL=<string>: Native compiler/linker command (example: gcc).

    The following variables are available:

    • $PROFILE$: Profile name without extension.
  • REMOVE_EXT=<string>: List of file extensions, separated with a semicolon, of files to remove from the command line arguments.
  • COVERAGESCANNER_DISABLE_EXT=<string>: List of file extensions, separated with a semicolon, of file extensions which disable CoverageScanner.
  • IGNORE_EXT=<string>: List of file extensions, separated with a semicolon, of files to ignore. Ignored files are not instrumented.
  • C#_EXT=<string>: List of extensions for C# files separated with a semicolon. For example: .cs.
  • C_EXT=<string>: List of extensions for C files separated with a semicolon. For example: .c.
  • CPP_EXT=<string>: List of extensions for C++ files separated with a semicolon. For example: .cpp;.cxx.
  • CPP_LANGUAGE_OPTION=<string>: List of command line options passed to the compiler in C++ mode.
  • C_LANGUAGE_OPTION=<string>: List of command line options passed to the compiler in C mode.
  • LANGUAGE_SELECTION_OPTION=<string>: List of command line options which select the computing language (C, or C++).
  • LANGUAGE_SELECTION_OPTION_APPEND=<YES/NO/ALLOW>: Append the selected language directly after the option string.
  • LANGUAGE_SELECTION_OPTION_C_KEYWORD=<string>: List of arguments of the language selection command line option which force the switching in C mode.
  • LANGUAGE_SELECTION_OPTION_CPP_KEYWORD=<string>: List of arguments of the language selection command line option which force the switching in C++ mode.
  • COMPILER_CMD=<string>: Compiler command line, which is used to generate the CoverageScanner library during the linking phase.

    The following variables are available:

    • $TMP1$...$TMP9$: Temporary file names. The temporary files are removed on exit.
    • $COMPILER$: Compiler command (COMPILER variable).
    • $SOURCE$: Source file name.
    • $DESTINATION$: Destination file name.
    • $LIBGEN$: Contents of the command line option --cs-libgen.

    For example: $COMPILER$ -c $SOURCE$ -o $DESTINATION$.

  • COMPILER_CMD_OPTION_NO_ARG=<string>: List of single options (without arguments) which are extracted from the command line and which are used for compiling the CoverageScanner library.
  • COMPILER_CMD_OPTION_ONE_ARG=<string>: List of options with one argument which are extracted from the command line and which are used for compiling the CoverageScanner library.
  • COMPILER_CMD_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the arguments of the options to use for the compilation is directly appended (no space characters are placed between the option and the arguments).
  • COMPILER_ADDITIONAL_ARGUMENTS=<string>: Additional arguments passed to the compiler when instrumenting the source code.
  • COMPILE_OPTION=<string>: Compile command line option. For example: -c.
  • COMPILER_OUTPUT_OPTION=<string>: Compiler output option. For example: -o.
  • COMPILER_OUTPUT_OPTION_AT_END=<YES/NO>: If no output is specified in the command line, add it explicitly at the end (if YES) or at the beginning of the command line arguments. The default is YES.
  • COMPILER_OUTPUT_OPTION_APPEND=<YES/NO/ALLOW>: Append the compiler output directly after the option string (without spaces, -ofoo.o) if COMPILER_OUTPUT_OPTION_APPEND is true.
  • COMPILER_OUTPUT_DEFAULT=<string>: Compiler output default filename.

    The following variables are available:

    • $TMP1$...$TMP9$: Temporary file names. The temporary files are removed on exit.
    • $BASENAME_SRC$: Base name of the first source file. The base name is the filename without extension. For example: $BASENAME_SRC$.obj.
  • CALLING_CONVENTION=<string>: The calling convention (__stdcall, __cdecl or __fastcall) on Windows platform.
  • FUNCTION_ATTRIBUTE=<string>: Additional compiler attributes to each function of the CoverageScanner library.
  • DESTRUCTOR_ATTRIBUTE=<string>: Additional compiler attribute to automatically call the functions that reset the code coverage information when the application is shut down or when a dynamic library is unloaded. This attribute is only necessary when the instrumentation tables are registered at runtime.
  • CONSTRUCTOR_ATTRIBUTE=<string>: Additional compiler attribute to automatically call functions that initialize the code coverage information when the application starts. This attribute is only necessary when the instrumentation tables are registered at runtime.
  • DESTRUCTOR_PRAGMA=<string>: Additional compiler pragma attribute to automatically call the functions that reset the code coverage information when the application is shut down or when a dynamic library is unloaded. The variable $SYMBOL$ is parsed and replaced through the symbol on which the pragma is applied. This attribute is only necessary when the instrumentation tables are registered at runtime.
  • CONSTRUCTOR_PRAGMA=<string>: Additional compiler attribute to automatically call functions that initialize the code coverage information when the application starts. The variable $SYMBOL$ is parsed and replaced through the symbol on which the pragma is applied. This attribute is only necessary when the instrumentation tables are registered at runtime.
  • DLL_EXPORT=<string>: Compiler attribute that exports a symbol from a DLL/shared library.
  • DLL_IMPORT=<string>: Compiler attribute that imports a symbol from a DLL/shared library.
  • FORCE_DLL_EXPORT=<YES/NO>: Force the use of the DLL_EXPORT attribute during the linking phase instead of DLL_IMPORT.
  • FORCE_DLL_EXPORT_OPTION=<string>: Force the use of the DLL_EXPORT attribute when it appears in the command line.
  • PARALLEL_COMPILATION_OPTION_APPEND=<YES/NO/ALLOW>: Indicates whether the number of processors is directly appended to the command which enables the parallel build.
  • PARALLEL_COMPILATION_OPTION=<list>: Enable a parallel build. If this command line argument is followed by an integer, this value indicates the maximum number of parallel builds to execute.
  • SYSTEM_INCLUDES=<list>: List of system include directories. For example: /usr/include.
  • INCLUDE_PATH_OPTION=<string>: Add include directories. For example: -I.
  • INCLUDE_PATH_OPTION_APPEND=<YES/NO/ALLOW>: Append the include directory name directly after the option string. For example: -I/foo.
  • CUSTOM_MALLOC_INCLUDE=<string>: Additional include for custom malloc()/free() functions. For example: <stdlib.h>.
  • CUSTOM_MALLOC_FUNCTION=<string>: Custom body of a malloc() function. The body should return a void* and the parameter int size indicates the number of bytes to be allocated. For example: return malloc((size_t)size);.
  • CUSTOM_FREE_FUNCTION=<string>: Custom body of a free() function. The parameter void* ptr points to the memory to be freed. For example: free(ptr);.
  • LOCALE_SYSTEM_FILE_ENCODING=<YES/NO>: If YES, the locale system configuration of text encoding is used for compiling a source file.
  • OBJECT_DIR_OPTION=<string>: Directory in which the objects are stored. For example: -object-dir=debug/.
  • OBJECT_DIR_OPTION_APPEND=<YES/NO/ALLOW>: Append the directory directly after the option string (without spaces, -object-dir=foo).
  • WARNINGS_TO_DISABLE=<list>: List of compiler warnings to disable. Each item of the list will be used to generate a compiler pragma which enables/disables a compilation warning.
  • WARNING_DISABLE_PRAGMA=<string>: Preprocessor directive which disables a compiler warning. The variable $WARNING$ will be parsed and contains the warning number which should be disabled and \n is expanded as a carriage return. For example: #pragma warning disable $WARNING$.
  • WARNING_ENABLE_PRAGMA=<string>: Preprocessor directive which enables/restores a compiler warning. The variable $WARNING$ will be parsed and contains the warning number which should be enabled and \n is expanded as a carriage return. For example: #pragma warning restore $WARNING$.
  • COVERAGESCANNER_CSHARP_DYNAMIC=<string>: Regular expression which enables the support of the C# dynamic type. For example: ^/define:.*\<COVERAGESCANNER_CSHARP_DYNAMIC\>.*$.
  • COVERAGESCANNER_NO_CSHARP_DYNAMIC=<string>: Regular expression which disables the support of the C# dynamic type. For example: ^/define:.*\<COVERAGESCANNER_NO_CSHARP_DYNAMIC\>.*$.
  • ACTIVATE_CSHARP_DYNAMIC=<string>: Command line argument which sets the define __COVERAGESCANNER_CSHARP_DYNAMIC__ to enable the C# dynamic support. For example: /define:__COVERAGESCANNER_CSHARP_DYNAMIC__.

Profile Parameters for Precompiled Headers Support

  • PCH_EXT=<string>: List of extensions for precompiled header files separated with a semicolon. For example: .pch.
  • CREATE_PCH_OPTION_APPEND=<YES/NO/ALLOW>: Indicates whether the PCH header generated is directly appended to the command line option.
  • CREATE_PCH_OPTION=<list>: List of command line options which are generating precompiled headers. For example: /Yc.
  • USE_PCH_OPTION_APPEND=<YES/NO/ALLOW>: Indicates if the PCH header used is directly appended to the command line option.
  • USE_PCH_OPTION=<list>: List of command line options which select a precompiled header. For example: /Yu.
  • PCH_OUTPUT_OPTION=<string>: Specify the precompiled header output. For example: /Fp.
  • PCH_OUTPUT_OPTION_APPEND=<YES/NO/ALLOW>: Append the precompiled header output directly after the option string (without spaces, -Fpfoo.pch) if PCH_OUTPUT_OPTION_APPEND is true.
  • PCH_OUTPUT_DEFAULT=<string>: Default precompiled header output file name.

    The following variable is available:

    • $TMP1$...$TMP9$: Temporary file names. The temporary files are removed on exit.
    • $BASENAME_SRC$: Base name of the first source file. The base name is the filename without extension.

    For example: $BASENAME_SRC$.pdb.

Profile parameters for execution time measurement

  • PERF_CLOCK_HEADER=<list>: Additional C header used to access to the performance counters.
  • PERF_CLOCK_TYPE=<string>: Type name for the performance counters. For example: clock_t. The size of the counter must be 64 bits.
  • PERF_CLOCK_READ=<string>: Function which reads the performance counters. The variable $OUT$ is the output parameter of this call.
  • PERF_CLOCK_ADD=<string>: Function which adds two performance counters. The variables $A$ and $B$ are the input parameters of this call. The variable $O$ stores the output result.
  • PERF_CLOCK_SUB=<string>: Function which subtracts two performance counters. The variables $A$ and $B$ are the input parameters of this call. The variable $O$ stores the output result.
  • PERF_CLOCK_CONVERT=<string>: Function which converts a performance counter to a string. The variables $I$ and $O$ are the input and output parameters of this call. The output is a fixed point floating point number which corresponds to the time in seconds.

Profile Parameters for Profiling

  • PROF_CLOCK_HEADER=<list>: Additional C header used to access to the performance counters.
  • PROF_CLOCK_ADDITIONAL_ARG=<list>: Additional linker argument for building the code with a profiler support.
  • PROF_CLOCK_TYPE=<string>: Type name for the performance counters. For example: clock_t. The size of the counter must be 64 bits.
  • PROF_CLOCK_READ=<string>: Function which reads the performance counters. The variable $OUT$ is the output parameter of this call.
  • PROF_CLOCK_ADD_ATOMIC=<string>: Function which adds a value to performance counters. The variable $I$ is the value to add. The variable $O$ is modified and stores the output result. This operation needs to be atomic because it is used in a multithreading context.
  • PROF_CLOCK_SUB=<string>: Function which subtracts two performance counters. The variables $A$ and $B$ are the input parameters of this call. The variable $O$ stores the output result.
  • PROF_CLOCK_CONVERT=<string>: Function which converts a performance counter to a string. The variables $I$ and $O$ are the input and output parameters of this call. The output is a fixed point floating point number which correspond to the time in seconds.

Profile parameters for custom IO

  • CSEXE_FOPEN=<string>: fopen function used by the generation of the execution report file.
  • CSEXE_FCLOSE=<string>: fclose function used by the generation of the execution report file.
  • CSEXE_FPUTS=<string>: fputs function used by the generation of the execution report file.
  • CUSTOM_SETUP=<NONE/POSIX/MS/GNU/MSCE/C++>:
    • NONE: CoverageScanner does not provide the function __coveragescanner_install(). Do not use on embedded systems, which do not provide the functions signal() and atexit().

      The code coverage information is saved only when __coveragescanner_save() is called.

    • POSIX: CoverageScanner provides a function __coveragescanner_install(), which installs a handler that saves the execution report when the application terminates. The handler is installed using POSIX functions signal() and atexit().

      If __coveragescanner_install() is not called, the code coverage information is only saved when __coveragescanner_save() is called.

    • GNU: Similar to the POSIX setting, except that if __coveragescanner_install() is not called, a default handler is used which saves the code coverage data in the file coverage.csmes on a normal application exit.

      If __coveragescanner_install() is not called, the code coverage information is not saved on abnormal exit, such as a crash or software interruption.

    • MS: Same as GNU but for Microsoft Visual Studio compiler.
    • C++: Install a handler written in C++ which saves the code coverage data in the file coverage.csmes upon normal application exit. CoverageScanner provides a function __coveragescanner_install(), which only changes the name of the destination file.
    • MSCE: Same as C++ but for Microsoft® eMbedded Visual C++® compiler.

Miscellaneous profile parameters

  • FCNTL_FILE_LOCK=<YES/NO>: Use fcntl file locking provided by some Unix systems.
  • PCH_HIDE_OPTION_NO_ARG=<string>: List of single options (without arguments) which should not be transmitted to the native tool (compiler or linker) when precompiled headers are disabled using --cs-no-pch.

    For example: -Yd;/Yd for disabling the precompiled headers on Microsoft Visual Studio}.

  • PCH_HIDE_OPTION_ONE_ARG=<string>: List of options with one argument which should not be transmitted to the native tool (compiler or linker) when precompiled headers are disabled using --cs-no-pch.

    For example: -Yl;-Yc;-Yu;-YX;/Yl;/Yc;/Yu;/YX for disabling the precompiled headers on Microsoft Visual Studio}.

  • PCH_HIDE_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options to hide is directly appended (no space characters are placed between the option and the arguments) when precompiled headers are disabled using --cs-no-pch.
  • HIDE_OPTION_NO_ARG=<string>: List of single options (without arguments) which should not be transmitted to the native tool (compiler or linker).

    For example: -Yd;/Yd for disabling the precompiled headers on Microsoft Visual Studio}.

  • HIDE_OPTION_ONE_ARG=<string>: List of options with one argument which should not be transmitted to the native tool (compiler or linker).

    For example: -Yl;-Yc;-Yu;-YX;/Yl;/Yc;/Yu;/YX for disabling the precompiled headers on Microsoft Visual Studio}.

  • HIDE_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the argument of the options to hide is directly appended (no space characters are placed between the option and the arguments).
  • PDB_EXT=<string>: List of extension for debug information files separated with a semicolon. For example: .pdb.
  • PDB_OUTPUT_OPTION=<string>: Command line option for specifying the debug information file. For example: PDB_OUTPUT_OPTION=/Fd.
  • PDB_OUTPUT_OPTION_APPEND=<YES/NO/ALLOW>: If set, the command line option for specifying the debug information file is directly appended to the file name (no space characters are placed between the option and the arguments).
  • SBR_EXT=<string>: List of extension for symbol browser files separated with a semicolon. For example: .sbr.
  • SBR_OUTPUT_OPTION=<string>: Command line option for specifying the symbol browser information file. For example: SBR_OUTPUT_OPTION=/Fr;/FR.
  • SBR_OUTPUT_OPTION_APPEND=<YES/NO/ALLOW>: If set, the command line option for specifying the symbol browser information file is directly appended to the file name (no space characters are placed between the option and the arguments).
  • USE_RESPONSE_FILE=<YES/NO/ALLOW>: Pack all compiler/linker command line options into a response file. This is generally necessary on Microsoft Windows due to the command line limitation length. The option ALLOW uses a response file only if a response file is used in the command line arguments of the native compiler. A response file is only used if the command line size reaches a limit defined by MINIMUM_COMMAND_LINE_SIZE_FOR_RESPONSE_FILE.
  • MINIMUM_COMMAND_LINE_SIZE_FOR_RESPONSE_FILE=<integer>: If the command line arguments are fewer than the specified size, no response file is used.
  • MAXIMUM_COMMAND_LINE_SIZE_FOR_RESPONSE_FILE=<integer>: Ensures that if a command line size does overflow this value, a response file is used.
  • RESPONSE_FILE_EXT=<string>: List of file extensions for the response file.
  • RESPONSE_FILE_OPTION=<list>: Command line option for specifying the response file. For example: RESPONSE_FILE_OPTION=@.
  • RESPONSE_FILE_OPTION_APPEND=<YES/NO/ALLOW>: If set, the command line option for specifying the response file is directly appended to the file name (no space characters are placed between the option and the arguments).
  • STRIP_CPP_COMMENTS_IN_RESPONSE_FILE=<YES/NO>: If set, the C/C++ comments are removed in the command line options.
  • CODE_STYLE=<C++/C#>: Language supported.
  • EXIT_FUNCTIONS=<string>: List of functions which cause an application exit. For example: EXIT_FUNCTIONS=abort;exit.
  • ENABLE_COVERAGESCANNER_PER_DEFAULT=<YES/NO>: Enable code coverage analysis by default. This is equivalent to implicitly setting the command line option --cs-on. This option has an impact only if the native executable has the same name as the CoverageScanner wrapper.
  • DEACTIVATE_COVERAGESCANNER=<YES/NO>: Disable CoverageScanner globally if set to YES.
  • DEACTIVATE_COVERAGESCANNER_OPTION_NO_ARG=<string>: List of command line options that deactivate CoverageScanner. For example: DEACTIVATE_COVERAGESCANNER_OPTION_NO_ARG=-M;-MM;-MD;-MMD.
  • DEACTIVATE_COVERAGESCANNER_OPTION_ONE_ARG=<string>: List of command line options with one argument that deactivate CoverageScanner.
  • DEACTIVATE_COVERAGESCANNER_OPTION_ONE_ARG_APPEND=<YES/NO/ALLOW>: If set, the command line option which disables CoverageScanner is directly followed by an argument (no space characters are placed between the option and the arguments).
  • COVERAGESCANNER_LIBRARY_OBJECT=<string>: Name of the CoverageScanner object containing its library code. On Unix, its default value is __cs_library.o. On Microsoft Windows, its default value is __cs_library.obj.
  • EXIT_VALUE_ON_SUCCESS=<list>: List of exit values that are returned by the native linker or compiler and that mean that the command was successful.
  • ERROR_TO_STDOUT=<YES/NO>: Print the error messages to the standard output and not to the error output.
  • ERROR_FORMAT=<string>: Format of the errors. The following items are parsed:
    • %m: Error message.
    • %f: File name.
    • %e: File name, C-escaped.
    • %l: Line.
    • %c: Column.
    • %e: Error type (warning, info or error)
    • %E: Error type (warning or error). Same as %e but an information is displayed as a warning.
    • %n: New line.
  • ERROR_FORMAT_LINE=<string>: Same as ERROR_FORMAT but used when no column information is available.
  • ERROR_FORMAT_TEXT=<string>: Same as ERROR_FORMAT but used when no column and line information is available.
  • ERROR_FORMAT_BEGIN=<string>: Start banner of the CoverageScanner error messages.
  • ERROR_FORMAT_END=<string>: End banner of the CoverageScanner error messages.
  • ERROR_FORMAT_ESCAPE_CHARS=<YES/NO>: If set, all backslashes in the file names and the error messages will be escaped.
  • ADDITIONAL_ARGUMENT_SEPARATOR=<string>: Additional character used as a separator for the command line arguments. For example: ADDITIONAL_ARGUMENT_SEPARATOR=, for VisualDSP++ compiler.
  • CORRECT_FILENAME_IN_COMPILER_MESSAGE=<YES/NO>: If enabled, CoverageScanner replaces in the compiler/linker messages the file name used for the instrumentation with the real source filename of the project.
  • SUPPRESS_PATH_ENTRY=<YES/NO>: If set to YES, CoverageScanner alters the PATH variable and removes its own location when calling the native compiler.
  • ATEXIT=<string>: Command line used to register the application exit handler which saves the execution report upon the application exit.
  • FORCE_ESCAPING_RULES_RESPONSE_FILE=<NO/MS/POSIX>: Rules for escaping command line arguments in response files:
    • POSIX: Escaping rules for UNIX® platforms
    • MS: Escaping rules for Microsoft Windows.
    • NO: Native escaping rules for the current platform.
  • FILESYSTEM_8.3=<YES/NO>: If set, the extension of the execution report file name is .cse. If the application file name is application.exe, the generated report will be application.cse, not application.exe.csexe.
  • OUTPUT_BUFFER_SIZE=<integer>: Size of the internal buffer used for generating an execution report. A higher value permits a better performance because it minimizes the I/O system calls. For embedded system, 64 should be a good value and for other platforms 32768 is recommended.

Instrumentation Parameters

  • RETURN_INSTRUMENTED_IN_EXPRESSION=<YES/NO>: If true, return statements are instrumented into the returned expression. For example: return inst[0]++, x;.