diff options
Diffstat (limited to 'build2/test/script/script.cxx')
-rw-r--r-- | build2/test/script/script.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx index cfc1d91..7d1d8cf 100644 --- a/build2/test/script/script.cxx +++ b/build2/test/script/script.cxx @@ -347,7 +347,16 @@ namespace build2 assert (!implicit || c.type == cleanup_type::always); - auto pr = [&c] (const cleanup& v) -> bool {return v.path == c.path;}; + const path& p (c.path); + if (!p.sub (root->wd_path)) + { + if (implicit) + return; + else + assert (false); // Error so should have been checked. + } + + auto pr = [&p] (const cleanup& v) -> bool {return v.path == p;}; auto i (find_if (cleanups.begin (), cleanups.end (), pr)); if (i == cleanups.end ()) |