aboutsummaryrefslogtreecommitdiff
path: root/build2/test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-03-10 20:20:12 +0300
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-13 13:18:21 +0200
commit482d362979baf8b0fef7f46b0cd61a29faeb11a8 (patch)
tree0264746045798679cfee2e748d00bdd7ca050cb0 /build2/test
parent6dbf4954a67efa284ae9abceb3b02c8642b79a49 (diff)
Adapt for path_search() change
Diffstat (limited to 'build2/test')
-rw-r--r--build2/test/script/runner.cxx32
1 files changed, 19 insertions, 13 deletions
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<dir_path> (d / de));
+ if (!interm)
+ {
+ dir_path sd (path_cast<dir_path> (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;
};