Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

CppUTest tests the easy way

offa edited this page Mar 13, 2015 · 2 revisions

A guide to setup and run CppUTest tests with NetBeans using the file wizard.

For a detailed guide see: Editing CppUTest tests step-by-step

1. Setup

Setup a NetBeans project and CppUTest as described here (Section 1 - 3).

Optional: Create a test folder / logical folder within Test Files.

In this example, a test folder cpputest is used.

2. Create Test Files

Beside regular test source files, CppUTest requires a single test main. In this guide, there are two files created:

  • AllTests.cpp - test main
  • ExampleSuite.cpp - test suite

All test files are in New File -> Unit Tests.

2.1 Test main

Go to New File -> Unit Tests and add a new CppUTest Main. Follow the wizard; the created file already contains all settings necessary to run.

New Test Main Wizard

2.2 Test suite

Again, go to New File -> Unit Tests but now create a new CppUTest Test Suite. The wizard provides some settings, eg. generation of setup or teardown methods.

If everything is setup correctly, the test is ready to run.

Clone this wiki locally