diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-28 09:44:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-28 09:44:15 +0200 |
commit | 3cc5e3bd441fc9d18fece3d9e99fae75c78438e7 (patch) | |
tree | a9a08c453370847e0d352d47e19fbfcb7cc757ef /build2/test | |
parent | c0f72d47fc25981dcc1f55e12dfa0fdba7b70242 (diff) |
Implement support for excluded and ad hoc prerequisites
The inclusion/exclusion is controlled via the 'include' prerequisite-specific
variable. Valid values are:
false - exclude
true - include
adhoc - include but treat as an ad hoc input
For example:
lib{foo}: cxx{win32-utility}: include = ($cxx.targe.class == 'windows')
exe{bar}: libs{plugin}: include = adhoc
Diffstat (limited to 'build2/test')
-rw-r--r-- | build2/test/rule.cxx | 6 | ||||
-rw-r--r-- | build2/test/rule.hxx | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index f877a4d..282540c 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -126,6 +126,9 @@ namespace build2 for (prerequisite_member p: group_prerequisite_members (a, t, members_mode::maybe)) { + if (include (a, t, p) != include_type::normal) // Excluded/ad hoc. + continue; + if (p.is_a<testscript> ()) { if (!script) @@ -205,6 +208,9 @@ namespace build2 if (vars.empty ()) // Common case. continue; + if (include (a, t, p) != include_type::normal) // Excluded/ad hoc. + continue; + bool rt ( cast_false<bool> (vars[test_roundtrip])); bool si (rt || cast_false<bool> (vars[test_stdin])); bool so (rt || cast_false<bool> (vars[test_stdout])); diff --git a/build2/test/rule.hxx b/build2/test/rule.hxx index e4fd28d..af42d89 100644 --- a/build2/test/rule.hxx +++ b/build2/test/rule.hxx @@ -9,7 +9,7 @@ #include <build2/utility.hxx> #include <build2/rule.hxx> -#include <build2/operation.hxx> +#include <build2/action.hxx> #include <build2/test/common.hxx> |