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 C3FFB6EC5B; Wed, 14 Apr 2021 00:05:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C3FFB6EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618347928; bh=QyUrWoh4nJlphZUpQKxqBPPZgEntC85pzrszRNxyxYk=; 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=DUy0mAHA21P/NpROwTFG4SS8ojnSzA3k1d/5GyLJJkF+Uae+wZ0n7Hrha8AI7w6Vv xGv41P1uHCiJYfYaVFDqKvnnYBmbeaUKe68eBnNAYysP8wtXXZHSCWO5neBV6hh8O3 MUTreLptEvy7DjrTqCC1/VVxIOAMsZwyZNO4betg= 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 78AFD6EC5B for ; Wed, 14 Apr 2021 00:05:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 78AFD6EC5B Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lWQDu-0004Kk-FD; Wed, 14 Apr 2021 00:05:26 +0300 Date: Wed, 14 Apr 2021 00:05:14 +0300 To: Sergey Kaplun Message-ID: <20210413210514.GY29703@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480EBD5CA77A668ECB87DA2124B0A8E6609182A05F53808504064F552AA1CCD71368B0837DD25D8BDA92D4C94A4803A649CD48BB39A3E56DA56 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE741DC22BF90A736D8EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E7FC1205106FBD248638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2E4A3629B855154E7ADD6CB9F47AAE44B07164437C8F97EC6D2E47CDBA5A96583C09775C1D3CA48CF4964A708C60C975A117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE709B92020B71E24959FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7350555CCFDA08FA3FAC4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831435AC349C79168D4B139F1DD504E1C03 X-C1DE0DAB: 0D63561A33F958A5B1BB4D27F9AF531FF5D21F10D0393BA7713A8C9204E0BC5AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3450C5E6D685282BA136819577E87306C5C2F577C08C316B9B1AF1E4E2522498C3313A64761D96FF581D7E09C32AA3244C05FBD0E0816152EA5A0D7237293F262C725D5B54B2FE4575927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnA7/qPBUIXHCaFN85MpFVg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638224B86B1E51E6DA071BD51AD3EB69D9AADA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B 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: 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! 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