Versions Compared

Key

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

...

  • -nobuildPrevents C/C++test from rebuilding the project before testing it. Use this option if the project is already built before the test run.
  • -failFails the build by returning a non-zero exit code if violations or setup problems are reported (see Command Line Exit Codes for details about exit codes returned if the process fails).
  • -publish - Publishes the report to DTP. You can enable sending reports to DTP in the GUI or in the command line mode; see Connecting to DTP.
  • -report %REPORT_FILE% - Generates an XML report to the given file %REPORT_FILE% and adds an HTML report (or one or more reports in other formats, if specified using the report.format option) with the same name (and a different extension) in the same directory.
    All of the following commands will produce an HTML report filename.html and an XML report filename.xml.
    • -report filename.xml
    • -report filename.htm
    • -report filename.html

    If the specified path ends with an ".html"/".htm"/".xml" extension, it will be treated as a path to the report file to generate. Otherwise, it will be treated as a path to a directory where reports should be generated.
    If the file name is explicitly specified in the command and a file with this name already exists in the specified location, the previous report will be overwritten. If your command doesn’t explicitly specify a file name, the existing report file will not be overwritten—the new file will be named repXXXX.html, where XXXX is a random number.
    If the -report option is not specified, reports will be generated with the default names "report.xml/html" in the current directory.

  • -dtp.autoconfig %PROJECT_NAME@BASE_URL% - Pulls settings stored on the DTP server (recommended for ease of maintenance — especially if you do not already have a locally stored settings file). 
    For example:
    -dtp.autoconfig Project1@https://dtp.company.com:8443

  • -encodepass <plainpassword> - Generates an encrypted version of a given password using AES 256-bit encryption. Prints the message 'Encrypted password: <encpass>' and terminates the cli application. 
    If your nightly process will send emails, you can use this option to encrypt the required passwords.

  • -showdetailsPrints detailed test progress information.

  • -showsettings - Prints the current settings and customizations along with the information where each of them is configured (e.g. in the settings.properties file). See Configuring Localsettings for the list of settings you can configure.
  • -disablescm - Disconnects source control information from the solution and project.
    Disconnecting source control information from the solution and projects is useful, for example, to keep user input requests from reaching the source control plugin while running tests in cli mode. After running tests, source control information is restored. Disabling and reenabling source control is performed by modifying .sln solution file and .vcproj project files.
    To use this option, ensure that those files are writable (or run C/C++test from a user account with rights to make those files writable).
  • -solutionConfig %SOLUTION_CONFIG_NAME% - Specifies the solution configuration to use for building the solution and for analysis. Debug and Release are common names. If the switch is omitted, then the active configuration is used. Specifying the solution configuration is strongly recommended because the active configuration may change unexpectedly.
  • -targetPlatform %TARGET_PLATFORM_NAME% - Specifies the solution target platform to use for building the solution and for analysis. Any CPU and x86 are common names. If omitted, the active configuration is used. Specifying the target platform is strongly recommended because the active configuration may change unexpectedly.
  • -appconsole stdout|% OUTPUT_FILE%Redirects C/C++test's console output to standard output or an %OUTPUT_FILE% file. 
    Examples:
    -appconsole stdout (console redirected to the standard output)
    -appconsole console.out (console redirected to console.out file)
  • -list-compilersPrints a list of valid compiler family values. Must be used along with -solution.

  • -list-configs Prints a list of valid Test Configuration values. Must be used along with -solution.

  • -bdf - Specifies the path to an existing build data file (.bdf) or another project definition file to collect the input scope. See Using cpptestscan or cpptesttrace to Create a Build Data File for information about creating build data files. The option also supports JSON formatted files generated by the CMake build system when running static analysis. Use of the -bdf option to specify a JSON file for unit test execution is not currently supported.  
  • -include %PATTERN%, -exclude %PATTERN% - Specifies files to be included/excluded during testing. 
    You must specify a file name or path after this option.
    Patterns specify file names, with the wildcards *and ? accepted, and the special wildcard ** used to specify one or more path name segments. Syntax for the patterns is similar to that of Ant filesets.
    Examples:
    -include **/Bank.cpp (test Bank.cpp files)

    -include **/ATM/Bank/*.cpp (test all .cpp files in folder ATM/Bank)

    -include c:/ATM/Bank/Bank.cpp (test only the c:/ATM/Bank/Bank.cpp file)

    -exclude **/internal/** (test everything except classes that have path with folder "internal")

    -exclude **/*Test.cpp (test everything, but files that end with Test.cpp)

    Additionally if a pattern is a file with a .lst extension, it is treated as a file with a list of patterns.
    For example, if you use -include c:/include.lst and include.lst contains the following (each line is treated as single pattern):
    **/Bank.cpp

    **/ATM/Bank/*.cpp

    c:/ATM/Bank/Bank.cpp

    then it has same effect as specifying:
    -include **/Bank.cpp -include **/ATM/Bank/*.cpp

    -include c:/ATM/Bank/Bank.cpp"

...