Skip to content

Commit

Permalink
Merge pull request #3448 from dmkozh/test_fix
Browse files Browse the repository at this point in the history
Don't return error for `test --list-tests` and similar commands.

Reviewed-by: MonsieurNicolas
  • Loading branch information
latobarita authored Jun 22, 2022
2 parents 91336c9 + bb41975 commit d18d54a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,14 @@ runTest(CommandLineArgs const& args)
LOG_INFO(DEFAULT_LOG, "Logging to {}", logFile);

auto r = session.run();
// In the 'list' modes Catch returns the number of tests listed. We don't
// want to treat this value as and error code.
if (session.configData().listTests ||
session.configData().listTestNamesOnly ||
session.configData().listTags || session.configData().listReporters)
{
r = 0;
}
gTestRoots.clear();
clearConfigs();

Expand Down

0 comments on commit d18d54a

Please sign in to comment.