This page lists the command line options for
Configuring the Test Configuration
This option allows you to specify the test configuration that will be used for analysis. The option must be followed by the name of a built-in, user-defined or DTP-hosted test configuration. Examples:
cpptestcli -config "builtin://MISRA C"
cpptestcli -config "user://My_Config"
cpptestcli -config "dtp://New_Rules"
Prints a list of available test configurations and can be used to obtain a vaild test configuration name you can pass with the
Configuring the Compiler
Specifies compiler configuration name to be used for code analysis and instrumentation. Compiler configuration name needs to be one of the supported compilers names. See Supported Compilers or use the
Prints a list of supported compilers and can be used to obtain a vaild compiler ID you can pass with the
Detects the compilers based on the compiler command (the executable name) you specify with or without the path). You can provide a list of compiler commands with a semicolon-separated list and use this option to obtain a valid compiler ID to pass with the
-compiler option. Example:
Configuring the Input Scope
-trace <build command>
Specifies the build command that starts the build process to compile the files to be tested. The information about the build process and the input scope data collected during the build are stored in the
cpptest.bdf file. C/C++test-specific options must be specified before
-trace, because all values following
-trace will be interpreted as a build command. Example:
-compiler gcc_3_4 -trace make clean all
-input <build data file|project file>
Specifies the path to an existing build data file (.bdf) or another project definition file to collect the input scope.
Build data file: You can create a build data file with the -trace option or by using the standalone
Project file: Currently, Microsoft Visual Studio projects and solutions (.vcproj, .vcxproj, .sln) are supported. Additionally, when specifying Microsoft Visual Studio project or solution you can provide configuration and platform to collect data for <PROJECT_FILE>@<CONFIGURATION>|<PLATFORM>.
-input "[email protected]|Win32"
-- <compile command
A switch to collect the input scope form a compile command. Ensure the compile command is complete and includes your compiler executable, compiler flags, and source files.
C/C++test-specific options must be specified before
-- switch, because all values after
-- switch will be interpreted as a compiler command. Example:
-compiler gcc_3_4 -- gcc -I include Bank.cxx
-module [<module name>=]<module root directory>
Specifies the module root directory and associates it with a module. If the module name is not specified, C/C++test uses the directory name as the module name.
This option allows you define modular structure for C/C++test files included in the .bdf file:
- a source file located in the specified module root directory (or its subdirectory) belongs to the associated module
- a header file located in the specified module root directory (or its subdirecotyr) beliongs to the associated module
- a header file included in a tested source file is tested only if it belongs to the same module as the source file
You can specify this option more than once to define multiple modules - for example, files included in one .bdf file can be divided into different modules.
This option is not supported for Microsoft Visual Studio projects / solutions (.vcproj, .vcxproj, .sln).
-resource <path|file name>
Narrows down the input scope to the specified resources. You can specify one of the following:
- a path to a file – to test a selected file
- a path to a directory – to test the files included in the selected directory
- a file name - to only test the files that match the specified name
-include <file|pattern> and -exclude <file|pattern>
Includes/excludes file(s) that match the specified pattern into/from instrumentation scope. The options can be specified multiple times.
Final filtering is determined only after all include/exclude entries have been specified in the order of their specification.
Provide an absolute path to a file (you can use
* as a wildcard). Examples:
Alternatively, you can specify the list of files to be included and/or excluded in a text file with the
.lst extension and pass the file with the
-resource switch - each line in the file will be treated as a single entry.
Specifies the directory where the report will be created.
A switch to publish the results to the DTP server.
-settings <path>, -localsettings <path>, and -ls <path>
Specifies the path to a custom
.properties file that includes customized settings in the following format:
key=value, for example
You can use the
-settings switch multiple times to specify several .properties files. Entries with the same key will be overwritten. Examples:
Configures a single setting in the following format:
You can use the
-property switch multiple times to configure several settings. Earlier entries with the same key will be overwritten. Examples:
-property cpptest.report.csv.enabled=true -property
Prints the current settings and customizations.
Specifies an advanced configuration file provided by Parasoft Support. Example:
Prints your machine ID.
-encodepass <your password>
Prints an encoded password that can be used in the .properties configuration file.
Specifies the workspace directory to be used during code analysis and instrumentation. The workspace location is used to store C/C++test data files (such as
cpptest.bdf) and incremental data directory (
.cpptest). If not specified, C/C++test uses your working directory for storage. Example:
You can run only one instance of C/C++test per workspace.
Displays detailed progress information by increasing console verbosity.
Fails the command by returning a non-zero exit code if any findings are reported.
Prints information about the version of C/C++test.
Displays command line help.