This topic provides an overview of C/C++test integration with QNX Momentics.
The C/C++test plugin is integrated with QNX Momentics IDE by means of the standard Eclipse plugin installation mechanism; see Installing C/C++test as a Plugin for details.
You can run the C/C++test plug-in using a local (machine-locked) license or a network license served from Parasoft DTP or from a standalone instance of Parasoft License Server. See Licensing for details on how to configure the license.
In order to perform static analysis or unit testing, C/C++test must collect the following information from your QNX project:
The information is collected from the QNX Momentics IDE project structure description by scanning make files.
qcc <options> <file>
options_scanner <options> qcc <options> <file>
After the build process is completed, C++test will have all the necessary data collected.
Before you start testing, ensure that the project’s compiler/linker options source is correctly set. In most cases, C/C++test automatically detects the necessary settings. The compiler/linker flags source settings are specified in the Build Settings screen. To access the build settings:
The following configuration options are available:
Choose a strategy for collecting compiler/linker switches from the drop-down menu.
For testing of QNX projects directly, choose Use Options from QNX build system. The C++test options extractor is designed to scan QNX make files. The compiler/linker executable name, compiler/linker command lines, and the system environment used to start the compilation/linking process are scanned. All these settings are later used during the C++test analysis.
The Compiler settings area lets you specify the compiler set/tools used for compiling the project's sources and building the test executable. Settings include:
Specify any additional compiler or linker options you want to include, as well as the location of the runtime library.
DPARASOFT_CPPTEST
is added to the compiler options by default. You can add any additional options after that. ${cpptest:original_options}
variable can be used to access the original project options.Also see Specifying Options in the C/C++test Project or File Options Panel.
Before you start static analysis, verify that the appropriate compiler settings are used in the Project Properties panel's Parasoft> C/C++test> Build Settings area. In most cases, it is best to set the Options source as Use Options from QNX build system. After confirming that compiler settings are correct, you can start the analysis.
For general information on performing static analysis with C/C++test, see Static Code Analysis and Flow Analysis. |
This section covers both Unit Testing and Application Monitoring.
For embedded testing, the C++test runtime library must be cross-compiled for the chosen platform before you can perform unit testing. The built-in "Run QNX Momentics Tests" Test Configuration does this building automatically.
If you need to build C++test runtime library manually, follow the instructions in Working with the C/C++test Runtime Library — using QNX_5.mk
as the target configuration.
C/C++test provides a Test Configuration template designed specifically for testing QNX Projects. This Test Configuration is in Builtin> Embedded Systems> QNX> Run QNX Momentics Tests. It covers all steps required for full unit testing of QNX Projects:
This Test Configuration is only a template; it needs to be customized to reflect your remote QNX system configuration as follows:
This test configuration is based on rcp (allow remote copy) and rsh (allow remote shell execution) tools available in Windows. The remote QNX system needs to be configured to allow remote calls from rcp and rsh. It is also possible to modify test execution flow and use different tools instead of rcp and rsh.
Use Eclipse Internal debugging mode. For more details see:
For general information on generating and executing unit test cases with C/C++test, Test Creation and Execution. |
C/C++test provides a Test Configuration template designed especially for running a QNX application with memory monitoring: Builtin> Embedded Systems> QNX> Build and Run Application with Memory Monitoring for QNX Momentics. This Test Configuration provides all steps required for running QNX application monitoring, including:
This Test Configuration is only a template; it needs to be customized to reflect your remote QNX system configuration. To customize it:
This Test Configuration is based on scp (allow remote copy) and rsh (allow remote shell execution) tools available in Windows. The remote QNX system needs to be configured to allow remote calls from rcp and rsh. It is also possible to modify test execution flow and use different tools in place of rcp and rsh.
For general information on performing application monitoring and runtime error detection with C/C++test, see Runtime Error Detection. |