This lesson explains how to create a C++test project in the Eclipse-based version of C++test (standalone or plugin) The projects are created using the general project import Eclipse facilities and a C++test-specific module for processing proprietary project files. C++test supports the following project types:
The following exercises assume that a supported compiler is available on your machine, and the ATM example training project has been copied to an appropriate directory.
Learn how to create a C++test project to use in code analysis and testing from a standard make-based built project. |
ATM
) in the Project name field.examples\ATM
. The new project will appear in the Project Explorer view, which is on the left hand side of the GUI.The build command line is preset to include the -B switch option (unconditionally make all targets). Only GNU Make 3.80+ supports this option. If you are using an earlier make, clean the build before creating a project. Keep the -k switch. If you are using a make that does not support -B, further modification of the command line is required. The default build command line used in the project properties does not have any targets. We recommend that you modify this command line with the target(s) used to build the code you want analyzed For example:
Also, add a
This would first make the |
Projects for C++test need to be created only once; they can then be checked into source control and shared. All other team members can reuse the existing project setup. Therefore, for the most part, C++test users will not be creating projects by themselves, but rather importing existing projects that were checked into source control.
For a reusable C++test project, check in the following files, which are created in the project location:
|
To import an existing project from disk:
Choose Parasoft > Test Using > Built-in > Static Analysis > Parasoft’s Recommended Rules. The progress dialog will indicate when the test is completed. The dialog should report that checking has been performed on 8 files. TheConsolelog should report a summary of violations found. (If you do not see theConsoleview, chooseWindow > Show View > Console).