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 F282D6BD23; Wed, 14 Apr 2021 16:55:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F282D6BD23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618408547; bh=aIgTZYx5FuqGn8b7NmnNTd6Dw6Cq7q10Ur/PfmIIM9s=; 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=cUMF/ZqyMTG21HXOF9ZAcvC709BlKl3xN+ieOTFow+wkpz3F9dHPRNHg2WuvCMwFb ePGFcznz2DChlJV9cEYIhNr+TKrD248iwolI0VRwn/GhPVIn2KbUSKj84OpY7YVcbi 55Zm4s8ai2rnlhRySSJLG0rA3THa5M6a6y6ULN8E= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 C1F1B6BD23 for ; Wed, 14 Apr 2021 16:55:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C1F1B6BD23 Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1lWfzP-00072B-Th; Wed, 14 Apr 2021 16:55:32 +0300 Date: Wed, 14 Apr 2021 16:54:33 +0300 To: Igor Munkin Message-ID: References: <20210413210514.GY29703@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210413210514.GY29703@tarantool.org> X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F5380850407A9AEC72E5B1E3C6DFFE148D21CA23A532E08736150586A4F272B6F2088A7C30 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE721D130CF676D2164EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063721F819F5952827038638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2468603B2809DC3350A56045337C729BA89428004B1FE94FDD2E47CDBA5A96583C09775C1D3CA48CFE97D2AE7161E217F117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7ABB305BD10C6E5099FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7358CCB3ED2A1DE2304C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5B5E9A56FC8004143915DEF13E7C1787105330CE1B434E848D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F7CC4EA888783AE0BF5C6806216C9AF6E4A97FAB1EF7CF6DCCC3DD6B022061850C5E925B1B4E1A921D7E09C32AA3244CFEBA9850FC99982CE79855E5F3A9230CC86C126E7119A0FEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrcJA+pXcDulAKOJ5ze/amQ== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB491EB22B70F3D25BAD6D48D3121B7A0FAE38F7CB99024B4C5F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v3 03/29] test: adapt PUC-Rio suite for out-of-source build 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" Hi, Igor! Thanks for the review! I see fixups on branch and they LGTM. AFAIU, do you want to squash them by yourself? On 14.04.21, Igor Munkin wrote: > Sergey, > > Thanks for the patch! LGTM with the following nits: I fixed them on your > branch[1] and guess no re-testing is needed. > > On 13.04.21, Sergey Kaplun wrote: > > The redefined `dofile()` function failed to find the test file to load, > > when tests are run out-of-source. So, fullpath is detected considering > > `arg[0]` value. Moreover, some tests use `loadfile()` instead, so their > > argument has to be adjusted to the full path to the files. > > > > Usage of functions invoking source test files was changed to > > `_loadfile()` and `_dofile()` correspondingly. They equal > > Typo: s/They equal/They equal to/. > > > `loadfile()` and `dofile()` by default and can be overloaded via running > > lua code from LUAJIT_TEST_INIT. This patch introduces the > > Typo: s/lua/Lua/. > > > file to be executed before tests and > > redefines the functions considering the path from `arg[0]` variable. > > > > Part of tarantool/tarantool#5845 > > Part of tarantool/tarantool#4473 > > --- > > CMakeLists.txt | 4 +-- > > test/PUC-Rio-Lua-5.1-tests/all.lua | 51 +++++++++++++++++------------- > > test/luajit-test-init.lua | 18 +++++++++++ > > 3 files changed, 49 insertions(+), 24 deletions(-) > > create mode 100644 test/luajit-test-init.lua > > > > diff --git a/CMakeLists.txt b/CMakeLists.txt > > index eb562923..df82d57c 100644 > > --- a/CMakeLists.txt > > +++ b/CMakeLists.txt > > @@ -302,8 +302,8 @@ set(LUAJIT_TEST_BINARY ${LUAJIT_BINARY} CACHE STRING > > # tweaked, the introduced option can be used. > > # XXX: The default behaviour is nop, so /dev/null is the best > > Comment need to be adjusted. > > > # option for this. > > -set(LUAJIT_TEST_INIT "/dev/null" CACHE STRING > > - "Lua code need to be run before tests are started. Default is nop." > > +set(LUAJIT_TEST_INIT "${PROJECT_SOURCE_DIR}/test/luajit-test-init.lua" CACHE STRING > > + "Lua code need to be run before tests are started." > > ) > > > > add_subdirectory(test) > > > > > diff --git a/test/luajit-test-init.lua b/test/luajit-test-init.lua > > new file mode 100644 > > index 00000000..aadd15af > > --- /dev/null > > +++ b/test/luajit-test-init.lua > > @@ -0,0 +1,18 @@ > > +-- XXX: PUC Rio Lua 5.1 test suite checks that global variable > > +-- `_loadfile()` exists and use it for code loading from test > > Typo: s/use/uses/. > > > +-- files If the variable is not defined then suite uses > > Typo: s/files/files./. > > > +-- `loadfile()` as default. Same for the `_dofile()`. > > + > > +-- XXX: Some tests in PUC Rio Lua 5.1 test suite clean `arg` > > +-- variable, so evaluate this once and use later. > > +local path_to_sources = arg[0]:gsub("[^/]+$", "") > > + > > +-- luacheck: no global > > +function _loadfile(filename) > > + return loadfile(path_to_sources..filename) > > +end > > + > > +-- luacheck: no global > > +function _dofile(filename) > > + return dofile(path_to_sources..filename) > > +end > > -- > > 2.31.0 > > > > [1]: https://github.com/tarantool/luajit/commit/c28985b > > -- > Best regards, > IM -- Best regards, Sergey Kaplun