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 4BBBD6EC42; Tue, 6 Jul 2021 23:53:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4BBBD6EC42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625604821; bh=7GkrIMc4d4E/Dcd2nUMxvuu5/+QbaP1C0IgLlPoNkuk=; 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=EzlDt/ucMcFTHv44vEnewKiOo64GMNJEsptKOlhUd7SeI9WWxIQqgrf0bOOc6lhD0 1t6upYHpoUtUyMw35HW3gAZRw0ZD4Ieuklp/jXit3D+zH2C9VLFNt8/ZkgPvwKpzsu 98XClHxgUTJDs8kRZEbyoYQkzPNEKr8QS363cXyU= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [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 4F0D16EC42 for ; Tue, 6 Jul 2021 23:53:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4F0D16EC42 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1m0s41-00041g-97; Tue, 06 Jul 2021 23:53:05 +0300 Date: Tue, 6 Jul 2021 23:29:34 +0300 To: Maxim Kokryashkin Message-ID: <20210706202934.GC11494@tarantool.org> References: <666cd23f865dbfe3b4986823fa3b9689493eff39.1625484589.git.max.kokryashkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <666cd23f865dbfe3b4986823fa3b9689493eff39.1625484589.git.max.kokryashkin@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FB8EEAA58EF109ED2DCA3B880632F394B8182A05F5380850409CF07370AB1B7E4699A787929F616FCA445483BD9F2EDE14413F8B4B1A752C33 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70A10A23A3B64B805EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063725FA9CD6081C82518638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B04071F536D670114CF90EFE55C2E652117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3A703B70628EAD7BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18E5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B60A62CEF541B197C8089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5A761C20EFF9470379D3A47984DFE6877AE67001FC0023E67D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75342909995EBBA6E4410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AC223B6CC5B2DFACF9F815204E8D402D0510A4A2DA71D493556A167CAEEF6BD31E440B37348F18D81D7E09C32AA3244C1853042D21303769AEE1C79828EBABFDF94338140B71B8EE927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojwWhFrYo6Pn3o/2n1aBHp+A== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D2BE590F28D4C4F1A7EDAF7120C64E68DA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 2/4] test: out-of-source testing 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" Max, Thanks for the patch! I left several comments below, please consider them in addition to the main comments in the cover letter. On 05.07.21, Maxim Kokryashkin wrote: > From: Maxim Kokryashkin > > Part of tarantool/tarantool#5970 > > --- > The patch `fperrad/lua-Harness@60da289` is similar to the patch > `tarantool/luajit@d11c5bb`, but `make_specific_checks()` was > renamed to `_dofile()` by maintainer. Another difference is that > it seems like there is no definition for `_dofile()` in mainline > lua-Harness, so it should be user-defined somewhere. If it is not, > then `_dofile()` will act like `dofile()`. Considering this, we > should keep `make_specific_checks` implementation from > `tarantool/luajit@d11c5bb`, but rename it to `_dofile` and move > to `tap.lua`. In addition to all comments for the first patch, I would like to clarify the semantics of the change. The general idea was to give the user an opportunity to *overload* <_dofile> for his own purposes, but the default behaviour should be the same as . We have been already using this technique for PUC-Rio Lua 5.1 test suite and <_dofile> is already defined in luajit-test-init.lua (please adjust the comment, since as a result of the patch, <_dofile> is also used in lua-Harness suite). Considering all comments, I propose the following rewording: | The patch[1] from lua-Harness suite is quite similar to commit | d11c5bbc08a118b11167c5d455d4024607dab662 ('test: adjust lua-Harness | tests that use dofile'), with the one difference (except the naming): | `make_specific_checks()` provides the particular behaviour to run the | tests for out-of-source build, however `_dofile()` allows user to | overload this function considering his purposes. If user leave | `_dofile()` untouched, it defaults to `dofile()` Lua standard library | function. | | It's worth to mention, that LuaJIT testing machinery has been using | such approach since commit 734cc0f1d508429c2c3c46bd1860398db0051060 | ('test: adapt PUC-Rio suite for out-of-source build') and `_dofile()` | behaviour for running tests when out of source build is used is | already defined in luajit-test-init.lua. | | [1]: https://framagit.org/fperrad/lua-Harness/-/commit/60da289 | | Part of tarantool/tarantool#5970 | Part of tarantool/tarantool#4473 If you are OK with the part above, feel free to paste it as is into the commit message for the next version of the patch. > > test/lua-Harness-tests/101-boolean.t | 2 +- > test/lua-Harness-tests/102-function.t | 2 +- > test/lua-Harness-tests/103-nil.t | 2 +- > test/lua-Harness-tests/104-number.t | 2 +- > test/lua-Harness-tests/105-string.t | 2 +- > test/lua-Harness-tests/106-table.t | 2 +- > test/lua-Harness-tests/107-thread.t | 2 +- > test/lua-Harness-tests/108-userdata.t | 2 +- > test/lua-Harness-tests/203-lexico.t | 8 ++++---- > test/lua-Harness-tests/231-metatable.t | 2 +- > test/lua-Harness-tests/301-basic.t | 2 +- > test/lua-Harness-tests/305-utf8.t | 2 +- > test/lua-Harness-tests/404-ext.t | 2 +- > test/lua-Harness-tests/tap.lua | 4 ++++ > 14 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/test/lua-Harness-tests/305-utf8.t b/test/lua-Harness-tests/305-utf8.t > index 6c125388..1e975e6d 100755 > --- a/test/lua-Harness-tests/305-utf8.t > +++ b/test/lua-Harness-tests/305-utf8.t > @@ -40,7 +40,7 @@ if not utf8 then > nok(has_utf8, "no has_utf8") > else > plan'no_plan' > - make_specific_checks'lexico53/utf8.t' > + _dofile'lexico53/utf8.t' > if _VERSION >= 'Lua 5.4' then > make_specific_checks'lexico54/utf8.t' This one should be also changed to <_dofile>. > end > diff --git a/test/lua-Harness-tests/tap.lua b/test/lua-Harness-tests/tap.lua > index 86cca4e0..b17709e5 100644 > --- a/test/lua-Harness-tests/tap.lua > +++ b/test/lua-Harness-tests/tap.lua > @@ -9,6 +9,10 @@ > > ]] > > +function _dofile (filename) > + return dofile(arg[0]:gsub('([^/]+)%.t$', '') .. filename) > +end At first, <_dofile> should use for the default behaviour. Furthermore, such definition can redefine the function specified by user, if this function is created after the user-defined one. So, you need to check whether <_dofile> is defined or use if it is not. BTW, please drop routine from tap.lua, since it's not used anymore. > + > function _retrieve_progname () > local i = 0 > while arg[i] do > -- > 2.31.1 > -- Best regards, IM