aboutsummaryrefslogtreecommitdiff
path: root/build/test/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:54:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:54:59 +0200
commit0d0d9a9c56822919e9794658d31db57f8fc3e2bf (patch)
tree6dcb1649706dc7fc3f02cd5646b4611b3309fbd1 /build/test/module.cxx
parent5f29fc16fb85a934280e00e54bc6307685c4e05d (diff)
Implement two-phase initialization of modules loaded from bootstrap.build
Diffstat (limited to 'build/test/module.cxx')
-rw-r--r--build/test/module.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/build/test/module.cxx b/build/test/module.cxx
index 19a31d2..9372103 100644
--- a/build/test/module.cxx
+++ b/build/test/module.cxx
@@ -21,9 +21,21 @@ namespace build
{
static rule rule_;
+ extern "C" void
+ test_boot (scope& root, const location&, unique_ptr<module>&)
+ {
+ tracer trace ("test::boot");
+
+ level5 ([&]{trace << "for " << root.out_path ();});
+
+ // Register the test operation.
+ //
+ root.operations.insert (test_id, test);
+ }
+
extern "C" bool
test_init (scope& root,
- scope& base,
+ scope&,
const location& l,
unique_ptr<module>&,
bool first,
@@ -31,9 +43,6 @@ namespace build
{
tracer trace ("test::init");
- if (&root != &base)
- fail (l) << "test module must be initialized in bootstrap.build";
-
if (!first)
{
warn (l) << "multiple test module initializations";
@@ -56,10 +65,6 @@ namespace build
v.find ("test.arguments", strings_type);
}
- // Register the test operation.
- //
- root.operations.insert (test_id, test);
-
// Register rules.
//
{