C++test will automatically extract options from the project (e.g., from its Makefile or Visual Studio configuration). You may also specify additional options that persist even when the Makefile or Visual Studio configurations change. These options can be specified at the project level or file level, and they can be specified for source files, standalone test suite files, and user-defined stubs.
To specify options at the project level:
Right-click the project tree node for the project you want to specify settings for, then chooseProperties from the shortcut menu. The Properties dialog will open.
- Expand the Parasoft> C++test category in the left pane.
Select the Build Settings category.
- Specify options in the Compiler options and/or Linker options fields.
- -
DPARASOFT_CPPTEST
is added to the compiler options by default. You can add any additional options after that. - You can add options, but not remove them (unless you can overwrite the original options with negatives, such as undefine symbols, etc.).
- The
${cpptest:original_options}
variable can be used to access the original project options.
- -
- (Optional) If you want modify the directory where C++test looks for runtime headers and source files during analysis, modify the value in the Runtime library source field.
- This is especially useful if you are using modified versions of the runtime library source files. For example, if you need to modify those files, you can copy the runtime directory from the C++test installation folder to the new location, modify it there, and set the Runtime library source to this new location. This way, the original C++test runtime implementation will be untouched.
- Each project can be set to use different runtime directories independently.
- Resource location, project location, or environment variables can be used. The
${cpptest:engine_loc}/runtime
variable can be used to access the original C++test runtime.
- Click Apply, then OK.
To specify options at the file level:
Right-click the project tree node for the file for which you want to specify settings, then chooseProperties from the shortcut menu. The Properties dialog will open.
- Expand the Parasoft> C++test category in the left pane.
- Select the Build Settings category.
Enable Use custom options.
- Specify options in the Compiler options field.
-DPARASOFT_CPPTEST
is added to the compiler options by default. You can add any additional options after that.- You can add options, but not remove them (unless you can overwrite the original options with negatives, such as undefine symbols, etc.).
- The
${cpptest:original_options}
variable can be used to access the original project options.
- Click Apply, then OK.