From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id F284F4696C4 for ; Wed, 15 Apr 2020 03:41:33 +0300 (MSK) From: Igor Munkin Date: Wed, 15 Apr 2020 03:34:25 +0300 Message-Id: <72c427cc218d5f9d7d62ef752cbcf89a69fd1665.1586906667.git.imun@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 luajit 1/3] test: add auxillary module for testing List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org The introduced Lua module provides the routine for testing the platform behaviour in some cases e.g. when test case leads to panic and error message need to be checked after the platform failure. Signed-off-by: Igor Munkin --- test/suite.ini | 1 + test/utils.lua | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/utils.lua diff --git a/test/suite.ini b/test/suite.ini index 3e860c9..0b9d5e2 100644 --- a/test/suite.ini +++ b/test/suite.ini @@ -1,5 +1,6 @@ [default] core = app description = Luajit tests +lua_libs = utils.lua is_parallel = True pretest_clean = True diff --git a/test/utils.lua b/test/utils.lua new file mode 100644 index 0000000..5e6f8d9 --- /dev/null +++ b/test/utils.lua @@ -0,0 +1,33 @@ +local M = { } + +local tap = require('tap') + +function M.selfrun(arg, checks) + local test = tap.test(arg[0]:match('/?(.+)%.test%.lua')) + + test:plan(#checks) + + local vars = { + LUABIN = arg[-1], + SCRIPT = arg[0], + PATH = arg[0]:gsub('%.test%.lua', ''), + SUFFIX = package.cpath:match('?.(%a+);'), + } + + local cmd = string.gsub('LUA_CPATH="$LUA_CPATH;/?." ' .. + 'LUA_PATH="$LUA_PATH;/?.lua" ' .. + 'LD_LIBRARY_PATH= ' .. + ' 2>&1