If you cannot (or prefer not to) use the previously-mentioned project creation/import strategies, create the project from the GUI as follows:
- If you want the test files (automatically-generated settings files, test files, stub definitions, etc.) stored in the same directory as the project source, see Using the Source Directory as the Project Location
- Otherwise, see Using an External Location as the Project Location. This option must be used when:
- More than one project needs to refer to the same source directory/directories, and/or
- When you want to keep test artifacts completely separate from the source code directories.
Using the Source Directory as the Project Location
To create a project using the source directory as the project location:
- Choose File> New> Project> C/C++> C Project or C++ Project.
- Click Next. The projects wizard will open.
- Enter a name for the project in the Project name field.
- Disable the Use default location option.
- Enter the path to the actual source directory in the Location field.
- Under Project Types, select Makefile project.
- Under Toolchain, select the appropriate Toolchain.
- (Optional) If you want to use Eclipse to build your project, click Next, then complete the settings in the available tabs.
- Click Finish.
Using an External Location as the Project Location
To create a project using an external location as the project location:
- Create an empty project as follows:
- Choose File> New> Project> C/C++> C Project or C++ Project.
- Click Next. The projects wizard will open.
- Enter a name for the project in the Project name field.
- Click Finish.
- Link your source files to that project as follows:
- Choose File> New> Folder.
- Select the name of the project that you created in Step 1.
- Click the Advanced button.
- Enable the Link to folder in file system option.
- Enter or browse to the location of your source files.
- Click Finish.
The linked files will appear within the project folder in the C/C++ Projects view and Project Explorer view, but they will continue to "live" within their original location. C/C++test will not add any new files to the linked source location; any files that it generates will be saved in the project directory.
Warning - Using Appropriate Build Settings
When configuring a project with a linked source folder, you need to modify any project build settings that refer to ${project_loc};
these settings must be changed to use resource_loc
instead. If you do not change these default settings, the project’s source files will be skipped during testing.
To change the project’s build settings:
- Right-click the C/C++ Projects tree node for the project, then choose Properties from the shortcut menu. The Properties dialog will open.
- Expand the Parasoft> C/C++test category in the left pane.
- Select the Build Settings category.
- Modify the Build working directory setting to
${resource_loc:/<project name>/<linked source dir>/<actual make working dir path from there>}.
- Modify the Dependency file(s) setting to
${resource_loc:/<project name>/<linked source dir>/<actual make working dir path from there>/Makefile}.
See Important note for projects with linked source folders for details on how to make the appropriate modifications to your build settings.