Though CMake provides CTest framework for adding unit tests to a projects build system, it lacks fine control. Such as when to build tests, either on first run or on file changes. This missing control can lead to unfortunately circumstances where unit tests are not being re-compiled after being modified, or tests fail because they have not been built (WTF?!).
This work achieves the following:
- we now track all *.sac based source files, meaning changes lead to re-compilation of tests
- we add a
check
target, through which we bind dependencies between tests and the building of the compiler - we appropriately compile units tests (handled by GTest) when calling
the
check
make target - add documentation to explain most all of this within the relevent CMake files