aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-22 17:49:01 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-10-21 13:30:51 -0300
commit46c2b559e9eff1a3a553844bbf450e5214d6f5a6 (patch)
tree0f9f12f13861ff1ee7e135cf0e2758a906e7fc82 /src
parentcfca48e5fcebb4e491b34097c77abc222baab150 (diff)
downloadluarocks-46c2b559e9eff1a3a553844bbf450e5214d6f5a6.tar.gz
luarocks-46c2b559e9eff1a3a553844bbf450e5214d6f5a6.tar.bz2
luarocks-46c2b559e9eff1a3a553844bbf450e5214d6f5a6.zip
Teal: convert luarocks.cmd.test
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cmd/test.tl (renamed from src/luarocks/cmd/test.lua)11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/luarocks/cmd/test.lua b/src/luarocks/cmd/test.tl
index b353bd80..b1189d47 100644
--- a/src/luarocks/cmd/test.lua
+++ b/src/luarocks/cmd/test.tl
@@ -1,12 +1,17 @@
1 1
2--- Module implementing the LuaRocks "test" command. 2--- Module implementing the LuaRocks "test" command.
3-- Tests a rock, compiling its C parts if any. 3-- Tests a rock, compiling its C parts if any.
4local cmd_test = {} 4local record cmd_test
5end
5 6
6local util = require("luarocks.util") 7local util = require("luarocks.util")
7local test = require("luarocks.test") 8local test = require("luarocks.test")
8 9
9function cmd_test.add_to_parser(parser) 10local type Parser = require("luarocks.vendor.argparse").Parser
11
12local type Args = require("luarocks.core.types.args").Args
13
14function cmd_test.add_to_parser(parser: Parser)
10 local cmd = parser:command("test", [[ 15 local cmd = parser:command("test", [[
11Run the test suite for the Lua project in the current directory. 16Run the test suite for the Lua project in the current directory.
12 17
@@ -30,7 +35,7 @@ to separate LuaRocks arguments from test suite arguments.]],
30 :argname("<type>") 35 :argname("<type>")
31end 36end
32 37
33function cmd_test.command(args) 38function cmd_test.command(args: Args): boolean, string, string --!
34 if args.rockspec and args.rockspec:match("rockspec$") then 39 if args.rockspec and args.rockspec:match("rockspec$") then
35 return test.run_test_suite(args.rockspec, args.test_type, args.args, args.prepare) 40 return test.run_test_suite(args.rockspec, args.test_type, args.args, args.prepare)
36 end 41 end