C/C++ Unit Test Tasks: Quick Reference

The following table describes common unit testing tasks for C/C++ projects.

To perform this task Follow these steps
Create tests for individual C/C++ functions.
  1. Right-click a source file in the Projects window or in the editor window and choose Create Test > New test type
  2. Select the functions you want to test in the Select Elements dialog box and click Next.
  3. Specify the test name and the filename for the test and click Finish.
  4. Edit the generated test files to test the project's functions.
Create an empty test.
  1. Right-click the project's Test Files folder and select New test type.
  2. Specify the test name and the filename for the test and click Finish.
Run a single test suite.
  1. Right-click the Test Files subfolder of the test suite you want to run.
  2. Choose Test.
Run all tests for a project.
  1. Select any node in the project for which you wish to run tests.
  2. Choose Run > Test Project project name (Alt-F6) from the main menu.
Debug a test suite.
  1. Right-click the folder of a test suite you want to debug.
  2. Choose Debug Test.
Debug a single test.
  1. Run tests and view the results in the Test Results window.
  2. Right-click an individual test in the Test Results window and choose Debug.

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.