aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-29 09:19:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-29 09:19:06 +0200
commitc4fcbad1cb603756dc4dac65392feb86be1a722d (patch)
treeda9c9c2278c63d20237a7178fde450d7472a59c9 /libbuild2/test
parentccb417a7c1456427b76914e8a11ca87b4926eeb3 (diff)
Rename module_base to module, redo module boot/init argument passing
Diffstat (limited to 'libbuild2/test')
-rw-r--r--libbuild2/test/init.cxx12
-rw-r--r--libbuild2/test/init.hxx12
-rw-r--r--libbuild2/test/module.hxx5
3 files changed, 9 insertions, 20 deletions
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<module_base>& mod)
+ boot (scope& rs, const location&, module_boot_extra& extra)
{
tracer trace ("test::boot");
@@ -116,7 +116,8 @@ namespace build2
v = cast<target_triplet> (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<module_base>& 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<module&> (*mod));
+ auto& m (extra.module_as<module> ());
// 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<module_base>&);
-
- bool
- init (scope&,
- scope&,
- const location&,
- unique_ptr<module_base>&,
- 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