Unit Tests - Xorgon/DEMOranges GitHub Wiki
The unit tests in this project use a custom system due to the lack of a simple, easy-to-use C unit testing framework.
Each test is a function that returns a boolean. The test should take a boolean parameter verbose
that determines whether full debug output is shown. Where an OpenCL kernel must be run the function should also take the device and context to be used. Test function names usually begin with 'test_' followed by what they are testing (e.g. test_set_array_starts
tests the set_array_starts
function). Tests are usually separated into sections and stored in appropriate directories within the tests/
directory.
Tests are run either independently or from the run_all_tests
function in tests/run_tests/run_tests.c
. This function is called from tests/standalone_tests.c
and can be run with the run_tests
CMake target.