Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ctest command #5

Open
ibc opened this issue Mar 1, 2018 · 3 comments
Open

Enable ctest command #5

ibc opened this issue Mar 1, 2018 · 3 comments

Comments

@ibc
Copy link
Owner

ibc commented Mar 1, 2018

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
Copy link

garethsb commented Sep 3, 2018

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
Copy link
Owner Author

ibc commented Sep 14, 2018

Thanks! will check when I get some time :)

@ibc
Copy link
Owner Author

ibc commented Dec 12, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants