aboutsummaryrefslogtreecommitdiff
path: root/build2/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-07 15:48:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-07 16:52:55 +0200
commit968d8a7acd6c23078a3ea6936c03be0b45523227 (patch)
treed7da843d0961b649ff93f6f299b9ce65b1255003 /build2/test
parent378b2598a305d4e332e52460ca89dd867546a58b (diff)
Add support for update-for-{test,install} operation aliases
Diffstat (limited to 'build2/test')
-rw-r--r--build2/test/init.cxx3
-rw-r--r--build2/test/operation.cxx17
-rw-r--r--build2/test/operation.hxx1
-rw-r--r--build2/test/rule.cxx2
4 files changed, 21 insertions, 2 deletions
diff --git a/build2/test/init.cxx b/build2/test/init.cxx
index 556de00..6d28e9e 100644
--- a/build2/test/init.cxx
+++ b/build2/test/init.cxx
@@ -29,9 +29,10 @@ namespace build2
l5 ([&]{trace << "for " << rs.out_path ();});
- // Register the test operation.
+ // Register our operations.
//
rs.operations.insert (test_id, op_test);
+ rs.operations.insert (update_for_test_id, op_update_for_test);
// Enter module variables. Do it during boot in case they get assigned
// in bootstrap.build.
diff --git a/build2/test/operation.cxx b/build2/test/operation.cxx
index e4591e4..7c968ff 100644
--- a/build2/test/operation.cxx
+++ b/build2/test/operation.cxx
@@ -24,6 +24,7 @@ namespace build2
const operation_info op_test {
test_id,
+ 0,
"test",
"test",
"testing",
@@ -34,5 +35,21 @@ namespace build2
&test_pre,
nullptr
};
+
+ // Also the explicit update-for-test operation alias.
+ //
+ const operation_info op_update_for_test {
+ update_id, // Note: not update_for_test_id.
+ test_id,
+ op_update.name,
+ op_update.name_do,
+ op_update.name_doing,
+ op_update.name_did,
+ op_update.name_done,
+ op_update.mode,
+ op_update.concurrency,
+ op_update.pre,
+ op_update.post
+ };
}
}
diff --git a/build2/test/operation.hxx b/build2/test/operation.hxx
index 774e8d0..09739d6 100644
--- a/build2/test/operation.hxx
+++ b/build2/test/operation.hxx
@@ -15,6 +15,7 @@ namespace build2
namespace test
{
extern const operation_info op_test;
+ extern const operation_info op_update_for_test;
}
}
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index 86062f9..a42ceca 100644
--- a/build2/test/rule.cxx
+++ b/build2/test/rule.cxx
@@ -303,7 +303,7 @@ namespace build2
//
match_inner (a, t);
- return [pass_n, this] (action a, const target& t)
+ return [pass_n] (action a, const target& t)
{
return perform_update (a, t, pass_n);
};