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 AB7E66EC5D; Tue, 6 Apr 2021 16:02:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AB7E66EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617714125; bh=DJNNkTAibwFhc8y8HkP0UOIKnxZi3Wor9TOpqm8UxzQ=; 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=BLO9SEUKlDE/XQBnxZC78frsF/GSk9kC7X0EVHnD6cT3Vs8oYqSzY4nQ+IsP2b1/I jJT1lKQCAND1oXhYaCWA2FOcNiCHlU9Y+uu/npyWpcxuPGZOvNv8goQ1tM5qQFXWYX LySFV+gI7ErKu6MIHt+7f4aKvnQp/+DTR0q4Svmg= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 CA5976EC5D for ; Tue, 6 Apr 2021 16:02:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CA5976EC5D Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1lTlLG-0007mH-V6; Tue, 06 Apr 2021 16:02:03 +0300 Date: Tue, 6 Apr 2021 16:01:07 +0300 To: Igor Munkin Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947A0146560F8BA70927CAA5B950F38D9F182A05F538085040CC16D070022A80BE5484211E41DBC58D69079C87406466E7DD60F18365509971 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F1942E6D70B4A2F0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C83F54BD885518138638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C16EE06F5A270FE6AF4B200440B67983B68C68F94A272394BA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3E478A468B35FE767117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006370127E7423624AE28EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A53D91E680BB59416757141614B77E032E93C635276344289DD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A9873270276D4334127B4252E3AE0BB30E1016B7AF8D5EA3708B3A49EDCC7624A3089AF44E2677D81D7E09C32AA3244C0CFE58E430339250AA2D003B3678510CCE0B41342B755BCDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojAX27rRizpLnprjDnQhedjw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB458E4EF4C415FA8DD9241E8BA3D8C4ED7A9CCB844FDC00149F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [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: 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" Igor, Thanks for the patch! LGTM, except a few nits below. Nit: I suggest to use `` for codenames mentions (if it is a function, then use brackets, for example `function_name()`), and <> for filenames mentions in the commit message and comments in the code. This style has already been used for lua-Harness suite. Thoughts? On 05.04.21, Igor Munkin wrote: > 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 @@ > +----- Test payload. ------------------------------------------------------------ Typo? comment length is too long, isn't it? But, in other side, we already have the 80-symbols comments inside ... But, we have no strict code style for LuaJIT part of the code. So: Feel free to ignore. > > 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 @@ > +----- Test payload. ------------------------------------------------------------ Ditto. > > 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 Typo? should we avoid inline return, shouldn't we? > + > + -- ... 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