diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-01-07 01:31:25 +0100 |
---|---|---|
committer | John Hodge (Mutabah) <acessdev@gmail.com> | 2018-01-13 16:15:05 +0800 |
commit | 265af300456d5e4425347123942a67fe1e25f345 (patch) | |
tree | 682f0d4673b7e588c1b1c78348812d2adb46b48d | |
parent | 80c093f93c7e81920342118c57f31ee8bd32bc22 (diff) | |
download | mrust-265af300456d5e4425347123942a67fe1e25f345.tar.gz |
TestRunner - Add option --fail-fast for stop on first test failure
-rw-r--r-- | tools/testrunner/main.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tools/testrunner/main.cpp b/tools/testrunner/main.cpp index 6dc0ec45..1751c8ff 100644 --- a/tools/testrunner/main.cpp +++ b/tools/testrunner/main.cpp @@ -28,6 +28,7 @@ struct Options const char* input_glob = nullptr; const char* exceptions_file = nullptr; + bool fail_fast = false; int parse(int argc, const char* argv[]); @@ -306,14 +307,22 @@ int main(int argc, const char* argv[]) } } if( pre_build_failed ) - continue; + { + if( opts.fail_fast ) + return 1; + else + 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 ++; - continue; + if( opts.fail_fast ) + return 1; + else + continue; } } // - Run the test @@ -321,7 +330,10 @@ int main(int argc, const char* argv[]) { DEBUG("RUN FAIL " << test.m_name); n_fail ++; - continue; + if( opts.fail_fast ) + return 1; + else + continue; } n_ok ++; @@ -405,6 +417,10 @@ int Options::parse(int argc, const char* argv[]) } this->output_dir = argv[++i]; } + else if( 0 == ::std::strcmp(arg, "--fail-fast") ) + { + this->fail_fast = true; + } else { this->usage_short(); |