From 9e2771f0335329081303e53e4008a7fae4c9bef0 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 11 Oct 2019 14:19:29 +0200 Subject: [PATCH] tests: fail with non-zero child exitcode/signal Ref: https://github.com/neovim/lua-client/pull/44 --- test/functional/helpers.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 20371b8ab072db..a5d6246638988f 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -1,4 +1,5 @@ require('coxpcall') +local busted = require('busted') local luv = require('luv') local lfs = require('lfs') local mpack = require('mpack') @@ -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