ibc / libsdptransform

Session Description Protocol C++ parser/writer based on the sdp-transform JavaScript library
MIT License
134 stars 56 forks source link

Enable ctest command #5

Open ibc opened 6 years ago

ibc commented 6 years ago

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...

garethsb commented 5 years ago

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.

ibc commented 5 years ago

Thanks! will check when I get some time :)

ibc commented 5 years ago

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...