Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel1

Info
iconfalse
titleExecutable

Verify that the executable (cpptestcli) is on $PATH. See Installation 1.

Info
iconfalse
titleIncremental Static Analysis

Anchor
Incremental Static Analysis
Incremental Static Analysis
C/C++test is optimized to minimize the impact on your development process. By reusing information collected in previous analysis runs, it can reduce the analysis time in subsequent runs. The information is stored in the .cpptest folder in your working directory (see the -workspace option).

To ensure optimal performance, avoid removing the .cpptest folder or deleting the contents of the folder.

Prerequisites

Compiler

C/C++test must be configured for use with specific C and C++ compilers and versions before you can analyze code. The configuration should reflect the original compiler and version used for building the code under test. The original compiler executable must be available on $PATH (unless it is specified with a full path). 

...

In both cases, you must specify the full path to either utility in your PATH environment variable. Additional options for cpptestscan and cpptesttrace are summarized in the following table. Options can be set directly for the cpptestscan command or via environment variables. Most options can be applied to cpptestscan or cpptesttrace by changing the prefix in the command line.

Basic cpptestscan usage:

...

Code Block
cpptestscan [options] [compile/link command]

...


cpptestscan --cpptestscanHelp

Basic cpptesttrace usage:

Code Block

...

cpptesttrace

...

 [options] [build command]

...


cpptesttrace --cpptesttraceHelp



OptionEnvironment VariableDescriptionDefault

--cpptestscanOutput-FilecpptestscanOutputFile=<OUTPUT_FILE>

--cpptesttraceOutput-FilecpptesttraceOutputFile=<OUTPUT_FILE>

CPPTEST_SCAN_OUTPUT_FILEDefines file to append build information to.cpptestscan.bdf

--cpptestscanProject-NamecpptestscanProjectName=<PROJECT_NAME>

--cpptesttraceProject-NamecpptesttraceProjectName=<PROJECT_NAME>

CPPTEST_SCAN_PROJECT_NAMEDefines a suggested name of the C++test project.name of the current working directory

--cpptestscanRun-OrigCmdcpptestscanRunOrigCmd=[yes|no]

--cpptesttraceRun-OrigCmdcpptesttraceRunOrigCmd=[yes|no]

CPPTEST_SCAN_RUN_ORIG_CMDIf set to "yes", the original command line will be executed.yes

--cpptestscanQuoteCmdLineMode=[all|sq|none]

--cpptesttraceQuoteCmdLineMode=[all|sq|none]

CPPTEST_SCAN_QUOTE_CMD_LINE_MODE

Determines the way C++test quotes parameters when preparing cmd line to run.

all: all params will be quoted

none: no params will be quoted

sq: only params with space or quote character will be quoted

--cpptestscanQuoteCmdLineMode is not supported on Linux.

all

--cpptestscanCmd-LinePrefixcpptestscanCmdLinePrefix=<PREFIX>
--cpptesttraceCmd-LinePrefixcpptesttraceCmdLinePrefix=<PREFIX>

CPPTEST_SCAN_CMD_LINE_PREFIXIf non-empty and running original executable is turned on, the specified command will be prefixed to the original command line. [empty]

--cpptestscanEnvInOutput=[yes|no]

--cpptesttraceEnvInOutput=[yes|no]

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 and --cpptestscanEnvars options.

no

--cpptestscanEnv-FilecpptestscanEnvFile=<ENV_FILE>

--cpptesttraceEnv-FilecpptesttraceEnvFile=<ENV_FILE>

CPPTEST_SCAN_ENV_FILEIf 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 --cpptestscanEnvInOutput enabled.[empty]

--cpptestscanEnvars=[*|<ENVAR_NAME>,...]

--cpptesttraceEnvars=[*|<ENVAR_NAME>,...]

CPPTEST_SCAN_ENVARSSelects the names of environment variables to be dumped or '*' to select them all. Use this option with --cpptestscanEnvInOutput enabled.*

--cpptestscanUseVariable=[VAR_NAME=VALUE,...]

--cpptesttraceUseVariable=[VAR_NAME=VALUE,...]

CPPTEST_SCAN_USE_VARIABLEReplaces each occurrence of "VALUE" string in the scanned build information with the "${VAR_NAME}" variable usage.[empty]
--cpptesttraceTraceCommand=[<regexp>|<regexp>|...]CPPTEST_SCAN_TRACE_COMMANDDefines 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.

Anchor
re-analyzing_projects
re-analyzing_projects
Re-analyzing a Project without Re-building

...