Skip to content

Commit

Permalink
Mark tests with exit signal != 0 as failed
Browse files Browse the repository at this point in the history
  • Loading branch information
cegonse committed Jan 18, 2025
1 parent 410a831 commit 8b17887
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
14 changes: 4 additions & 10 deletions runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ int main(int argc, char *argv[])
if (args.help())
showHelp();

if (!args.watch())
{
std::vector<Runner::TestRun> results;
const auto executables = Directory::findExecutableFiles(args.path(), "test_");
return Runner::runTests(executables, results);
}
else
{
if (args.watch())
WatchMode::runInPath(args.path());
}

return 0;
std::vector<Runner::TestRun> results;
const auto executables = Directory::findExecutableFiles(args.path(), "test_");
return Runner::runTests(executables, results);
}
2 changes: 1 addition & 1 deletion runner/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int waitForChildren()

return status;
}
#include <iostream>

static int handleParentProcess(int pipe_fd[2], std::function<void(std::string)> on_output)
{
std::string output = "";
Expand Down
11 changes: 3 additions & 8 deletions runner/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ int Runner::runTests(
counts.total_failed_tests += test_result.num_failed_tests;
counts.total_skipped_tests += test_result.num_skipped_tests;

results.push_back(
{
test_result.src_path,
test_result.bin_path,
test_result.num_failed_tests > 0
}
);
const auto failed = test_result.num_failed_tests > 0 || test_status != 0;
results.push_back({ test_result.src_path, test_result.bin_path, failed });

if (test_result.num_failed_tests > 0)
if (failed)
counts.total_failed_suites++;
else
counts.total_passed_suites++;
Expand Down

0 comments on commit 8b17887

Please sign in to comment.