From 28fd42e99d363af3410164bd60671d4047f9de26 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Wed, 24 Jun 2020 03:28:00 +0100 Subject: [PATCH] gambiarra shim support --- lua_tests/gambiarra/gambiarra.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua_tests/gambiarra/gambiarra.lua b/lua_tests/gambiarra/gambiarra.lua index ca529c6a96..adbbe11cd4 100644 --- a/lua_tests/gambiarra/gambiarra.lua +++ b/lua_tests/gambiarra/gambiarra.lua @@ -101,6 +101,12 @@ end local pendingtests = {} local env = _G local gambiarrahandler = TERMINAL_HANDLER +local shimhandler +do + local ok + ok, shimhandler = pcall(require,"shim_gambiarra") + if not ok then shimhandler = nil end +end local function runpending() if pendingtests[1] ~= nil then pendingtests[1](runpending) end @@ -133,7 +139,10 @@ return function(name, f, async) if next then next() end end - local handler = gambiarrahandler + local handler = function(...) + gambiarrahandler(...) + if shimhandler then shimhandler(...) end + end local function wrap(f, ...) f(handler, name, ...) end