Skip to content

Commit

Permalink
tap: Make os.exit call lua_close on Lua versions that support it
Browse files Browse the repository at this point in the history
Second optional argument to os.exit is a boolean that determines if lua_close should be called while exiting. This was added in PUC Lua 5.2 and backported to LuaJIT.

This allows the tests to provide accurate memory leak information even with failing tests (memory leak info will still be inaccurate with failing tests on PUC Lua 5.1, since PUC Lua 5.1 os.exit bypasses lua_close).

Thanks to @vanc for the fix, see luvit#382 (comment)
  • Loading branch information
squeek502 authored and zhaozg committed Oct 28, 2019
1 parent 41eb6dd commit 5bcdd86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ local function run()
uv.run()

if failed ~= 0 then
os.exit(-failed)
os.exit(-failed, true)
end
end

Expand Down

0 comments on commit 5bcdd86

Please sign in to comment.