diff options
author | daurnimator <quae@daurnimator.com> | 2019-05-29 21:18:26 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2019-05-29 21:18:40 +1000 |
commit | b0969db58997eea6b8f1a31a353384727b23a392 (patch) | |
tree | 0ed322bf134cc1c92c2e7809518ede99a1ffae2b /src | |
parent | fd24556a046391c81e6a197c8563f149302b8933 (diff) | |
parent | b3a046edacb223bf2209dfd70131c132efb94a97 (diff) | |
download | luarocks-b0969db58997eea6b8f1a31a353384727b23a392.tar.gz luarocks-b0969db58997eea6b8f1a31a353384727b23a392.tar.bz2 luarocks-b0969db58997eea6b8f1a31a353384727b23a392.zip |
Merge PR #1012
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/test/command.lua | 12 |
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 |
44 | end | 52 | end |
45 | 53 | ||