Skip to content

Commit

Permalink
tests: fail with non-zero child exitcode/signal
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Oct 11, 2019
1 parent b772b86 commit 9e2771f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/functional/helpers.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require('coxpcall')
local busted = require('busted')
local luv = require('luv')
local lfs = require('lfs')
local mpack = require('mpack')
Expand Down Expand Up @@ -832,6 +833,16 @@ return function(after_each)
error(msg[3][2])
end
end

if not session.child_exit then
session:close()
end
if session.child_exit then -- requires newer neovim-lua-client (WIP).
if session.child_exit ~= 0 or session.child_signal ~= 0 then
busted.fail(string.format("child exited non-zero (exitcode=%d, signal=%d)",
session.child_exit, session.child_signal))
end
end
end
end)
end
Expand Down

0 comments on commit 9e2771f

Please sign in to comment.