diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-08 00:39:30 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-15 19:52:39 +0300 |
commit | 52a29dd64479e9313848941078a2619b47f2c61b (patch) | |
tree | d2d83faab7298983793aaf8dd1009d371f324488 /build2/test/rule.cxx | |
parent | 84dd05fe654eadd755d25932fcd76d1254dc8865 (diff) |
Add support for config.test.output variable
Diffstat (limited to 'build2/test/rule.cxx')
-rw-r--r-- | build2/test/rule.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 33ffb90..6ef2587 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -422,9 +422,16 @@ namespace build2 if (exists (wd)) { - warn << "working directory " << wd << " exists " - << (empty (wd) ? "" : "and is not empty ") << "at the beginning " - << "of the test"; + if (before != output_before::clean) + { + bool fail (before == output_before::fail); + + (fail ? error : warn) << "working directory " << wd << " exists " + << (empty (wd) ? "" : "and is not empty ") + << "at the beginning of the test"; + if (fail) + throw failed (); + } // Remove the directory itself not to confuse the runner which tries // to detect when tests stomp on each others feet. @@ -533,7 +540,7 @@ namespace build2 // Cleanup. // - if (!one && !mk) + if (!one && !mk && after == output_after::clean) { if (!empty (wd)) fail << "working directory " << wd << " is not empty at the " |