Hierarchy of Configuration Files and Command Blocks

Configuration files are looked up from several locations, and determine the settings in a certain order.

Configuration Files

All configuration files found in the following locations are used by Testwell CTC++:

  • Windows
    1. ctc.ini in the Testwell CTC++ home directory (environment variable CTCHOME).
    2. Files specified by the environment variable CTCINIT.
    3. ctc.ini in the current directory.
    4. Configuration files explicitly specified in the command line by the -c option. Multiple files are separated by a semicolon, and they are read in the given order.
  • Linux/ Unix
    1. /usr/local/lib/ctc/ctc.ini
    2. lib/ctc/ctc.ini in the user's home directory.
    3. ctc.ini in the Testwell CTC++ home directory (environment variable CTCHOME).
    4. File .ctc.ini in the user's home directory.
    5. Files specified by the environment variable CTCINIT.
    6. .ctc.ini in the current directory.
    7. Configuration files explicitly specified in the command line by the -c option. Multiple files are separated by a semicolon, and they are read in the given order.

The files found are used in above order, hence it is recommended not to use more of these locations than necessary. The option -V from ctc shows which configuration files are present and used. The settings from the latter files extend or replace former settings.

Command Blocks

In a command block like
[Microsoft Visual C++]
  COMMAND = cl
  TYPE    = compiler_linker
  PREPROC_C   = %COMMAND% /E /nologo /D__CTC__ %FLAGS% %FILE% > %RESULT%
  PREPROC_CXX = %COMMAND% /E /nologo /D__CTC__ %FLAGS% %FILE% > %RESULT%
  ...
the options for one or more compiler / linker are defined. The parameter COMMAND with its list of compiler and linker names is the entry point for ctc when it processes the compilation command.

All command blocks with the same name in […], present in a configuration file processed afterwards, are also applied.

To specify additional settings for a compiler or linker command in a second configuration file, it is necessary that the command block has the same name, but the COMMAND does not need to be repeated.