aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/test/command.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/luarocks/test/command.lua b/src/luarocks/test/command.lua
index 396450db..999cc325 100644
--- a/src/luarocks/test/command.lua
+++ b/src/luarocks/test/command.lua
@@ -32,14 +32,22 @@ function command.run_tests(test, args)
32 end 32 end
33 end 33 end
34 34
35 local ok
36
35 if test.script then 37 if test.script then
36 if not fs.exists(test.script) then 38 if not fs.exists(test.script) then
37 return nil, "Test script " .. test.script .. " does not exist" 39 return nil, "Test script " .. test.script .. " does not exist"
38 end 40 end
39 local lua = fs.Q(dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)) -- get lua interpreter configured 41 local lua = fs.Q(dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)) -- get lua interpreter configured
40 return fs.execute(lua, test.script, unpack(args)) 42 ok = fs.execute(lua, test.script, unpack(args))
41 elseif test.command then 43 elseif test.command then
42 return fs.execute(test.command, unpack(args)) 44 ok = fs.execute(test.command, unpack(args))
45 end
46
47 if ok then
48 return true
49 else
50 return nil, "tests failed with non-zero exit code"
43 end 51 end
44end 52end
45 53