aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-22 17:48:58 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-10-21 13:30:51 -0300
commit2977b60e567922969e54ee19f1fb5115510755f5 (patch)
treef9479cae1655535bd5156288610cb796a63590ab /src
parentb0030995b0c60c0fb88d01d71cdd2d5773c8f321 (diff)
downloadluarocks-2977b60e567922969e54ee19f1fb5115510755f5.tar.gz
luarocks-2977b60e567922969e54ee19f1fb5115510755f5.tar.bz2
luarocks-2977b60e567922969e54ee19f1fb5115510755f5.zip
Teal: convert luarocks.test.busted
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/test/busted.tl (renamed from src/luarocks/test/busted.lua)16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/luarocks/test/busted.lua b/src/luarocks/test/busted.tl
index c73909cf..832a81b7 100644
--- a/src/luarocks/test/busted.lua
+++ b/src/luarocks/test/busted.tl
@@ -1,22 +1,24 @@
1 1
2local busted = {} 2local record busted
3end
3 4
4local fs = require("luarocks.fs") 5local fs = require("luarocks.fs")
5local deps = require("luarocks.deps") 6local deps = require("luarocks.deps")
6local path = require("luarocks.path") 7local path = require("luarocks.path")
7local dir = require("luarocks.dir") 8local dir = require("luarocks.dir")
8local queries = require("luarocks.queries") 9local queries = require("luarocks.queries")
10local install = require("luarocks.cmd.install")
9 11
10local unpack = table.unpack or unpack 12local type Test = require("luarocks.core.types.rockspec").Test
11 13
12function busted.detect_type() 14function busted.detect_type(): boolean
13 if fs.exists(".busted") then 15 if fs.exists(".busted") then
14 return true 16 return true
15 end 17 end
16 return false 18 return false
17end 19end
18 20
19function busted.run_tests(test, args) 21function busted.run_tests(test: Test, args: {string}): boolean, string
20 if not test then 22 if not test then
21 test = {} 23 test = {}
22 end 24 end
@@ -26,7 +28,7 @@ function busted.run_tests(test, args)
26 return nil, bustedver 28 return nil, bustedver
27 end 29 end
28 30
29 local busted_exe 31 local busted_exe: string
30 if test.busted_executable then 32 if test.busted_executable then
31 busted_exe = test.busted_executable 33 busted_exe = test.busted_executable
32 else 34 else
@@ -40,8 +42,8 @@ function busted.run_tests(test, args)
40 end 42 end
41 end 43 end
42 44
43 local err 45 local err: string
44 ok, err = fs.execute(busted_exe, unpack(args)) 46 ok, err = fs.execute(busted_exe, table.unpack(args))
45 if ok then 47 if ok then
46 return true 48 return true
47 else 49 else