diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-10-31 21:21:17 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:37 +0200 |
commit | 35c9e7698e768883065d944b2c43e5af9cb37ee4 (patch) | |
tree | c9a5299b90af3264c95f189c8595a0573d2d0b9f /build2/test/script/runner.cxx | |
parent | 4876a5f56c72f64a54627f9b6d0656878b7ca547 (diff) |
Update test runner to accommodate cleanup types
Diffstat (limited to 'build2/test/script/runner.cxx')
-rw-r--r-- | build2/test/script/runner.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index f42299e..ee7b5df 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -86,7 +86,7 @@ namespace build2 try { ofdstream os (orp); - sp.clean (orp); + sp.clean ({cleanup_type::always, orp}, true); os << (rd.type == redirect_type::here_string ? rd.str @@ -190,7 +190,7 @@ namespace build2 // assert (empty (sp.wd_path)); - sp.clean (sp.wd_path); + sp.clean ({cleanup_type::always, sp.wd_path}, true); } void concurrent_runner:: @@ -213,8 +213,10 @@ namespace build2 << " is out of working directory " << sp.wd_path; }; - for (const auto& p: reverse_iterate (sp.cleanups)) + for (const auto& c: reverse_iterate (sp.cleanups)) { + const path& p (c.path); + // Remove directory if exists and empty. Fail otherwise. // if (p.to_directory ()) @@ -401,7 +403,7 @@ namespace build2 } open_stdin (); - sp.clean (stdin); + sp.clean ({cleanup_type::always, stdin}, true); break; } @@ -473,7 +475,7 @@ namespace build2 fail (cl) << "unable to write " << p << ": " << e.what (); } - sp.clean (p); + sp.clean ({cleanup_type::always, p}, true); return os.fd (); }; @@ -506,7 +508,7 @@ namespace build2 // Register command-created paths for cleanup. // for (const auto& p: c.cleanups) - sp.clean (normalize (p)); + sp.clean ({p.type, normalize (p.path)}, false); // If there is no correct exit status by whatever reason then dump // stderr (if cached), print the proper diagnostics and fail. |