summaryrefslogtreecommitdiff
path: root/xmake/actions/test/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-01 22:47:48 +0800
committerruki <[email protected]>2023-11-01 22:47:48 +0800
commit65a950ee174ac6cb508c5bab8e6f1dbaa31fd2be (patch)
tree0785b55f490ad55a46d3d7018f4e4c4512b368e3 /xmake/actions/test/main.lua
parent3ba30810808986745dc0644ce495e3ab46d41291 (diff)
compile test stub
Diffstat (limited to 'xmake/actions/test/main.lua')
-rw-r--r--xmake/actions/test/main.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua
index d73274a28..2bb5dfe23 100644
--- a/xmake/actions/test/main.lua
+++ b/xmake/actions/test/main.lua
@@ -351,6 +351,17 @@ function main()
local testinfo = {name = testname, target = target}
if extra then
table.join2(testinfo, extra)
+ if extra.files then
+ local target_new = target:clone()
+ local scriptdir = target:scriptdir()
+ for _, file in ipairs(extra.files) do
+ file = path.absolute(file, scriptdir)
+ file = path.relative(file, os.projectdir())
+ target_new:add("files", file, {defines = extra.defines})
+ project.target_add(target_new)
+ end
+ testinfo.target = target_new
+ end
end
if not testinfo.group then
testinfo.group = target:get("group")