aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/runner.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/test/script/runner.cxx')
-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;
};