CopperSpice Overview
Unit Testing

The purpose of unit testing is to validate the functionality of a given section of code. Each unit test is designed to test one particular method for the specified CopperSpice class.

Installing Catch2

Catch2 is a header only library and is included with the source code for CopperSpice.

Configuring CopperSpice

By default the Catch2 unit test executables will not be built. To build the tests add the following line to your config script before the call to CMake. Make sure you adjust the prefix path to reflect the location of Catch2 on your computer.

export CMAKE_FLAGS="-DBUILD_TESTS=on -DCMAKE_PREFIX_PATH=/c/Catch2/lib/cmake/Catch2"

Running

The test executables are located in the build/bin/test folder. On Windows run the batch file, run_coretest from a Windows command prompt. From any other platform simply run the CsCoreTest executable.

You can also run the unit tests from CTest which is part of CMake.