Program Changes

With the small example from the basic tutorial, we describe the workflow with Testwell CTC++ when the code is changed.

Let us continue our little example. Assume we have to make some change to io.c file, perhaps a bug fix, and we wish to instrument the new io.c file and continue testing. Once io.c has been edited (and perhaps experimentally compiled for ensuring that it is syntactically correct -- Testwell CTC++ assumes that its input source files are correct C or C++ code) we can handle the case in our example as follows:
ctc -i m cl /c io.c
ctc cl prime.obj io.obj calc.obj

The first command line instruments and compiles the io.c file and leaves the result in the io.obj file. No linking takes place, because the '/c' options prevents it.

The second command line makes the linking. cl command is used as it can also be used for linking. On the command line there are no C or C++ source files and thus no instrumentation takes place there. However, there is one thing ctc does: it adds the Testwell CTC++ run-time library to the linking command that is finally executed. Here it is not necessary, but possible and having no effect, to give the -i option to ctc as there are no source files to be instrumented.

Then we do some additional testing with the new instrumented program and finally get the coverage and profiling figures out, for example as follows:
ctcpost MON.sym MON.dat -p profile.txt

When we now look at the profile.txt execution profile listing, we notice that the counters for file io.c correspond only to the test run just executed. The counters for files prime.c and calc.c correspond cumulatively to all test runs. Because the code in io.c was changed and file reinstrumented its previous counters became obsolete and were left out (actually, here, overwritten in the file MON.dat).