From 64eecc0f7ba15b1733bbc713a2f197dda590e12d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Oct 2016 10:41:48 +0200 Subject: Add test{} testscript target type --- build2/test/init.cxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'build2/test/init.cxx') diff --git a/build2/test/init.cxx b/build2/test/init.cxx index 5b01bce..296ae69 100644 --- a/build2/test/init.cxx +++ b/build2/test/init.cxx @@ -9,8 +9,9 @@ #include #include -#include #include +#include +#include using namespace std; using namespace butl; @@ -22,15 +23,15 @@ namespace build2 static rule rule_; void - boot (scope& root, const location&, unique_ptr&) + boot (scope& rs, const location&, unique_ptr&) { tracer trace ("test::boot"); - l5 ([&]{trace << "for " << root.out_path ();}); + l5 ([&]{trace << "for " << rs.out_path ();}); // Register the test operation. // - root.operations.insert (test_id, test); + rs.operations.insert (test_id, test); // Enter module variables. Do it during boot in case they get assigned // in bootstrap.build. @@ -50,7 +51,7 @@ namespace build2 } bool - init (scope& root, + init (scope& rs, scope&, const location& l, unique_ptr&, @@ -66,7 +67,7 @@ namespace build2 return true; } - const dir_path& out_root (root.out_path ()); + const dir_path& out_root (rs.out_path ()); l5 ([&]{trace << "for " << out_root;}); assert (config_hints.empty ()); // We don't known any hints. @@ -80,10 +81,18 @@ namespace build2 // if (s) // config::save_module (r, "test", INT32_MAX); + // Register target types. + // + { + auto& t (rs.target_types); + + t.insert (); + } + // Register rules. // { - auto& r (root.rules); + auto& r (rs.rules); // Register our test running rule. // -- cgit v1.1