diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/test/command.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/luarocks/test/command.lua b/src/luarocks/test/command.lua index afdb5cb6..bed6744e 100644 --- a/src/luarocks/test/command.lua +++ b/src/luarocks/test/command.lua | |||
| @@ -27,12 +27,18 @@ function command.run_tests(test, args) | |||
| 27 | local ok | 27 | local ok |
| 28 | 28 | ||
| 29 | if test.script then | 29 | if test.script then |
| 30 | if type(test.script) ~= "string" then | ||
| 31 | return nil, "Malformed rockspec: 'script' expects a string" | ||
| 32 | end | ||
| 30 | if not fs.exists(test.script) then | 33 | if not fs.exists(test.script) then |
| 31 | return nil, "Test script " .. test.script .. " does not exist" | 34 | return nil, "Test script " .. test.script .. " does not exist" |
| 32 | end | 35 | end |
| 33 | local lua = fs.Q(cfg.variables["LUA"]) -- get lua interpreter configured | 36 | local lua = fs.Q(cfg.variables["LUA"]) -- get lua interpreter configured |
| 34 | ok = fs.execute(lua, test.script, unpack(args)) | 37 | ok = fs.execute(lua, test.script, unpack(args)) |
| 35 | elseif test.command then | 38 | elseif test.command then |
| 39 | if type(test.command) ~= "string" then | ||
| 40 | return nil, "Malformed rockspec: 'command' expects a string" | ||
| 41 | end | ||
| 36 | ok = fs.execute(test.command, unpack(args)) | 42 | ok = fs.execute(test.command, unpack(args)) |
| 37 | end | 43 | end |
| 38 | 44 | ||
