aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/cfg.lua1
-rw-r--r--src/luarocks/command_line.lua2
-rwxr-xr-xtest/testing.sh15
3 files changed, 14 insertions, 4 deletions
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({
44 OK = 0, 44 OK = 0,
45 UNSPECIFIED = 1, 45 UNSPECIFIED = 1,
46 PERMISSIONDENIED = 2, 46 PERMISSIONDENIED = 2,
47 CRASH = 99
47},{ 48},{
48 __index = function(t, key) 49 __index = function(t, key)
49 local val = rawget(t, key) 50 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(...)
208 local xp, ok, err, exitcode = xpcall(function() return cmd.run(unpack(args)) end, function(err) 208 local xp, ok, err, exitcode = xpcall(function() return cmd.run(unpack(args)) end, function(err)
209 die(debug.traceback("LuaRocks "..cfg.program_version 209 die(debug.traceback("LuaRocks "..cfg.program_version
210 .." bug (please report at luarocks-developers@lists.sourceforge.net).\n" 210 .." bug (please report at luarocks-developers@lists.sourceforge.net).\n"
211 ..err, 2)) 211 ..err, 2), cfg.errorcodes.CRASH)
212 end) 212 end)
213 if xp and (not ok) then 213 if xp and (not ok) then
214 die(err, exitcode) 214 die(err, exitcode)
diff --git a/test/testing.sh b/test/testing.sh
index b0d95c35..dc7ba680 100755
--- a/test/testing.sh
+++ b/test/testing.sh
@@ -452,8 +452,13 @@ run_tests() {
452 echo "-------------------------------------------" 452 echo "-------------------------------------------"
453 reset_environment 453 reset_environment
454 if $test 454 if $test
455 then echo "OK: Expected success." 455 then
456 else echo "FAIL: Unexpected failure."; exit 1 456 echo "OK: Expected success."
457 else
458 if [ $? = 99 ]
459 then echo "FAIL: Unexpected crash!"; exit 99
460 fi
461 echo "FAIL: Unexpected failure."; exit 1
457 fi 462 fi
458 done 463 done
459 grep "^fail_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test 464 grep "^fail_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test
@@ -464,7 +469,11 @@ run_tests() {
464 reset_environment 469 reset_environment
465 if $test 470 if $test
466 then echo "FAIL: Unexpected success."; exit 1 471 then echo "FAIL: Unexpected success."; exit 1
467 else echo "OK: Expected failure." 472 else
473 if [ $? = 99 ]
474 then echo "FAIL: Unexpected crash!"; exit 99
475 fi
476 echo "OK: Expected failure."
468 fi 477 fi
469 done 478 done
470} 479}