polysquare / cmake-unit

A unit testing framework for CMake
MIT License
36 stars 5 forks source link

Use matcher-like syntax and assert_that #80

Closed smspillaz closed 9 years ago

smspillaz commented 9 years ago

Since we can now polymorphically call functions using _cmake_unit_call_function, it is perfectly possible to implement "matchers" and an xUnit style cmake_unit_assert_that.

Matchers all have cmake_unit prefix for now, and they are invoked by using cmake_unit_assert_that (VARIABLE_NAME matcher ARGN).

By convention, the matcher functions are "callable" functions in that they source their arguments from CALLER_ARGN and set the name referred to by the final argument as either TRUE if the match succeeded or an error message in any other case.