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 9AAE86EC56; Mon, 15 Mar 2021 18:30:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9AAE86EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615822255; bh=KIkF5PTN8jSbGeStd58bn0ovPTMBU444dp9UzuowNpY=; 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=cpClo7Kdz8KiPYcmBjQG82wtPpAb9Pyvw6u2klXbDL36ih0MrnAMOit3zRXU2e3R9 tHwnSO+PRgCy6d6YAoISZMbhJCbvk0XQgEOplgs1s08YLDr7AhvvwYyQXfBPk688iF kDUaZtJdRJvF5cKcLj/TrBkEBxYZcgwfyvutlXio= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 5A6126EC5C for ; Mon, 15 Mar 2021 18:30:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5A6126EC5C Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lLpAo-0003Ga-1V; Mon, 15 Mar 2021 18:30:26 +0300 To: Sergey Ostanevich , Igor Munkin Date: Mon, 15 Mar 2021 18:29:27 +0300 Message-Id: <4e3445b32f5bcf94acc7c87c360aeb68ff0c399c.1615819534.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69B227B6855B2F1ABFAB31FADE3C60B02DF00894C459B0CD1B9BA4E1C393A5AA411DEE72D491972FBDB7A1DC2EC41CB43ED19F33B7625D3E01E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7922E451CE6E839B1EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E149C29A36E092738638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD50CAB9190640EC38BDD56618003A246539A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3ED8438A78DFE0A9E117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C2249ADE2ED557203A23075ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E7351CE60B8040019C36C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C7FF294EE7CC9FD50CAB9190640EC38BDD56618003A2465399C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFF532FBFD8162E58C699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344EF254DC71474AA33CC3DB5F23BAFB2D5202BD5095AE6726399BF0CC1D3F1EF59D2B2F42ABB9B6281D7E09C32AA3244C456D8CEA732363BA6935FE8330FBBB63F2F5F14F68F1805B927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmD8gqPF9k0lwzCe1A8hYcw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB464D91C0CF0A5D7F86D899F726626616123261FF1C387AD76F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 2/5] test: adjust lua-Harness suite for LuaJIT 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" LUAJIT_TEST_COMMAND always extends an amount of line argument by two causing child test failures. So, a new universal way to detect program name is required. This patch introduces the new function `get_lua_binary_name()` inside lua-Harness tap.lua module to get binary for test execution correctly. The following tests are adjusted with the new function: * 241-standalone.t * 242-luac.t * 301-basic.t * 308-io.t * 309-os.t * 320-stdin.t * 411-luajit.t Part of tarantool/tarantool#5844 Part of tarantool/tarantool#4473 --- test/lua-Harness-tests/241-standalone.t | 2 +- test/lua-Harness-tests/242-luac.t | 2 +- test/lua-Harness-tests/301-basic.t | 2 +- test/lua-Harness-tests/308-io.t | 2 +- test/lua-Harness-tests/309-os.t | 2 +- test/lua-Harness-tests/320-stdin.t | 2 +- test/lua-Harness-tests/411-luajit.t | 2 +- test/lua-Harness-tests/tap.lua | 9 +++++++++ 8 files changed, 16 insertions(+), 7 deletions(-) diff --git a/test/lua-Harness-tests/241-standalone.t b/test/lua-Harness-tests/241-standalone.t index c99f324..c5237ee 100755 --- a/test/lua-Harness-tests/241-standalone.t +++ b/test/lua-Harness-tests/241-standalone.t @@ -41,7 +41,7 @@ elseif ravi then banner = '^Ravi %d%.%d%.%d' end -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() local luac = jit and lua or (lua .. 'c') if not pcall(io.popen, lua .. [[ -e "a=1"]]) then diff --git a/test/lua-Harness-tests/242-luac.t b/test/lua-Harness-tests/242-luac.t index 2d166e5..a95a334 100755 --- a/test/lua-Harness-tests/242-luac.t +++ b/test/lua-Harness-tests/242-luac.t @@ -38,7 +38,7 @@ if ravi then skip_all("ravi") end -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() local luac = lua .. 'c' if not pcall(io.popen, lua .. [[ -e "a=1"]]) then diff --git a/test/lua-Harness-tests/301-basic.t b/test/lua-Harness-tests/301-basic.t index e45599e..f4f9235 100755 --- a/test/lua-Harness-tests/301-basic.t +++ b/test/lua-Harness-tests/301-basic.t @@ -48,7 +48,7 @@ local has_warn = _VERSION >= 'Lua 5.4' local has_xpcall52 = _VERSION >= 'Lua 5.2' or jit local has_xpcall53 = _VERSION >= 'Lua 5.3' or jit -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() plan'no_plan' diff --git a/test/lua-Harness-tests/308-io.t b/test/lua-Harness-tests/308-io.t index cdbcb83..35d39c0 100755 --- a/test/lua-Harness-tests/308-io.t +++ b/test/lua-Harness-tests/308-io.t @@ -40,7 +40,7 @@ local has_read53 = _VERSION >= 'Lua 5.3' or luajit21 local has_meta53 = _VERSION >= 'Lua 5.3' local has_meta54 = _VERSION >= 'Lua 5.4' -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() plan'no_plan' diff --git a/test/lua-Harness-tests/309-os.t b/test/lua-Harness-tests/309-os.t index e42fb53..a787b14 100755 --- a/test/lua-Harness-tests/309-os.t +++ b/test/lua-Harness-tests/309-os.t @@ -34,7 +34,7 @@ require'tap' local profile = require'profile' local luajit20 = jit and (jit.version_num < 20100 and not jit.version:match'^RaptorJIT') local has_execute51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit) -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() plan'no_plan' diff --git a/test/lua-Harness-tests/320-stdin.t b/test/lua-Harness-tests/320-stdin.t index 36528e8..4828285 100755 --- a/test/lua-Harness-tests/320-stdin.t +++ b/test/lua-Harness-tests/320-stdin.t @@ -26,7 +26,7 @@ Tests Lua Basic & IO Libraries with stdin require'tap' -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() if not pcall(io.popen, lua .. [[ -e "a=1"]]) then skip_all "io.popen not supported" diff --git a/test/lua-Harness-tests/411-luajit.t b/test/lua-Harness-tests/411-luajit.t index 05111be..feb752e 100755 --- a/test/lua-Harness-tests/411-luajit.t +++ b/test/lua-Harness-tests/411-luajit.t @@ -31,7 +31,7 @@ if not jit or ujit then skip_all("only with LuaJIT") end -local lua = arg[-3] or arg[-1] +local lua = get_lua_binary_name() if not pcall(io.popen, lua .. [[ -e "a=1"]]) then skip_all("io.popen not supported") diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua index 08a99b8..5ce95e6 100644 --- a/test/lua-Harness-tests/tap.lua +++ b/test/lua-Harness-tests/tap.lua @@ -195,6 +195,15 @@ function todo (reason, count) todo_reason = reason end +-- The last arg element is guaranteed name of tested binary. +function get_lua_binary_name () + local i = 0 + while arg[i] do + i = i - 1 + end + return arg[i + 1] +end + -- -- Copyright (c) 2009-2018 Francois Perrad -- -- 2.28.0