ctests
ctests is a command which can be used to run automated tests on C++ code built using CMake. To enable it, tests need to be added to the CMakeLists.txt file.
add_test(NAME run_test_short
COMMAND SingleElement --test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})Usage in my project
Automated ctests using GitHub workflows can be created for kMC-FEA. To create this, there are two options:
- Using a command runtime option such as
--testwhich would make the program run a special simplified test case - Modifying the program to use input files so that a seperate input file for test can be provided.
- This is a better option as the
solution.pvdfile depends on the input to the code so thegenerate_pvd.pycan be automatically called at the end of the simulaiton to generate asolution.pvdusing the same input file.
- This is a better option as the