aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/script.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/test/script/script.cxx')
-rw-r--r--build2/test/script/script.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx
index bf53595..f1dab63 100644
--- a/build2/test/script/script.cxx
+++ b/build2/test/script/script.cxx
@@ -5,6 +5,7 @@
#include <build2/test/script/script>
#include <sstream>
+#include <algorithm> // find()
#include <build2/target>
@@ -287,6 +288,26 @@ namespace build2
const_cast<dir_path&> (wd_path) = dir_path (p->wd_path) /= id;
}
+ // command
+ //
+ void scope::
+ clean (const path& p)
+ {
+ using std::find; // Hidden by scope::find().
+
+ if (find (cleanups.begin (), cleanups.end (), p) == cleanups.end ())
+ cleanups.emplace_back (p);
+ }
+
+ void scope::
+ clean (path&& p)
+ {
+ using std::find; // Hidden by scope::find().
+
+ if (find (cleanups.begin (), cleanups.end (), p) == cleanups.end ())
+ cleanups.emplace_back (move (p));
+ }
+
// script_base
//
script_base::