Testwell CTC++ / Integration to Visual Studio
Here our context is Windows
platform. On it, when the application code is built in command line
mode (or from makefiles), and let the compiler be VC++ 5.0, VC++6.0,
VC++ 7.1 or VC++ 8.0, CTC++ is readily usable. See
the basic CTC++ description for more.
The help of
these IDE integration packages are not needed in such usage.
When the application code is built via the
Visual Studio IDE the following is also supported:
These facilitate intuitive and seamless use
of CTC++ via the coresponding IDE. These integration add-on
packages are different from their technical implementation, and
slightly also how they are used. However, the general look-and-feel is
the same in all of them. Below these integrations are described in
more detail.
CTC++ Integration to Visual Studio 5.0/6.0 IDE
Selecting the project
The first thing to do is to select the
project and its configuration, which will be tested with CTC++. This is
done by some of the normal Visual Studio 5/6 means by setting the
selected projects active. In this example the project is 'Cube'. The
active project might contain subprojects, too.
CTC++ additions in the Visual Studio 5/6 Tools menu
Three commands are added to the Tools menu:
- CTC++ Build/Clean...
- CTC++ Execute...
- CTC++ Report...
Instrumenting and building the instrumented project
Tool command CTC++ Build/Clean... gives this dialog. Here a number of selections can be made regarding what will be instrumented and what instrumentation options will be used. If there had been subprojects, each of them can be instrumented independently, or leaving the main project (main target) or some of the subprojects (subtargets) as non-instrumented.
By simply clicking Build the
project's C/C++ source files are instrumented by CTC++ Preprocessor
and the needed compilations and linking are invoked for getting
the instrumented target. Normal makefile optimizations take place for
saving processing time. For example, if you have changed only a couple
of the participating source files, only they are re-instrumented and
compiled for the new instrumented target.
Running the instrumented executable
Tool command CTC++ Execute... gives this dialog. If the
project target was an executable program, it (the CTC++ built version
of the program) can be started from here. Of course, the instrumented
program can also be executed with any of the normal means that programs
are generally executed on Windows. The instrumented code can also be in
a .dll or in a .lib file and it comes into execution when called from
an otherwise non-instrumented main program.
This is how it looks when our sample
instrumented executable runs. You may do multiple test runs and each of
them cumulates the execution history file.
Getting various CTC++ reports
Tool command CTC++ Report... gives this dialog. Various types CTC++ reports can be selected. The possible forms of reporting are:
- HTML-report
- Untested report to Dev. Studio
- Profile listing (textual)
- Untested listing (textual)
- Summary listing (textual)
- Timing listing (textual)
These same reports you can also generate in command line mode of CTC++ (utilities ctcpost, ctc2html, etc.).
The "Untested report to Dev.Studio" report is primarily meant for developers who quickly wish to have a look what code portions have not got a hit in the tests so far.
Cleaning the instrumented files and targets
Once you are satisfied with the structural test coverage measured by CTC++, in functional sense you have exercised the program thoroughly and you no more have found new errors, it is time to stop the testing. The thing to do is to select Clean... in the CTC++ Build/Clean... dialog and the disk is polished from all the auxiliary files and directories CTC++ has created.
Note that in the normal cource of work
CTC++ keeps your original source files and targets intact. In some
situations, say when instrumenting a DLL, you may explicitly request
CTC++ to write the instrumented target over the original one for
conveniently getting the instrumented target into execution. At
any time you can also (without doing Clean... in the CTC++
Build/Clean... dialog) build the non-instrumented project by normal
Visual Studio 5/6 means.
CTC++ Integration to Visual Studio .NET 2003/2005 IDE
But first a side-story of this Visual Studio use context. At Visual Studio the builds can be done also in command line mode, for example as follows:
devenv mysolution.sln /rebuild debugThese kind of builds can be made "ctc-builds" using ctcwrap command, as follows:
ctcwrap -i m -v devenv mysolution.sln /rebuild debugNext we talk of CTC++ usage in the GUI of these Visual Studio IDEs.
At installation phase two CTC++ specific commands have been inserted to the Visual Studio Tools menu, as follows:

Selecting CTC++ Set/Clean... brings you to the following dialog program where you set CTC++ Mode ON and select the instrumentation options that you wish to use during the coming build.

Next you (re)build your solution or project normally via the IDE
commands, for example as follows:
As a result the project target (all project
targets of the solution) get born as instrumented according to the
Visual Studio build rules.
Next the instrumented code (.EXE, .DLL,
.LIB) is executed. It may run in the Visual Studio context or
elsewhere, in the same way as the original code.
Finally the coverage reports can be
obtained using the ctcpost/ctchtml
programs either from the command line or integrated to Visual Studio
IDE. In the latter case you start the CTC++
Report... dialog program from the Tools menu. It looks as
follows:
- HTML report
- Untested report to Visual Studio
- Profile listing (textual)
- Untested listing (textual)
- Summary listing (textual)
- Timing listing (textual)
Cleaning the project from CTC++
The CTC++ Visual Studio .NET 2003 and 2005 integration behaves so that the instrumented project targets (object fies, executables) overwrite the original ones. Thus, for getting back to a non-instrumented level, you just rebuild your project without CTC++. Further, in the CTC++ Build/Clean... dialog there is a subdialog Clean..., which you can use for polishing the project directory from the CTC++ generated reports and other CTC++ auxiliary files.
List of Verifysoft Websites concerning CTC++
last updated: 11.07.2007
© 2007 Testwell Oy
CTA++, CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)
all other trademarks of this site are the property of their respective owners.

