aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-11 22:54:16 +0300
committerZyX <kp-pav@yandex.ru>2017-03-11 23:23:49 +0300
commitce12bda712bfe41ec606dc86604011e33690df3c (patch)
tree93f01f292d7b6acc576bd0e7bb6a7c640da23f38
parente2a578f40dbd4836330402a44844c7ef8a0df5c5 (diff)
downloadrneovim-ce12bda712bfe41ec606dc86604011e33690df3c.tar.gz
rneovim-ce12bda712bfe41ec606dc86604011e33690df3c.tar.bz2
rneovim-ce12bda712bfe41ec606dc86604011e33690df3c.zip
unittests: Always close all pipes
-rw-r--r--test/unit/helpers.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index 93eb01b21b..a8c621fd6d 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -515,14 +515,15 @@ local function gen_itp(it)
local err = sc.read(rd, len + 1)
assert.just_fail(err)
end
- if allow_failure then
- local err, emsg = pcall(check)
- if not err then
+ local err, emsg = pcall(check)
+ sc.close(rd)
+ if not err then
+ if allow_failure then
io.stderr:write('Errorred out:\n' .. tostring(emsg) .. '\n')
os.execute([[sh -c "source .ci/common/test.sh ; check_core_dumps --delete \"\$(which luajit)\""]])
+ else
+ error(emsg)
end
- else
- check()
end
end
end)