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 D21546EC56; Mon, 15 Mar 2021 20:39:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D21546EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615829999; bh=upuX4gFzVUtetzn7ze/FdEANcRcgX6XtQ63t8KTcpWI=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=oRoY2b1ogu7/6rP3vJsNJKyOxRKODUSugf9XSeo+mPI2a8KfMcwC5/KhAaGF96s5g hDyHCm/yMiJb5k0jkV0Ql6OMuH9lOFiyKfA7ISCmMakYfa/iN7I6a3BrvpJhw3nSZB b1ovWT5ZsFQQnSKM7+4YzLaRgeIi7qlzb/LNbduo= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 55F086EC56 for ; Mon, 15 Mar 2021 20:39:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 55F086EC56 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lLrC9-0003AO-D2; Mon, 15 Mar 2021 20:39:57 +0300 Date: Mon, 15 Mar 2021 20:39:50 +0300 To: Sergey Kaplun Message-ID: <20210315173950.GF9042@tarantool.org> References: <4e3445b32f5bcf94acc7c87c360aeb68ff0c399c.1615819534.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4e3445b32f5bcf94acc7c87c360aeb68ff0c399c.1615819534.git.skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69B5A6145416490033C23E814B02A2DD10F00894C459B0CD1B91DCC8B6A5595A8B98759485F64CC3A60A43CA940AF9B274A769EFEB3C1E8ADEE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77BF46084C0059042EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BC4B0F5721B555078638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD502FE30A7070F837537F44382622310FFCA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C37EF884183F8E4D67117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C22495B4C35AC65A386B3089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7C02E240F9393C941343847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FA8EF81845B15A4842623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5992D9FCDB29CF6FB1379CF249FF9A89D00136D72DD647991D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F804B400765FFFF9B6A4E88492020980F3B84AF979C2F35E2FBEAF3635E9829039D1E36109B1E4051D7E09C32AA3244CD039E911CF8AD9F4D285561C4F3A0DCB97FE24653F78E668927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmD8gqPF9k0l4ugKOCkJ4nw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638224722702CCA1C7A42E81D5ABBD4785C0FA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [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: 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" Sergey, Thanks for the patch! This is why it's so important to take the suite intact at first: I didn't even notice these changes in the previous series and now I regret a bit regarding the solution with LUAJIT_TEST_INIT: for this case it occurs to be ugly a little. Nevertheless, I believe Francois would be interested in this use case, so it's worth to file a bug against lua-Harness, IMHO. On 15.03.21, Sergey Kaplun wrote: > LUAJIT_TEST_COMMAND always extends an amount of line argument by two > causing child test failures. I don't get the line above. I guess you mind something similar to this: | LUAJIT_TEST_COMMAND always extends table containing command line | arguments by two. It leads to child test failures, since Lua | interpreter name is misfetched from the table. > 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. Side note: I doubt the function location is right, but I guess there is no other place that is required by all test chunks. > > 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/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. Typo: s/last/least/. Typo: s/guaranteed name of tested/guaranteed to be the name of the tested/. > +function get_lua_binary_name () > + local i = 0 > + while arg[i] do You make an excess lookup to a _G for each iteration. It's better to pass as an argument to this function. Furthermore, it makes the signature clearer, so user knows you're using to detect the interpreter name. > + i = i - 1 > + end > + return arg[i + 1] > +end > + > -- > -- Copyright (c) 2009-2018 Francois Perrad > -- > -- > 2.28.0 > -- Best regards, IM