polysquare / cmake-unit

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

A rewrite of cmake-unit. #67

Closed smspillaz closed 9 years ago

smspillaz commented 9 years ago

All tests are now inlined in the CMakeLists.txt file. They are automatically discovered and called dynamically. Tests are discovered based on function names. A test will be added if it starts with the namespace name passed to cmake_unit_init followed by "test".

Inside each test are subfunctions which allow custom code to be executed on each stage of the build process. The names of these functions are then passed as values after the COMMAND to the phase keywords for cmake_unit_configure_test.

Those phases are:

-> CLEAN: Clean the build. -> INVOKE_CONFIGURE: Invoke the initial configuration of the build (but not the actual configuration script itself) -> CONFIGURE: The configure script itself. -> INVOKE_BUILD: Invoke the build of the project. -> INVOKE_TEST: Invoke testing of the project. -> VERIFY: The verify script, to be run after the project is configured, built and tested.

By default, all tests will have no language configured. This speeds up the project configure/build/test cycle substantially on generators where initializing language support is very slow (Visual Studio, XCode). However, it means that adding C or C++ executables inside of configure scripts will not be supported. In order to enable support for this, LANGUAGES should be specified after the INVOKE_CONFIGURE keyword for cmake_unit_configure_test.

Registering and running tests is a two-step process. First tests should be discovered using cmake_unit_discover_tests and then the discovered tests should be passed to the TESTS keyword for cmake_unit_init.

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-22.07%) when pulling 05e28a7eee94c6cfc0320cf6c6a10b4d4fb2b0c5 on smspillaz:cmake-unit.item_61 into 3004a106ec159fdf9db30dd9972ed245bc6c98f6 on polysquare:master.

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-16.14%) when pulling 9682ab860aff935e5ac1c53ecc313c4c251df211 on smspillaz:cmake-unit.item_61 into 3004a106ec159fdf9db30dd9972ed245bc6c98f6 on polysquare:master.

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-16.14%) when pulling a7e9f8173bbf8dfa02bc6d91ac6b99951f64e517 on smspillaz:cmake-unit.item_61 into 3004a106ec159fdf9db30dd9972ed245bc6c98f6 on polysquare:master.

GitCop commented 9 years ago

There were the following issues with your Pull Request


This message was auto-generated by https://gitcop.com

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-16.14%) when pulling 1599ef3713dc2572f0f5d9b16ec840370643b09f on smspillaz:cmake-unit.item_61 into 3004a106ec159fdf9db30dd9972ed245bc6c98f6 on polysquare:master.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-16.14%) when pulling 2dbb678962a32907056c1a4d91601e6e450e25c4 on smspillaz:cmake-unit.item_61 into 3004a106ec159fdf9db30dd9972ed245bc6c98f6 on polysquare:master.