From 482d362979baf8b0fef7f46b0cd61a29faeb11a8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 10 Mar 2017 20:20:12 +0300 Subject: Adapt for path_search() change --- build2/test/script/runner.cxx | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'build2/test') diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index e8040e2..68a8d32 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -718,30 +718,36 @@ namespace build2 if (l.to_directory ()) { - auto rm = [&p, &d, &ll] (path&& de) -> bool + auto rm = + [&p, &d, &ll] (path&& de, const string&, bool interm) -> bool { - dir_path sd (path_cast (d / de)); + if (!interm) + { + dir_path sd (path_cast (d / de)); - // We can get not_exist here due to racing conditions, but - // that's ok if somebody did our job. - // - rmdir_status r (rmdir (sd, 2)); + // We can get not_exist here due to racing conditions, but + // that's ok if somebody did our job. + // + rmdir_status r (rmdir (sd, 2)); - if (r != rmdir_status::not_empty) - return true; + if (r == rmdir_status::not_empty) + fail (ll) << "registered for cleanup directory " << sd + << " is not empty" << + info << "wildcard: '" << p << "'"; + } - fail (ll) << "registered for cleanup directory " << sd - << " is not empty" << - info << "wildcard: '" << p << "'" << endf; + return true; }; path_search (l, rm, d); } else { - auto rm = [&d] (path&& p) -> bool + auto rm = [&d] (path&& p, const string&, bool interm) -> bool { - rmfile (d / p, 2); // That's ok if not exists. + if (!interm) + rmfile (d / p, 2); // That's ok if not exists. + return true; }; -- cgit v1.1