summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-13 22:34:20 +0800
committerruki <[email protected]>2018-04-13 09:26:00 +0800
commitf2c934d1370eed2e674a94c4f678a3cf3da812f0 (patch)
tree04105ced4d5410495f1b1c8b4b8fe6698df10133
parenta5db969b72cd12419a6699ebd98f6fa5a9b85019 (diff)
improve rule tests
-rw-r--r--tests/apis/rules/xmake.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/apis/rules/xmake.lua b/tests/apis/rules/xmake.lua
index e447feb24..b1211e4bd 100644
--- a/tests/apis/rules/xmake.lua
+++ b/tests/apis/rules/xmake.lua
@@ -2,7 +2,11 @@
-- define rule: markdown
rule("markdown")
set_extensions(".md", ".markdown")
+ on_load(function (target)
+ print("markdown: on_load")
+ end)
on_build_file(function (target, sourcefile)
+ print("compile %s", sourcefile)
os.cp(sourcefile, path.join(target:targetdir(), path.basename(sourcefile) .. ".html"))
end)
@@ -28,12 +32,14 @@ rule("c code")
-- define rule: stub3
rule("stub3")
+ add_deps("markdown")
on_load(function (target)
print("rule(stub3): on_load")
end)
-- define rule: stub2
rule("stub2")
+ add_deps("stub3")
on_load(function (target)
print("rule(stub2): on_load")
end)
@@ -112,7 +118,7 @@ target("test")
set_kind("binary")
-- add rules
- add_rules("markdown", "stub1")
+ add_rules("stub1")
-- add files
add_files("src/*.c")