From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A7D1D6EC5D; Mon, 5 Apr 2021 20:12:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A7D1D6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617642772; bh=83olTyPzj3wGGiAUU7w0G/4CJD8AtkCQW0knlbTE2LA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=R1md2X01hba749mJrvHymsb1T4i2/QIFttVcwAOirFxLkDAGLOyKSaMfHtqOUqJKh KuuFhbinLVH/bvkCmXloI/x2kFkx01qIH/FmFxBTglIxWaeDBOkUk8ueIH7FCIFmmX yG8wHFlUeimWTR4Nah3DjqcGQ0M9iDeJ+AN1ylHI= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 AA2126EC63 for ; Mon, 5 Apr 2021 20:11:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AA2126EC63 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lTSlT-0007LJ-VG; Mon, 05 Apr 2021 20:11:52 +0300 To: Sergey Ostanevich , Sergey Kaplun Date: Mon, 5 Apr 2021 20:11:39 +0300 Message-Id: X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E3294CA3588DDE0233B0D17711AF1EA2D7DB9182A05F538085040681C707E7DAE53FB94300AC23D578C35B64CA82F504C010EDAF1D94CD3D169B1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE712EB008F780777E9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371ECA800C705ED7E68638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C16EE06F5A270FE6A39451B633DB1FC8794089D84682E21ACA471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658359CC434672EE6371117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006372A310894EFA5E9A9EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: 2623F767319EFA42AC98609FCEE262F9192335DD689A58EBAE0174B7F1092AFBF63472D85867295660BF2C72A8CE8C0F X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C16EE06F5A270FE6A39451B633DB1FC8794089D84682E21AC9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3416EA6E382A5BB176AB773C5886FCBCDF21BE378D1F803C68A2354CC633C3E3F84A5BE12902C4BF451D7E09C32AA3244CE0A75D0D2452F52B6FABF3A5B18FE74830363D8B7DA7DD44927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojM00ve/f+0okceB51Cbs0Dg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382215C15C895D30B4A94928FBC7E1339ED5A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 2/3] test: make utils.selfrun usage easier X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Previous implementation of implicitly obliges the developer to pass the arguments to the test script for the second run. This has been unnoticed, since the existing tests are invoked for two different cases, so the script arguments were kinda obligatory, but they are not required in a general case. As a result the function signals the testing system that the script is being run the second time via TEST_SELFRUN environment variable. Signed-off-by: Igor Munkin --- .../gh-4427-ffi-sandwich.test.lua | 51 +++++++++---------- .../lj-flush-on-trace.test.lua | 51 +++++++++---------- test/tarantool-tests/utils.lua | 7 +++ 3 files changed, 57 insertions(+), 52 deletions(-) diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua index 56363608..64df5dbd 100644 --- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua +++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua @@ -1,31 +1,30 @@ -if #arg == 0 then - - local utils = require('utils') - - -- Disabled on *BSD due to #4819. - utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') - - utils.selfrun(arg, { - { - arg = { - 1, -- hotloop (arg[1]) - 1, -- trigger (arg[2]) - }, - msg = 'Trace is aborted', - res = tostring(3), -- hotloop + trigger + 1 - test = 'is', +local utils = require('utils') + +-- Disabled on *BSD due to #4819. +utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') + +utils.selfrun(arg, { + { + arg = { + 1, -- hotloop (arg[1]) + 1, -- trigger (arg[2]) }, - { - arg = { - 1, -- hotloop (arg[1]) - 2, -- trigger (arg[2]) - }, - msg = 'Trace is recorded', - res = 'Lua VM re%-entrancy is detected while executing the trace', - test = 'like', + msg = 'Trace is aborted', + res = tostring(3), -- hotloop + trigger + 1 + test = 'is', + }, + { + arg = { + 1, -- hotloop (arg[1]) + 2, -- trigger (arg[2]) }, - }) -end + msg = 'Trace is recorded', + res = 'Lua VM re%-entrancy is detected while executing the trace', + test = 'like', + }, +}) + +----- Test payload. ------------------------------------------------------------ local cfg = { hotloop = arg[1] or 1, diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua index 46fee533..edc5cf61 100644 --- a/test/tarantool-tests/lj-flush-on-trace.test.lua +++ b/test/tarantool-tests/lj-flush-on-trace.test.lua @@ -1,31 +1,30 @@ -if #arg == 0 then - - local utils = require('utils') - - -- Disabled on *BSD due to #4819. - utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') - - utils.selfrun(arg, { - { - arg = { - 1, -- hotloop (arg[1]) - 1, -- trigger (arg[2]) - }, - msg = 'Trace is aborted', - res = 'OK', - test = 'is', +local utils = require('utils') + +-- Disabled on *BSD due to #4819. +utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') + +utils.selfrun(arg, { + { + arg = { + 1, -- hotloop (arg[1]) + 1, -- trigger (arg[2]) }, - { - arg = { - 1, -- hotloop (arg[1]) - 2, -- trigger (arg[2]) - }, - msg = 'Trace is recorded', - res = 'JIT mode change is detected while executing the trace', - test = 'like', + msg = 'Trace is aborted', + res = 'OK', + test = 'is', + }, + { + arg = { + 1, -- hotloop (arg[1]) + 2, -- trigger (arg[2]) }, - }) -end + msg = 'Trace is recorded', + res = 'JIT mode change is detected while executing the trace', + test = 'like', + }, +}) + +----- Test payload. ------------------------------------------------------------ local cfg = { hotloop = arg[1] or 1, diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua index aebbf6ac..d2dd71b0 100644 --- a/test/tarantool-tests/utils.lua +++ b/test/tarantool-tests/utils.lua @@ -14,6 +14,12 @@ local function luacmd(args) end function M.selfrun(arg, checks) + -- If TEST_SELFRUN is set, just execute the test payload below + -- call, ... + if os.getenv('TEST_SELFRUN') then return end + + -- ... otherwise run this chunk via . + local test = tap.test(arg[0]:match('/?(.+)%.test%.lua')) test:plan(#checks) @@ -28,6 +34,7 @@ function M.selfrun(arg, checks) local cmd = string.gsub('LUA_PATH="/?.lua;$LUA_PATH" ' .. 'LUA_CPATH="/?.;$LUA_CPATH" ' .. 'LD_LIBRARY_PATH=:$LD_LIBRARY_PATH ' .. + 'TEST_SELFRUN=1' .. ' 2>&1