Unittests based on CxxTest. The goal is to facilitate automatic grading of students labs.
Installed Python with packages ply, pytest:
sudo pip install ply pytest.
-
Download and unpack CxxTest.
-
Setup env veriables:
export CXXTEST="path/to/unpacked/cxxtest/folder/"
export CPATH="$CXXTEST:$CPATH"
(e.g. export CXXTEST="/home/aliaksei-kuzmin2/Projects/utils/cxxtest-4.3/"
export CPATH="$CXXTEST:$CPATH" )
- Make bin directory:
mkdir bin
- Generate test .cpp:
$CXXTEST/bin/cxxtestgen --error-printer -o bin/runner.cpp src/example_test.h
- Compile:
g++ -o bin/runner bin/runner.cpp
- Run the compiled test:
./bin/runner
In order to run python tests please use pytest facilities.
For example: py.test src/pyexample/test_labs.py
Please follow instruction on the following resources