Commit Graph

6 Commits

Author SHA1 Message Date
Steven Franzen 2aed6233cf
Fix CTest command issue with square brackets 2019-07-21 16:29:46 +02:00
Justin Bassett 80af9ca687 Rollback ctest labels in CatchAddTests.cmake
Parsing --list-tests is broken, as Catch automatically line wraps the
line when it gets too long, stripping any whitespace in the process.
This means that it's impossible to reproduce the exact name of the
test if the test's name is long enough to line-wrap.

Furthermore, overwriting the LABELS property with the discovered labels
breaks users who manually added custom ctest labels.

Rolling back to using --list-test-names-only for now, as it does not
wrap lines even on very long test names.

We may be able parse the output of --list-tags to produce the ctest labels.
However, the straightforward way of doing this is to use CMake's
get_property(TEST ...) and set_property(TEST ... APPEND ...), which don't
work if the test name has spaces or other special characters. We would
need to mangle the test name to a valid CMake identifier to do it that way.
2019-06-17 19:17:32 +02:00
Maciej Patro d4eec016a9 CatchAddTests now adds tags as labels for ctest
- `ctest --print-labels` now will show list of available labels
- `ctest -L <regex>` will allow to run tests with given labels(tags)
2019-04-14 18:59:53 +02:00
Maciej Patro 0144ae9ad2 Fix catch_discover_tests() - now should correctly find tests with commas | Related to #1327 2018-10-16 16:06:31 +02:00
Markus Reitboeck 6496c51c95 do not strip spaces from cmake discovered test names
this fixes #1265
2018-05-09 18:00:05 +02:00
garethsb-sony 3d7104c124 Catch ``catch_discover_tests``
Copied from [Dynamic Catch test discovery in CMake](https://gist.github.com/garethsb/a01ed0dbd4977d439c16200640549935), which was inspired by [Dynamic Google Test Discovery in CMake 3.10](https://blog.kitware.com/dynamic-google-test-discovery-in-cmake-3-10/).

Original source code:

- Adapted by [Gareth Sylvester-Bradley](https://github.com/garethsb) from [GoogleTest ``gtest_discover_tests``](https://gitlab.kitware.com/cmake/cmake/merge_requests/1056).
- BSD 3-clause "New" or "Revised" License.
- Copyright 2000-2017 Kitware, Inc. and Contributors. All rights reserved.
2018-01-11 21:17:12 +01:00