In this section:

Introduction

This topic explains installation and basic setup instructions for the C++test plugin into QNX Momentics.

QNX Momentics IDE version 4.x is no longer supported.

Integration Overview

The C++test plugin is integrated with the QNX Momentics IDE by means of the Eclipse plugin mechanism. C++test plugs into QNX Momentics IDE by adding a link file to the following location:

<QNX Installation Root>/host/win32/x86/usr/qde/eclipse/links/com.parasoft.xtest.cpptest.link.

This link file contains the path to the C++test plugin; this informs QNX Momentics IDE that the plugin should be loaded at startup.

After installation C++test will add its views to the C/C++ perspective. Also, a separate C++test perspective will be available in Workbench.

Installation

Prerequisites

Installing

To install the C++test Eclipse plugin into QNX Momentics IDE:

  1. Run the C++test plugin installation executable.
  2. Choose the setup language.
  3. Click Yes when a dialog asks whether you want to install C++test.
  4. Click Yes after you have read and agreed to the license information.
  5. Choose the QNX target platform, then click Next.
  6. Enter your QNX Momentics installation directory (if not detected automatically), then click OK.
  7. Enter the desired destination directory for the C++test Extension files, then click Next.
  8. Close the IDE if it is open, then click OK to close the dialog reminding you to close this program. C++test will then start copying files and installing the necessary files into Momentics. A dialog box with a progress indicator will open and indicate installation progress. When the installation is complete, a notification dialog box will open.
  9. Click the OK button to close the notification dialog box.

During the installation process, C++test will try to create a link file in the QNX Momentics IDE’s embedded Eclipse. The link file will be located in <QNX Installation Root>/host/win32/x86/usr/qde/eclipse/links/com.parasoft.xtest.cpptest.link, and it will contain the path to the C++test installation directory. This is the only change that the C++test installation makes inside the QNX Software Development platform distribution.

Startup

After the plugin is successfully installed, you can start QNX Momentics IDE (with the C++test plugin installed) by launching it in the usual manner. After installation C++test will add its views to the C/C++ perspective.

Also, a separate C++test perspective will be available in QNX Momentics IDE.

Licensing

For licensing:

  1. Choose Parasoft> Preferences.
  2. Expand Parasoft> License in the left pane.
  3. For machine-locked licenses:
    1. Contact Parasoft with your Machine id.
    2. Enter your license expiration code and password in the Local License section of the License preferences page.
  4. For LicenseServer licenses:
    1. Select the Use LicenseServer option. The LicenseServer section of the License preferences page will become active.
    2. If the appropriate LicenseServer is not already set, select it from the Autodetected servers list and click Set. Or, manually enter your organization’s LicenseServer host (either a name or an IP address) in the Host name field, then enter your organization’s LicenseServer port in the Port number field.
    3. Indicate the license type that you want to use by selecting the appropriate option in the Edition box.
  5. Click Apply. The licensed options will be highlighted.

Uninstalling

To uninstall the C++test QNX Momentics IDE plugin:

Do not uninstall the C++test plugin by removing the file <QNX Installation Root>/host/win32/x86/usr/qde/eclipse/links/com.parasoft.xtest.cpptest.link. If you do this, you will still need to manually remove the C++test installation, and the Windows registry’s Install Shield information will remain.

Working with QNX Projects - Options Scanning

In order to perform static analysis or unit testing, C++test must collect the following information from your QNX project:

This information is taken from the QNX Momentics IDE project structure description and collected by scanning make files. This process involves the following steps:

  1. You start the C++test Test Configuration.
  2. The build process is started—but instead of using the actual compilation/linking command lines, the make file executes the command lines prefixed with the option scanning utility. The command line is generally modified as follows:
  3. The option scanner analyzes the command line and stores the compiler/linker options for further reuse.

After the build process is completed, C++test will have all the necessary data collected.

Project Configuration

Before you start testing, ensure that the project’s compiler/linker options source is correctly set. In most cases, C++test automatically detects the necessary settings. The compiler/linker flags source settings are specified in the Build Settings. To access the build settings:

  1. Right-click the project’s Navigator node, then choose Properties from the shortcut menu.
  2. Expand the Parasoft> C++test category in the left pane.
  3. Select the Build Settings category in the left pane.

The following configuration options are available:

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:

Static Analysis

Before you start static analysis, verify that the appropriate compiler settings are used in the Project Properties panel's Parasoft> 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++test, see Static Code Analysis and Flow Analysis.

Runtime Testing

This section covers both Unit Testing and Application Monitoring.

Unit Testing

Building the C++test Runtime Library for Testing QNX Projects

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++test Runtime Library — using QNX_4_2.mk or QNX_4_4.mk as the target configuration.

Test Configuration for QNX Unit Testing

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:

  1. Choose Parasoft> Test Configurations.
  2. Open the Builtin> Embedded Systems> QNX tree node.
  3. Right-click Run QNX Momentics Tests and choose Duplicate.
  4. Select the duplicated Test Configuration that now appears under User-defined.
  5. Open the  Execution tab
  6. Modify the Test Configuration properties to reflect your remote QNX system configuration:

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. 

Debugging Test Cases

Use Eclipse Internal debugging mode. For more details see:

For general information on generating and executing unit test cases with C++test, Test Creation and Execution.

Application Monitoring

Test Configuration for QNX Application Monitoring

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:

  1. Choose Parasoft> Test Configurations.
  2. Expand Builtin> Embedded Systems> QNX.
  3. Right-click Build and Run  Application with Memory Monitoring for QNX Momentics and choose Duplicate from the shortcut menu.
  4. Select the new Test Configuration that is added to the User-defined category.
  5. Open the Execution tab
  6. Modify the Test Configuration properties to reflect your remote QNX system configuration:

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 in place of rcp and rsh. 


For general information on performing application monitoring and runtime error detection with C++test, see Runtime Error Detection.