File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 4343 run : rm .luaurc && mv .luaurc.ci .luaurc
4444
4545 - name : Run Luau Tests
46- run : find tests -name "*.test.luau" | xargs -I {} ${{ steps.build_lute.outputs.exe_path }} run {}
46+ run : ${{ steps.build_lute.outputs.exe_path }} test
4747
4848 run-lute-cxx-unittests :
4949 runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change 11local finder = require ("@self/finder" )
22local luau = require ("@std/luau" )
33local path = require ("@std/path" )
4+ local ps = require ("@std/process" )
5+ local testtypes = require ("@std/test/types" )
6+ local runner = require ("@std/test/runner" )
7+ local reporter = require ("@std/test/reporter" )
48local test = require ("@std/test" )
59
610local function printHelp ()
@@ -85,6 +89,15 @@ local function listtests()
8589 end
8690end
8791
92+ local function runtests (env : testtypes .testenvironment , runner : testtypes .testrunner , reporter : testtypes .testreporter )
93+ local result = runner (env )
94+ reporter (result )
95+ if result .failed ~= 0 then
96+ ps .exit (1 )
97+ end
98+ ps .exit (0 )
99+ end
100+
88101local function main (... : string )
89102 local args = { ... }
90103 local testPaths = {}
@@ -105,6 +118,9 @@ local function main(...: string)
105118
106119 if isListMode then
107120 listtests ()
121+ else
122+ local env = test ._registered ()
123+ runtests (env , runner .run , reporter .simple )
108124 end
109125end
110126
Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ test.suite("lute test", function(suite)
2626 assert .neq (result .stdout :find ("Usage:" , 1 , true ), nil )
2727 end )
2828
29- suite :case ("lute test runs successfully " , function (assert )
30- -- Run lute test without arguments
31- local result = process .run ({ lutePath , "test" })
29+ suite :case ("lute test runs tests in discovery folder " , function (assert )
30+ -- Run lute test on tests/cli/discovery folder
31+ local result = process .run ({ lutePath , "test" , "tests/cli/discovery" })
3232
33- -- Check that it succeeds
33+ -- Check that it runs tests and succeeds
3434 assert .eq (result .exitcode , 0 )
3535 end )
3636
You can’t perform that action at this time.
0 commit comments