aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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