From 8bbf02e239ad62248f1b13af6fbc93ff84469831 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 26 Nov 2014 16:52:47 -0200 Subject: Make test suite detect crashes on tests that should fail gracefully. --- src/luarocks/cfg.lua | 1 + src/luarocks/command_line.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 9a992bae..2d02230b 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -44,6 +44,7 @@ cfg.errorcodes = setmetatable({ OK = 0, UNSPECIFIED = 1, PERMISSIONDENIED = 2, + CRASH = 99 },{ __index = function(t, key) local val = rawget(t, key) diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index cc2e1683..15b036b0 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/command_line.lua @@ -208,7 +208,7 @@ function command_line.run_command(...) local xp, ok, err, exitcode = xpcall(function() return cmd.run(unpack(args)) end, function(err) die(debug.traceback("LuaRocks "..cfg.program_version .." bug (please report at luarocks-developers@lists.sourceforge.net).\n" - ..err, 2)) + ..err, 2), cfg.errorcodes.CRASH) end) if xp and (not ok) then die(err, exitcode) -- cgit v1.2.3-55-g6feb