diff options
author | V1K1NGbg <victor@ilchev.com> | 2024-08-22 17:49:01 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-10-21 13:30:51 -0300 |
commit | 46c2b559e9eff1a3a553844bbf450e5214d6f5a6 (patch) | |
tree | 0f9f12f13861ff1ee7e135cf0e2758a906e7fc82 | |
parent | cfca48e5fcebb4e491b34097c77abc222baab150 (diff) | |
download | luarocks-46c2b559e9eff1a3a553844bbf450e5214d6f5a6.tar.gz luarocks-46c2b559e9eff1a3a553844bbf450e5214d6f5a6.tar.bz2 luarocks-46c2b559e9eff1a3a553844bbf450e5214d6f5a6.zip |
Teal: convert luarocks.cmd.test
-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. |
4 | local cmd_test = {} | 4 | local record cmd_test |
5 | end | ||
5 | 6 | ||
6 | local util = require("luarocks.util") | 7 | local util = require("luarocks.util") |
7 | local test = require("luarocks.test") | 8 | local test = require("luarocks.test") |
8 | 9 | ||
9 | function cmd_test.add_to_parser(parser) | 10 | local type Parser = require("luarocks.vendor.argparse").Parser |
11 | |||
12 | local type Args = require("luarocks.core.types.args").Args | ||
13 | |||
14 | function cmd_test.add_to_parser(parser: Parser) | ||
10 | local cmd = parser:command("test", [[ | 15 | local cmd = parser:command("test", [[ |
11 | Run the test suite for the Lua project in the current directory. | 16 | Run 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>") |
31 | end | 36 | end |
32 | 37 | ||
33 | function cmd_test.command(args) | 38 | function 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 |