Table of Contents

Unit Testing

Running the Unit Tests

First, check with the README to see what the latest approach is. As of this writing (June 2019), this works:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
make
make test

The tests themselves are .cpp files in the test directory (e.g. test/accidentals.cpp). The test/CMakeLists.txt file has a list of the tests that will be built/run. Individual tests can be run directly from the build directory:

build/test/accidentals

Older Unit Testing Information

This information appears to be outdated.

Unit tests are useful to call code in isolation during development (so you don't need to start the entire GUI to test every change), and for regression tests.

A couple of unit tests for Rosegarden have been written in src/test.

Building

Enable WANT_TEST in ccmake and build the codebase as usual

Running

Run 'make test'

Creating new unit tests