Skip to content

4. Unit Tests

rossGardiner edited this page Apr 19, 2022 · 1 revision

Unit tests have been written for the Signapse code-base where applicable. We have chosen to write our unit tests within the Google Test framework (see here). This is judged to be an easy way to develop test suites quickly without producing large numbers of executables. Google Test includes tools to organise tests into set groups which aids in writing clear and concise testing routines which will scale well in the future.

The system dependencies for Google Test are installed with our setup.sh script. Alternatively, they may be installed with apt:

sudo apt install libgtest-dev

You can build our test library with the regular build script:

bash build.sh

Or, navigate to the test directory and build

cd test/
cmake .
make 

Run our tests with the command (recommended):

./test/main

Or, if you prefer ctest, you may run:

ctest

Warning: this method treats the whole test library as a single executable; the output will be far less verbose than executing test/main.

Our test library is called with our continuous integration GitHub action, Build and Test.

Clone this wiki locally