...
For non-make based build systems, usage of cpptestscan and cpptesttrace is very similar to the examples shown above. Typically, a compiler is defined as a variable somewhere in the build scripts. To create a Build Data File from that build system using cpptestscan, prefix the original compiler executable with cpptestscan. To create a Build Data File from that build system using cpptesttrace, prefix whole build command line with cpptesttrace.
Info |
---|
When should I use cpptestscan?It is highly recommended that the procedures to prepare a build data file are integrated with the build system. In this way, generating the build data file can be done when the normal build is performed without additional actions. To achieve this, prefix your compiler and linker executables with the cpptestscan utility in your Makefiles / build scripts. When should I use cpptesttrace?Use cpptesttrace as the prefix for the whole build command when modifying your Makefiles / build scripts isn’t possible or when prefixing your compiler / linker executables from the build command line is too complex. |
Anchor | ||||
---|---|---|---|---|
|
...
If you store your test artifacts, such as test cases or stubs, in a source control system, do not check in the automatically generated project definition files or build data files (.bdf). These files should be generated every time your CMake project is build.
Defining the C/C++test Project
To enable CMake to automatically generate C/C++test project files, you must define a target that represents your C/C++test project in the cpptest_add_executable()
function. At a minimum, you must must configure:
...