From c4fcbad1cb603756dc4dac65392feb86be1a722d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Jan 2020 09:19:06 +0200 Subject: Rename module_base to module, redo module boot/init argument passing --- libbuild2/test/init.cxx | 12 +++++------- libbuild2/test/init.hxx | 12 ------------ libbuild2/test/module.hxx | 5 ++++- 3 files changed, 9 insertions(+), 20 deletions(-) (limited to 'libbuild2/test') diff --git a/libbuild2/test/init.cxx b/libbuild2/test/init.cxx index 6a13990..ec95927 100644 --- a/libbuild2/test/init.cxx +++ b/libbuild2/test/init.cxx @@ -25,7 +25,7 @@ namespace build2 namespace test { bool - boot (scope& rs, const location&, unique_ptr& mod) + boot (scope& rs, const location&, module_boot_extra& extra) { tracer trace ("test::boot"); @@ -116,7 +116,8 @@ namespace build2 v = cast (rs.ctx.global_scope["build.host"]); } - mod.reset (new module (move (d))); + extra.set_module (new module (move (d))); + return false; } @@ -124,10 +125,9 @@ namespace build2 init (scope& rs, scope&, const location& l, - unique_ptr& mod, bool first, bool, - const variable_map& config_hints) + module_init_extra& extra) { tracer trace ("test::init"); @@ -139,12 +139,10 @@ namespace build2 l5 ([&]{trace << "for " << rs;}); - assert (mod != nullptr); - module& m (static_cast (*mod)); + auto& m (extra.module_as ()); // Configure. // - assert (config_hints.empty ()); // We don't known any hints. // Adjust module priority so that the config.test.* values are saved at // the end of config.build. diff --git a/libbuild2/test/init.hxx b/libbuild2/test/init.hxx index 49cdb14..7683858 100644 --- a/libbuild2/test/init.hxx +++ b/libbuild2/test/init.hxx @@ -16,18 +16,6 @@ namespace build2 { namespace test { - bool - boot (scope&, const location&, unique_ptr&); - - bool - init (scope&, - scope&, - const location&, - unique_ptr&, - bool, - bool, - const variable_map&); - // Module `test` requires bootstrapping. // // `test` -- registers the test and update-for-test operations, registers/ diff --git a/libbuild2/test/module.hxx b/libbuild2/test/module.hxx index 584cb84..af06434 100644 --- a/libbuild2/test/module.hxx +++ b/libbuild2/test/module.hxx @@ -17,7 +17,10 @@ namespace build2 { namespace test { - struct module: module_base, virtual common, default_rule, group_rule + struct module: build2::module, + virtual common, + default_rule, + group_rule { const test::group_rule& group_rule () const -- cgit v1.1