In this section:
Table of Contents | ||
---|---|---|
|
Conditional Content | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
OverviewThe input scope defines the C and C++ source files to test with C/C++test DTP Engine. The input scope also provides the full set of information about compiler options and environment, so C/C++test can re-create the original build environment to provide accurate test results. See Running Static Analysis 1 for information about defining compilers. Analyzing a Single FileSee Running Static Analysis 1 for instructions. Analyzing a Makefile-based ProjectSee Running Static Analysis 1 for instructions. Analyzing Code Using Existing Build DataOnly the source files defined in the build data file will be analyzed. Header files included by the source files will be excluded from analysis. See the following sections for additional information:
C/C++test treats the input scope as a set of unrelated source files. Defining modules allows you to introduce a well-defined source file structure and add additional files, such as header files, into the Input Scope. Modules are defined by specifying its name and the root directory. All tested files located in the root directory or its sub-directories will belong to the module. All header files located in the root directory or its sub-directories that are included by the tested source files will also belong to the module and be analyzed with the source files. For all files from the module, a "module-relative path" will be available. A project-relative path is computed as a relative path from the module root to the actual file location. In most cases, module-relative paths are independent of machines, so the test results can be easily shared across different machines. Example of Module StructureThe first block of code describes a simple directory/file structure. In the second block of code, the relationships between the files and module root directory are described, as well as which files will be analyzed:
Assuming module MyApp is defined with
Defining a Basic Module StructureUse the -[<MODULE_NAME>=]<MODULE_ROOT_LOCATION> switch to define a module. If the name is unspecified, the name of the root directory will be used:
Alternatively, module structures can be defined in a custom configuration file using the
Defining a Module with Multiple Root LocationsAdd a logical path to the module name that points to the appropriate root location to define multiple, non-overlapping locations:
Fine-tuning the Input ScopeUse the
You can specify the following resources in the path:
Use the -include and -exclude switches to apply additional filters to the scope.
If both switches are specified, then all files that match
The
You can specify a file system path to a list file ( |