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

CatchAddTests now adds tags as labels for ctest #1600

Merged
merged 1 commit into from Apr 14, 2019
Merged

CatchAddTests now adds tags as labels for ctest #1600

merged 1 commit into from Apr 14, 2019

Conversation

MaciejPatro
Copy link
Contributor

  • ctest --print-labels now will show list of available labels
  • ctest -L <regex> will allow to run tests with given labels(tags)

Description

Having an executable with given list of tests:

> exercises/ut/exercisesTests --list-tests
All available test cases:
  Life, the universe and everything
  Having fun with lambdas
      [cpp11][lambdas]
  Delegating constructors
      [constructor][cpp11][delegation]
  User-defined literals functionality
  Class modifications introduces in C++11
      [cpp11][default][delete][final][override]
5 test cases

catch_discover_tests now discovers correctly:

ctest -N
Test project /home/mpatro/projects/clion/self_learn_repo/cmake-build-debug
  Test #1: Life, the universe and everything
  Test #2: Having fun with lambdas
  Test #3: Delegating constructors
  Test #4: User-defined literals functionality
  Test #5: Class modifications introduces in C++11

Total Tests: 5

also adding tags as labels and enabling running labels

> ctest -L lambdas --verbose
...
test 2
    Start 2: Having fun with lambdas

2: Test command: /home/mpatro/projects/clion/self_learn_repo/cmake-build-debug/exercises/ut/exercisesTests "Having fun with lambdas"
2: Test timeout computed to be: 10000000
2: ===============================================================================
2: All tests passed (11 assertions in 1 test case)
2: 
1/1 Test #2: Having fun with lambdas ..........   Passed    0.01 sec

100% tests passed, 0 tests failed out of 1

Label Time Summary:
[cpp11]      =   0.01 sec*proc (1 test)
[lambdas]    =   0.01 sec*proc (1 test)

Total Test time (real) =   0.03 sec

GitHub Issues

#1590

- `ctest --print-labels` now will show list of available labels
- `ctest -L <regex>` will allow to run tests with given labels(tags)
@codecov
Copy link

codecov bot commented Apr 13, 2019

Codecov Report

Merging #1600 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1600   +/-   ##
=======================================
  Coverage   80.72%   80.72%           
=======================================
  Files         121      121           
  Lines        3424     3424           
=======================================
  Hits         2764     2764           
  Misses        660      660

1 similar comment
@codecov
Copy link

codecov bot commented Apr 13, 2019

Codecov Report

Merging #1600 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1600   +/-   ##
=======================================
  Coverage   80.72%   80.72%           
=======================================
  Files         121      121           
  Lines        3424     3424           
=======================================
  Hits         2764     2764           
  Misses        660      660

@horenmar horenmar added the Extras Touches utility scripts outside of Catch2 proper, e.g. CMake integration. label Apr 14, 2019
@horenmar
Copy link
Member

Looks good, thanks.

@horenmar horenmar merged commit d4eec01 into catchorg:master Apr 14, 2019
Heroico referenced this pull request in stevefortier/Catch2 Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extras Touches utility scripts outside of Catch2 proper, e.g. CMake integration.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants