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 REPORTER and OUTPUT_DIR args to catch_discover_tests #2023

Merged
merged 1 commit into from
Sep 23, 2020
Merged

Add REPORTER and OUTPUT_DIR args to catch_discover_tests #2023

merged 1 commit into from
Sep 23, 2020

Conversation

globberwops
Copy link
Contributor

@globberwops globberwops commented Sep 12, 2020

Description

When using catch_discover_tests with EXTRA_ARGS -o foo, the test reports will be overwritten with each test case.

The args REPORTER, OUTPUT_DIR, OUTPUT_PREFIX, and OUTPUT_SUFFIX will allow for further customization of the test case runs.

  • REPORTER can be any valid reporter of the Catch executable.
    The specified reporter will be validated against the available reporters of the Catch executable.
  • OUTPUT_DIR can be a relative or an absolute path.
    If relative, it will be relative to the WORKING_DIRECTORY, which in turn defaults to CMAKE_CURRENT_BINARY_DIR.
  • OUTPUT_PREFIX is a string that will be added before each test report name.
  • OUTPUT_SUFFIX is a string that will be added after each test report name, e.g. a file extension.

GitHub Issues

Resolves #1946

@codecov
Copy link

codecov bot commented Sep 12, 2020

Codecov Report

Merging #2023 into master will decrease coverage by 1.83%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2023      +/-   ##
==========================================
- Coverage   88.75%   86.91%   -1.83%     
==========================================
  Files         138      131       -7     
  Lines        5651     3965    -1686     
==========================================
- Hits         5015     3446    -1569     
+ Misses        636      519     -117     

@horenmar
Copy link
Member

A quick note: don't try and enumerate valid reporters up-front, because users might have their own reporters they want to use. It also currently only lists the built-in reporters, but not the ones that Catch2 also provides as part of release (e.g. TAP and TeamCity reporters).

Since you are modifying catch_discover_tests, which already expects to be able to run the test executable, you can instead use --list-reporters and handle its output while validating the argument.

@horenmar horenmar added the Extras Touches utility scripts outside of Catch2 proper, e.g. CMake integration. label Sep 13, 2020
@globberwops
Copy link
Contributor Author

@horenmar you are totally right, I have added using --list-reporters now. Thanks for the feedback!

@globberwops globberwops marked this pull request as ready for review September 15, 2020 17:25
@horenmar
Copy link
Member

Otherwise LGTM. Can you rebase + squash this into atomic commits?

@horenmar horenmar merged commit 314a05d into catchorg:master Sep 23, 2020
@horenmar
Copy link
Member

Thanks

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.

Generate JUnit report using catch_discover_tests
2 participants