Saving of Counters: Where
By default, for host programs the coverage data is saved as a datafile at the folder containing the symbolfile. This can be changed by several configuration parameters.
The default behavior
Two options determine the location and the name of the datafile. Their default setting is:
- Configuration parameter DATAFILE = %DEFAULT%,
- Environment variable CTC_DATA_PATH is not set.
With that setting, the datafiles (MON.dat) are written to the directory of the corresponding smybolfile(s) (MON.sym), and they are inheriting their file name (MyMON42.sym leads to MyMON42.dat).
Choosing a different location
At test time there may not be the same directory structure available as it was at instrumentation time. For example, the tests are run in a different machine. There are two options how to determine the location of the datafile:At test time: With the environment variable CTC_DATA_PATH, an existing directory on the test machine can be defined. That directory will contain the datafile(s) produced, with the file name of its symbolfile.
At instrumentation
time: With the configuration parameter DATAFILE, a file name and
a directory (absolute or relative path) can be determined. The file extension
.dat is added if not given explicitly. The directory has to
exist at testing time on the testing machine. For example, with the instrumentation
command
ctc –i m –C DATAFILE=MON5.dat cl –c file.c
the datafile will be MON5.dat in the current directory at test
time.