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

Make hidden tags behave identically #1847

Merged
merged 6 commits into from
Jan 31, 2020
Merged

Make hidden tags behave identically #1847

merged 6 commits into from
Jan 31, 2020

Conversation

dmsteck
Copy link

@dmsteck dmsteck commented Jan 27, 2020

Description

There are multiple tags to hide tests: [.], [.something] and [!hide]. The Catch2 documentation (see here) states that, for compatibility and consistency purposes, if one of these is used for a test case, then all of them are added implicitly.

However, this isn't actually how Catch2 behaves. As it turns out, if Catch2 encounters a hidden test, it will always make sure there is a [.] tag, but it will not add a [!hide] tag. This means that TEST_CASE("Something", "[!hide]") will result in a [.][!hide] signature, whereas TEST_CASE("Something2", "[.]") will produce a [.] signature.

A simple way to observe this behaviour is to compile SelfTest and observe that SelfTest [.] and SelfTest [!hide] produce different results.

Changes

This PR enables [.][!hide] for all hidden tests by modifying the corresponding code in internal/catch_test_case_info.cpp. I have also updated the approval test results.

Pull latest Catch2 master
@horenmar
Copy link
Member

Thanks, I forgot [!hide] is a thing. However, the PR is missing a "real" unit test for the behaviour.

@codecov
Copy link

codecov bot commented Jan 28, 2020

Codecov Report

Merging #1847 into master will increase coverage by 0.07%.
The diff coverage is 90%.

@@            Coverage Diff             @@
##           master    #1847      +/-   ##
==========================================
+ Coverage   86.19%   86.27%   +0.07%     
==========================================
  Files         131      131              
  Lines        3875     3888      +13     
==========================================
+ Hits         3340     3354      +14     
+ Misses        535      534       -1

@horenmar horenmar merged commit 481f54b into catchorg:master Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants