summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-05-02 22:45:34 +0800
committerruki <[email protected]>2018-05-02 10:33:27 +0800
commitd1db6a9b8cc657ea5b3fc1cddb52d3b351639680 (patch)
treeeb5671429d48701afa6a6adad829d344f80b9c73
parent36e4d8e69cdf7019485d5328810fe1c5720bad5d (diff)
modify rule tests
-rw-r--r--tests/apis/rules/xmake.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/apis/rules/xmake.lua b/tests/apis/rules/xmake.lua
index 25640965c..712a055ef 100644
--- a/tests/apis/rules/xmake.lua
+++ b/tests/apis/rules/xmake.lua
@@ -117,6 +117,18 @@ rule("stub1")
print("rule(stub1): after_run")
end)
+-- define rule: stub0b
+rule("stub0b")
+ before_build_file(function (target, sourcefile)
+ print("rule(stub0b): before_build_file", sourcefile)
+ end)
+
+-- define rule: stub0a
+rule("stub0a")
+ after_build_file(function (target, sourcefile)
+ print("rule(stub0a): after_build_file", sourcefile)
+ end)
+
-- define target
target("test")
@@ -127,7 +139,7 @@ target("test")
add_rules("stub1")
-- add files
- add_files("src/*.c")
+ add_files("src/*.c", {rules = {"stub0a", "stub0b"}})
add_files("src/man/*.in", {rule = "man"})
add_files("src/index.md")
add_files("src/test.c.in", {rule = "c code"})