...
Table of Contents | ||
---|---|---|
|
Modifying the Scope for a Test Configuration
By default, C/C++test analyzes all the resources that are selected when a the test configuration is run. You can configure your test configuration to narrow down the default scope by specifying runs, but you can configure a narrower scope using the scope options available on the test configuration's Scope tab. See Scope Tab Settings: Defining What Code is Tested.
Modifying the Scope on the Project Level
You In addition, you can configure the scope on the project level by excluding resources in the GUI (see Excluding Project Resources from Testing) or by using the -resource
, -exclude
, or - includ
e include
options when running analysis in the command line (see Testing from the Command Line Interface).
Anchor | ||||
---|---|---|---|---|
|
You can restrict the scope of analysis to locally modified files or to files modified on the current working branch by setting up file filters based on source control data. This allows you to focus on identifying and fixing bugs introduced by your recent code changes before checking the code is checked in into your source control system or merged merging with the main development stream.
...
Create an advanced settings file that includes C/C++test's advanced scope settings. See Advanced Scope Settings for a complete list of available settings. The contents of the advanced settings file may resemble the following:
Code Block // This configuration narrows down the scope of analysis to locally modified files // (including header files). scope.scontol.files.filter.mode=local cpptest.scope.adjuster.cu.enabled=true
Code Block // This configuration narrows down the scope of analysis to files (including header files) // that are different betweenon the current working branch that differ andfrom the main stream of development.: scope.scontol.files.filter.mode=branch cpptest.scope.adjuster.cu.enabled=true
Code Block // This configuration narrows down the scope of analysis to files (including header files) // that are different between on the current working branch that differ andfrom branch "feature_372": scope.scontol.files.filter.mode=branch scope.scontrol.ref.branch=feature_372 cpptest.scope.adjuster.cu.enabled=true
- Specify the path to the advanced settings. See Configuring an Advanced Settings File for details.
...
Setting | Description |
---|---|
scope.scontrol.files.filter.mode=local | Checks only locally modified files. |
scope.scontrol.files.filter.mode=branch | Checks only files that are different between on the current working branch and that differ from the reference branch. By default, the reference branch is the main integration stream, such as "master", "trunk", etc. You can specify a custom branch with scope.scontrol.ref.branch . |
scope.scontrol.ref.branch=[branch or revision] | Specifies the name or ID of the branch or revision with which the current working branch is compared to identify and analyze modified files. It applies when the scope.scontrol.files.filter.mode option is set to branch . |
cpptest.scope.adjuster.cu.enabled=true | Enables checking all files that belong to the same compilation unit as the file that has been modified. This applies to both source files and header files. C/C++test cannot analyze header files directly. This option allows you to ensure that modified header files are analyzed, even if the source files that include them remain unchanged. |