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

In order to build the CopperSpice unit tests the Catch2 software must be installed on your computer. There are two ways to proceed.

  • Option 1

Download the Catch2 library from github and follow their directions.   Catch2

  • Option 2

Download the following file from our web site and then extract to a folder on your computer.

Configuring CopperSpice

By default the Catch2 unit test executable will not be built. 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"


Go to your 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.