libsdptransform icon indicating copy to clipboard operation
libsdptransform copied to clipboard

Enable ctest command

Open ibc opened this issue 7 years ago • 3 comments

No idea how to add "tests" the CMake way. After reading some docs, I've added this to /CMakeLists.txt file:

enable_testing()
add_test(NAME unittest COMMAND test_sdptransform WORKING_DIRECTORY build)

but it does nothing...

ibc avatar Mar 01 '18 13:03 ibc

We're using Catch for testing in our project at sony/nmos-cpp, and I created the catch_discover_tests function for CMake to provide dynamic discovery of Catch test cases from the test suite executable.

It then probably boils down to just:

enable_testing()
include(Catch)
catch_discover_tests(test_sdptransform EXTRA_ARGS -r compact)

See our CMakeLists.txt and the couple of CMake files that are required in our third_party/cmake directory.

garethsb avatar Sep 03 '18 10:09 garethsb

Thanks! will check when I get some time :)

ibc avatar Sep 14 '18 10:09 ibc

Hi, I've tried to understand how you have integrated Catch into your CMakeLists.txt but it's beyond my knowledge and I'm completely lost... :(

Couldn't be just easier in my scenario? I don't need tests autodiscovery...

ibc avatar Dec 12 '18 18:12 ibc