C++test's primary working unit is an Eclipse project: specifically, a CDT project. This is important because CDT provides two basic project configurations as well as two creation modes:
- Managed Make Project: Not recommended when testing for Tornado. Refer to the CDT manual for more information.
- Standard Make Project: Recommended when testing for Tornado. You don't always have to provide a Makefile in this mode, especially when you don't require or want CDT to build the project (which is not required for C++test to test). Essentially, C++test projects are standard make projects.
C++test projects must be properly configured. Even if you think that your project's default configuration is correct, you should always review/adjust its initial C++test settings after project creation in order to prevent problems. For more information about C++test project properties, including instructions for how to access them, see Reviewing and Modifying Settings.
C++test uses the term "options source" to specify the source from which C++test primarily obtains the compilation and linking options for every tested file, as well as the list of tested sources and any other required/useful information. During project configuration, the options source is typically the first setting specified, since other C++test project properties depend on it. We say that C++test projects are based on the option sources used; e.g., when we speak of a Makefile-based project, we mean that it's configured to use a Makefile as the options source.
Two option sources are useful when testing for Tornado:
- a Tornado project file (.wpj): This is the recommended options source, since it enables data to be read directly from their primary source. You can import complete Tornado projects into he C++test workspace using a specially-designed import wizard, and the options source will be set appropriately (see Using a Tornado Project (.wpj) as the Options Source).
- a Makefile: This refers to the Makefile that the Tornado environment creates for a project during the build. We recommend that you treat it as a secondary source, since it may not be valid when you change options in the Tornado project and forget to (re)build it (see Using a Makefile as the Options Source).
There are two ways to create C++test projects suited for testing with Tornado:
- Using the Tornado project import wizard: The wizard scans the specified Tornado project to create "Tornado project file"-based projects in the C++test workspace. This is the simplest way to create a project in most cases, and is especially useful when you are getting started with testing for Tornado (see Using the Tornado Import Wizard).
- Manually: You manually create Makefile- or "Tornado project file"-based projects (see Creating Projects Manually).
After projects are created, you should:
- Ensure that the project includes source files to test. If you used the Tornado project import wizard, then the appropriate source directories are typically linked automatically. If you created these projects manually, then you must manually add the sources (for instructions, see step 2 of Using an External Location as the Project Location).
- Specify target/platform-specific options in the project properties dialog (see Setting Target/Platform Dependent Options).