diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-01-07 01:27:38 +0100 |
---|---|---|
committer | John Hodge (Mutabah) <acessdev@gmail.com> | 2018-01-13 16:15:05 +0800 |
commit | 80c093f93c7e81920342118c57f31ee8bd32bc22 (patch) | |
tree | 8941b6bd76bbc44547594b95f659a97ca58e69cd | |
parent | 48aefca1ff4a98f4bd7cce4f277008d6e6a21438 (diff) | |
download | mrust-80c093f93c7e81920342118c57f31ee8bd32bc22.tar.gz |
TestRunner - Keep going and exit 1 if some tests failed
-rw-r--r-- | tools/testrunner/main.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/testrunner/main.cpp b/tools/testrunner/main.cpp index 57461fe2..6dc0ec45 100644 --- a/tools/testrunner/main.cpp +++ b/tools/testrunner/main.cpp @@ -292,6 +292,7 @@ int main(int argc, const char* argv[]) auto test_output_ts = Timestamp::for_file(outfile); if( test_output_ts < Timestamp::for_file(MRUSTC_PATH) ) { + bool pre_build_failed = false; for(const auto& file : test.m_pre_build) { mkdir(depdir.str().c_str(), 0755); @@ -300,15 +301,19 @@ int main(int argc, const char* argv[]) { DEBUG("COMPILE FAIL " << infile << " (dep of " << test.m_name << ")"); n_cfail ++; - return 1; + pre_build_failed = true; + break; } } + if( pre_build_failed ) + continue; + auto compile_logfile = outdir / test.m_name + "-build.log"; if( !run_compiler(test.m_path, outfile, test.m_extra_flags, depdir) ) { DEBUG("COMPILE FAIL " << test.m_name); n_cfail ++; - return 1; + continue; } } // - Run the test @@ -316,7 +321,7 @@ int main(int argc, const char* argv[]) { DEBUG("RUN FAIL " << test.m_name); n_fail ++; - return 1; + continue; } n_ok ++; @@ -324,6 +329,9 @@ int main(int argc, const char* argv[]) ::std::cout << "TESTS COMPLETED" << ::std::endl; ::std::cout << n_ok << " passed, " << n_fail << " failed, " << n_cfail << " errored, " << n_skip << " skipped" << ::std::endl; + + if( n_fail > 0 || n_cfail > 0 ) + return 1; } return 0; |