diff --git a/runner/main.cpp b/runner/main.cpp index 0e11459..c1cd48e 100644 --- a/runner/main.cpp +++ b/runner/main.cpp @@ -21,16 +21,10 @@ int main(int argc, char *argv[]) if (args.help()) showHelp(); - if (!args.watch()) - { - std::vector 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 results; + const auto executables = Directory::findExecutableFiles(args.path(), "test_"); + return Runner::runTests(executables, results); } diff --git a/runner/process.cpp b/runner/process.cpp index 323e211..c7b133e 100644 --- a/runner/process.cpp +++ b/runner/process.cpp @@ -39,7 +39,7 @@ static int waitForChildren() return status; } -#include + static int handleParentProcess(int pipe_fd[2], std::function on_output) { std::string output = ""; diff --git a/runner/runner.cpp b/runner/runner.cpp index a935b96..d6f1bce 100644 --- a/runner/runner.cpp +++ b/runner/runner.cpp @@ -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++;