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

-w NoTests should give non-zero status #1683

Closed
sd-x opened this issue Jul 9, 2019 · 3 comments · Fixed by #1684
Closed

-w NoTests should give non-zero status #1683

sd-x opened this issue Jul 9, 2019 · 3 comments · Fixed by #1684

Comments

@sd-x
Copy link

sd-x commented Jul 9, 2019

docs/command-line.md says "NoTests // Return non-zero exit code when no test cases were run" but I see a status of zero being returned instead of non-zero

my_bug.cpp:

#include "catch2/catch.hpp"

TEST_CASE("my case", "[foo]") {
  SECTION("my section") {
    CHECK(1);
  }
}
> g++ -o my_bug my_bug.cpp -I ...
> ./my_bug -w NoTests '[x]'
Filters: [x]
No test cases matched '[x]'
===============================================================================
No tests ran

status=0

I expected a non-zero status.

Platform information:

  • OS: Linux CentOS 6
  • Compiler+version: GCC v7.3.0
  • Catch version: v2.9.1
@sfranzen
Copy link
Contributor

This was also reported in issue #1449 I happened to be working on, so there is a pull request underway to fix it and make it part of the self-testing suite.

@sd-x
Copy link
Author

sd-x commented Jul 11, 2019

Ah, thanks; I missed that issue when I searched, sorry. I'll close this issue.

@sd-x sd-x closed this as completed Jul 11, 2019
@sfranzen
Copy link
Contributor

No problem! The other issue is different but related, another user reported the missing exit code in a reply.

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

Successfully merging a pull request may close this issue.

2 participants