Skip to content

Latest commit

 

History

History
63 lines (42 loc) · 1.55 KB

README.md

File metadata and controls

63 lines (42 loc) · 1.55 KB

C++ Scaffold for Code Retreat

This code scaffold uses CxxTest. We recommend using the docker image euranova/cxxtest, but installing cxxtest with the package manager is also an option.

Option 1: use docker wrapper scripts

See scripts/ folder.

Start docker image

Start a bash prompt in the docker image, with the code mounted as a volume, using the provided script:

./cpp-env

See https://docs.docker.com/engine/installation for instructions on how to install docker.

Run the tests

In order to run the tests, execute the following command:

make test

make does the following:

  • parse the test file (in our case test/Tests.h) using cxxtestgen and generate the C++ code for the test runner,
  • build the test runner along with the code to be tested using g++,
  • run the test executable.

Clean

To remove the build folder, which contains all the generated files:

make clean

Writing tests

When writing tests, it is important to keep the src-files and header-files constants updated in the Makefile if new files are added or removed.

For more information about CxxTest assertions, see CxxTest's documentation

Warning

When using cxxtestgen with the --fog-parser option, the following warning is displayed:

WARNING: Couldn't create 'cxxtest.parsetab'.
[Errno 13] Permission denied: '/cxxtest/python/python3/cxxtest/parsetab.py'

This warning can safely be ignored.