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 2C4356EC56; Tue, 16 Mar 2021 00:27:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2C4356EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615843639; bh=aYFvhR6we74J+N/jJ6aqJqMezy7BuESu0nixjgF3yFo=; 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=R6C0tIxIBo1AC7JEF3V9r6RtQuowXKWgg1F/62IusUmC52+knpQwmp3KX05FOcIJu z3Yc6CQkt0bYyR9FfIcm569/yX30afbaXm9eLBnJuUbxjKvKegpxmFJVkhY6iOzue3 oRdcqaivyoADQT/GM/JRFxm0mrXIDX2enKf46jp0= 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 BE7A86EC56 for ; Tue, 16 Mar 2021 00:27:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BE7A86EC56 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lLuk9-0005ia-Kl; Tue, 16 Mar 2021 00:27:18 +0300 Date: Tue, 16 Mar 2021 00:27:10 +0300 To: Sergey Kaplun Message-ID: <20210315212710.GJ9042@tarantool.org> References: <4e3445b32f5bcf94acc7c87c360aeb68ff0c399c.1615819534.git.skaplun@tarantool.org> <20210315173950.GF9042@tarantool.org> <20210315183330.GC16737@root> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210315183330.GC16737@root> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69BC7A690B93B93DD09EFED8A8D520004C100894C459B0CD1B9C2B9AA47983A75746A744AB87059D053F015D275C7F97D6CD6B083DDF398F1DE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE721AF84DC1D70954DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063786D6A7D810B9582D8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD50640F8B1D5298A5EE7A0470E5E41EEF47A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C327ED053E960B195E117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C22495B4C35AC65A386B3089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7CB04B26703878C8DC43847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FA8EF81845B15A4842623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E923155C0AF1600DCBC20BC34632CCC2A66CAB739FDB2F15769C01 X-C1DE0DAB: 0D63561A33F958A51E3F62D355282AFE2294282A8F34DB84AFE27E192A50B393D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345C110A855FC0999988E0107DD72162F3D3B852C383EFB9FE4246F985011323F82B7649E73FDB81491D7E09C32AA3244C3A949D9596562ADD2223E99021F54918250262A5EE9971B0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmD8gqPF9k0lX3KMuQUaF9Q== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822286FB01231D7982075B920A16B23EF1DA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B 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, On 15.03.21, Sergey Kaplun wrote: > Igor, > > Thanks for the review! > > On 15.03.21, Igor Munkin wrote: > > 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. > > I don't think so -- usage [1] declares the way to launch the suite. > It is our problem, that we don't use it. OK, I'll do it myself then. > > > > 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/. > > Thanks, update the branch. See the iterative patch below. > =================================================================== > diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua > index 5ce95e6..e527687 100644 > --- a/test/lua-Harness-tests/tap.lua > +++ b/test/lua-Harness-tests/tap.lua > @@ -195,7 +195,8 @@ function todo (reason, count) > todo_reason = reason > end > > --- The last arg element is guaranteed name of tested binary. > +-- The least arg element is guaranteed to be the name > +-- of the tested binary. > function get_lua_binary_name () > local i = 0 > while arg[i] do > =================================================================== > > > > > > +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. > > This economy looks unnecessary -- there are only 6 calls to this > function from the whole suite. You can provide time measurement > to prove me wrong. > I disagreed that it makes signature clearer, because there is no way to > use something instead `arg` variable anyway. Please, give me an > example, when usage of custom array is preferable than usage `arg` > variable. If this function *always* uses `arg` variable only, why we > should move it outside this function? I forgot to add "feel free to ignore" here. You can write the code you like and I can't make you to do it another way alone. For this purpose there are two reviewers. I'll postpone my LGTM a bit for this change. Regarding "no way to use something instead arg": nobody can stop you from parsing shebang. > > > > > > + i = i - 1 > > > + end > > > + return arg[i + 1] > > > +end > > > + > > > -- > > > -- Copyright (c) 2009-2018 Francois Perrad > > > -- > > > -- > > > 2.28.0 > > > > > > > -- > > Best regards, > > IM > > [1]: https://fperrad.frama.io/lua-Harness/usage/ > > -- > Best regards, > Sergey Kaplun -- Best regards, IM