aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-09 14:39:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-09 14:56:01 +0200
commitfeed07e16ff73c5f0b25f2ceb4c08177b5c0e3af (patch)
tree285cd2b651d505a933da5a35b5e8f105592108c6 /libbuild2/test
parente9f64680a152c5aafd023bb5691447012e222590 (diff)
Make sure update-for-{test,install} works for files out of any project
Diffstat (limited to 'libbuild2/test')
-rw-r--r--libbuild2/test/init.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/libbuild2/test/init.cxx b/libbuild2/test/init.cxx
index 7a07e76..02d0a42 100644
--- a/libbuild2/test/init.cxx
+++ b/libbuild2/test/init.cxx
@@ -208,8 +208,18 @@ namespace build2
{
default_rule& dr (m);
- rs.insert_rule<target> (perform_test_id, "test", dr);
- rs.insert_rule<alias> (perform_test_id, "test", dr);
+ // Note: register for mtime_target to take priority over the fallback
+ // rule below.
+ //
+ rs.insert_rule<target> (perform_test_id, "test", dr);
+ rs.insert_rule<mtime_target> (perform_test_id, "test", dr);
+ rs.insert_rule<alias> (perform_test_id, "test", dr);
+
+ // Register the fallback file rule for the update-for-test operation,
+ // similar to update.
+ //
+ rs.global_scope ().insert_rule<mtime_target> (
+ perform_test_id, "file", file_rule::instance);
}
return true;