Skip to content

-w NoTests should give non-zero status #1683

@sd-x

Description

@sd-x

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions