From fd689eb883655dcb29e505b041cd02fac01f0bac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Aug 2015 15:11:40 +0200 Subject: Dist module/meta-operation initial implementation --- build/test/module.cxx | 12 +++++++----- build/test/rule.cxx | 24 +++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'build/test') diff --git a/build/test/module.cxx b/build/test/module.cxx index 9495275..8c0df38 100644 --- a/build/test/module.cxx +++ b/build/test/module.cxx @@ -51,18 +51,20 @@ namespace build { auto& rs (r.rules); - // Register the standard alias rule for the test operation. + // Register our test running rule. // - rs.insert (test_id, "alias", alias_rule::instance); + rs.insert (perform_id, test_id, "test", rule_); - // Register our test running rule. + // Register our rule for the dist meta-operation. We need + // to do this because we have "ad-hoc prerequisites", test + // input/output files, that need to be entered into the + // target list. // - rs.insert (test_id, "test", rule_); + rs.insert (dist_id, test_id, "test", rule_); } // Enter module variables. // - if (first) { variable_pool.find ("test", bool_type); variable_pool.find ("test.input", name_type); diff --git a/build/test/rule.cxx b/build/test/rule.cxx index eecd613..25baaa7 100644 --- a/build/test/rule.cxx +++ b/build/test/rule.cxx @@ -113,11 +113,6 @@ namespace build if (!mr.bvalue) // Not a test. return noop_recipe; - // In case of test, we don't do anything for other meta-operations. - // - if (a.operation () == test_id && a.meta_operation () != perform_id) - return noop_recipe; - // Ok, if we are here, then this means: // // 1. This target is a test. @@ -218,18 +213,21 @@ namespace build } } - if (ot != nullptr && in == on) + if (ot != nullptr) { - build::match (a, *ot); - - if (ot->state () == target_state::unchanged) + if (in != on) { - unmatch (a, *ot); - ot = nullptr; + build::match (a, *ot); + + if (ot->state () == target_state::unchanged) + { + unmatch (a, *ot); + ot = nullptr; + } } + else + ot = it; } - else - ot = it; // Find the "real" update rule, that is, the rule that would -- cgit v1.1