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

Add CMake module for automatically discovering test cases from a CMake target #76

Open
ghost opened this issue Jun 22, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 22, 2021

Description

I have written a CMake module along with a helper cmake file with function munit_discover_tests that could be used to automatically discovering test case from any CMake test target that uses Munit for unit testing, just like gtest_dicover_tests in GoogleTest CMake module in this gist.

It uses a post-build command to run <Munit test executable> --list to get list of all tests in the executable and then writes add_test command on each of them in an include file that is included by CTest whenever CTest runs.

munit_discover_tests has CMake parameters for all command-line flags in Munit except --help & --color auto|always|never, as well as an EXTRA_ARGS parameter for accomodating future changes in Munit CLI.

License

CC0

@ghost ghost mentioned this issue Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants