...
If you have a custom build system (for example, Makefile-based), you can streamline the process of configuring build settings by using C/C++test’s cpptestscan
utility, which collects information about your build process. You can then point C/C++test to the generated "build data file" to configure build settings, as described in Use options from a build data file.
Info | ||||
---|---|---|---|---|
| ||||
In most cases, C/C++test needs to invoke the compiler and linker in order to perform static analysis and runtime testing tasks, which commonly involve preprocessing, compiling, and linking programs. |
Anchor | ||||
---|---|---|---|---|
|
...
Option | Environment Variable | Description | Default |
---|---|---|---|
| CPPTEST_SCAN_OUTPUT_FILE) | Defines file to append build information to. | cpptestscan.bdf |
| CPPTEST_SCAN_PROJECT_NAME | Defines the suggested name of the C++test project. | name of the current working directory |
| CPPTEST_SCAN_RUN_ORIG_CMD | If set to "yes", the original command line will be executed. | yes |
| CPPTEST_SCAN_QUOTE_CMD_LINE_MODE | Determines the way C++test quotes parameters when preparing cmd line to run.
cpptestscanQuoteCm dLineMode is not supported on Linux | all |
| CPPTEST_SCAN_CMD_LINE_PREFIX | If non-empty and running original executable is turned on, the specified command will be prefixed to the original command line. | [empty] |
| CPPTEST_SCAN_ENV_IN_OUTPUT | Enabling dumps the selected environment variables and the command-line arguments that outputs the file. For advanced settings use – cpptestscanEnvFile –cpptestscanEnvFile and – cpptestscanEnvars –cpptestscanEnvars options | no |
| CPPTEST_SCAN_ENV_FILE | If enabled, the specified file keeps common environment variables for all build commands; the main output file will only keep differences. Use this option to reduce the size of the main output file. Use this option with – cpptestscanEnvInOut –cpptestscanEnvInOut put enabled | [empty] |
| CPPTEST_SCAN_ENVARS | Selects the names of environment variables to be dumped or '*' to select them all. Use this option with – cpptestscanEnvInOut –cpptestscanEnvInOut put enabled. | * |
| CPPTEST_SCAN_USE_VARIABLE | Replaces each occurrence of "VALUE" string in the scanned build information with the "${VAR_NAME}" variable usage. | [empty] |
-- cpptesttraceTraceComm and | CPPTEST_SCAN_TRACE_COMMAND | Defines the command names that will be traced when collecting build process information. These names, specified as regular expressions, should match the original compiler/linker commands used in the build process. |
...
Note | ||
---|---|---|
| ||
The |
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. |