Component Testing for C++ settings

The Component Testing settings for C++ are part of the Configuration Settings dialog box, which allows you to configure settings for each node in your workspace.

The Component Testing for C++ node settings lets you to customize the parameters for the Component Testing for C++ feature of HCL OneTest Embedded.

By default, the settings of each node are inherited from those of the parent node. When you override the settings of a parent node, changes are propagated to all child nodes within the same Configuration. Overridden fields are displayed in bold.

Contract Check Options

These options are used by the C++ Contract-Check Script.

  • Break on assertion failure:Select this option to call a breakpoint function whenever an assertion fails in an.otcContract Check script. To use this feature, you must set a breakpoint on the functionpriv_check_failure (), located in the <target_deployment_port>/lib/priv.c, file. You can use this option, for example, to debug your application when an assertion fails.

  • Report only failed assertions: Select this option to hide passed assertions in the UML Sequence Diagram generated by Component Testing for C++. Only failed assertions are displayed. This option also reduces the size of the intermediate trace file.

  • Trace unchanged states: Select this option to report states in UML Sequence Diagram generated by Component Testing for C++ each time states are evaluated. If the option is disabled, states are reported in UML Sequence Diagram only when they change. This affects both trace size and UML Sequence Diagram display size, but has no impact on execution time.

  • Check 'const' methods: Usually C++ const methods are not checked for state changes because they cannot modify a field of the this object. Instead, const methods are only evaluated once for invariants. In some cases, however, the this object may change even if the method is qualified with const (by assembler code, or by calling another method that casts the this parameter to a non-const type). There may also be pointer fields to objects which logically belong to the object, but the C++ Test Script Compiler will not enforce that these pointed sub-objects are not modified. Select this option only if your code contains such code implementations.

  • Reentrant objects:Select this option if your application is multi-threaded and objects are shared by several threads. This ensures granularity for state evaluation. This option has no effect if multi-thread support is not activated in the Target Deployment Compilation Settings.

  • Enforce 'const' assertions: When this option is selected, the compiler requires that invariant and state expressions are constant. Disable this option if you do not use the const qualifier on methods that are actually constant.

Testing Options

These options are used for the C++ Test Driver Script.

  • Add #line directive into instrumented source file:This option allows use of#linestatements in the source code generated by Component Testing for C++. Disable this option in environments where the generated source code cannot use the#linemechanism. By default#linestatements are generated.

  • Application includes system files: Set this option to Yes if the application includes system files such as windows.h in Windows or pthread.h in UNIX.

  • Break on CHECK failure:Select this option to call a breakpoint function whenever a check failure occurs in an .otd Test Driver script. To use this feature, you must set a breakpoint on the function priv_check_failed (), located in the <target_deployment_port>/lib/priv.c, file. You can use this option for debugging purposes.

  • Test class friend of class under test:Set this setting toYes if you want the test to access any private or protected members (friend classes) of the components under test. The class must be mentioned in an OTC file to be recognized as a friend of the test class.

  • Instances stack size: This value defines the maximum level for C++ Test Driver Script calls that you expect to reach when running an .otd Test Driver script. The C++ Test Driver Script calling stack includes RUN, CALL and STUBs. The default value is 256 and should be large enough for most cases. When using recursive stubs, you may need to increase this value.

  • Display only failed CHECKs:Select this option to hide notes related to passed CHECK statements in the UML Sequence Diagram generated by Component Testing for C++. Failed checks are still displayed. The component testing report is not affected by this option. This option also reduces the size of the intermediate trace file.

  • Display all PRINT arguments in a single note:Select this option to display only one UML note for all arguments of aPRINTstatement in the Component Testing for C++ UML Sequence Diagram. This option requires use of aPRINTbuffer, which uses memory on the target machine. Disable this option if memory on the target is an issue. In this case, Component Testing for C++ generates one UML note for each argument of eachPRINTstatement.

  • PRINT buffer size (bytes):With the previous option selected, this option defines the size, in bytes, of the buffer devoted to thePRINTinstructions during the execution. This buffer should be large enough to handle the complete result of aPRINTinstruction. You may have to increase this value if yourPRINTstatements contain many arguments, or if arguments are long strings.

Advanced options

This area specifies the path and filenames for the intermediate files generated by the Component Testing for C++ feature during the test execution.

  • Test driver file name:contains the location and name of a .cppsource file generated from the C++ Test scripts by Component Testing for C++

  • Contract check file name:contains the path and file name of a temporary.otifile created during source code instrumentation by Component Testing for C++

  • Test report file name (.xrd):contains the location and name of the.xrdreport file generated by Component Testing for C++

  • Maximum test compilation errors displayed:Specifies the maximum number of error messages that can be displayed by the C++ Test Script Compiler. The default value is 30.

Related Topics

About Configuration Settings | C++ Test Driver Script | C++ Contract-Check Script