summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/testrunner/main.cpp22
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();