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 BD2046F3C7; Fri, 26 Mar 2021 14:07:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BD2046F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616756829; bh=r4yELnwv8kgtIe2Tn5//dlSR+E6KURU3upcn0BnZGPs=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=h5HUVoD98DE1HyvxUq//cSzUXnYp5ywgP5LFWlS/yBKyRVYNnGoZtTqt71ZIXRK2D w/wvmGa1f+ajE0m4u57g9FfBnnLlHyQh3pjKlNhA3ZF7L1p6PkvH6wt4JIsegIyy1W 4WA+jDI22WJ8uG3nclyrveQl94Vc38mEyXqSrISo= 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 5187D6F3C7 for ; Fri, 26 Mar 2021 14:07:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5187D6F3C7 Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1lPkJ1-0005zd-Ha; Fri, 26 Mar 2021 14:07:07 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Fri, 26 Mar 2021 14:07:06 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Sergey Kaplun X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9064ADF4728AA0EE919EF87AC0718675712B828C563C11F50182A05F53808504037094C0DC28DF8DEF2E63B914FF28729F31A78EA45510BDC29F1BF60B8EDFC91 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71EAE3A63419E5AEDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BA5555A0C16230F4EA1F7E6F0F101C67CDEEF6D7F21E0D1D174C73DBBBFC7664DC1964D542DDDD83CF8AB44C05E36FF927F1CCB68DA7D520389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE6371089D37D7C0E48F6C8AA50765F7900637FB177F6A8366F17BEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5484CB95A8762E3300B800644AFB2FAF0A810A29276D35292D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D71B56C992F8AF19AEB85D5DD5B0FD453EE8E6404CB6E3FA5BA4713CCEBEA70BC132908AF254CF8B1D7E09C32AA3244CF05E1EE75A21230BF7D0501D4E987E78E3D93501275E802FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAhfU8LYcWxyTg== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81E8446B07A8AC92FBA54BC786C891C747D19948FABA0889B33AD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 03/30] test: adapt Lua 5.1 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 Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" LGTM, just minor changes to commit message. Sergos > On 26 Mar 2021, at 10:42, Sergey Kaplun wrote: >=20 > When tests are run out-of-source redefined `dofile()` function ^ I had problem reading here the=20 =E2=80=98out-of-source redefined=E2=80=99. Can you put the =E2=80=98when..= =E2=80=99 to the appropriate place at the end of the sentence? =E2=80=99The redefined =E2=80=A6 when = =E2=80=A6 =E2=80=98 =20 > failed to find file to load. So, fullpath is detected considering > `arg[0]` value. Moreover, some tests use `loadfile()` instead, so > their argument is adjusted to the full path to the files. >=20 > However, test in creates a temporary file > and executes it via `dofile()` too, so this case is handled by > the second argument -- `prefix` equals an empty string for > current working directory. >=20 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/all.lua | 17 +++++++++++++---- > test/PUC-Lua-5.1-tests/verybig.lua | 4 +++- > 2 files changed, 16 insertions(+), 5 deletions(-) >=20 > diff --git a/test/PUC-Lua-5.1-tests/all.lua = b/test/PUC-Lua-5.1-tests/all.lua > index 8c4afac..85beff8 100755 > --- a/test/PUC-Lua-5.1-tests/all.lua > +++ b/test/PUC-Lua-5.1-tests/all.lua > @@ -58,9 +58,18 @@ end > -- > -- redefine dofile to run files through dump/undump > -- > -dofile =3D function (n) > +-- LuaJIT: Adapt tests for testing with out-of-source build. > +-- XXX: Test in creates a temporary file > +-- and executes it via `dofile()` too, so this case is handled by > +-- the second argument -- `prefix` equals an empty string for > +-- current working directory. > +-- is in the same directory, where are other common > +-- executed files situated. > +local path_to_sources =3D arg[0]:gsub('([^/]+)%.lua$', '') > +dofile =3D function (n, prefix) > + local pr =3D prefix or path_to_sources > showmem() > - local f =3D assert(loadfile(n)) > + local f =3D assert(loadfile(pr..n)) > local b =3D string.dump(f) > f =3D assert(loadstring(b)) > return f() > @@ -77,7 +86,7 @@ do > end > end >=20 > -local f =3D assert(loadfile('gc.lua')) > +local f =3D assert(loadfile(path_to_sources..'gc.lua')) > f() > dofile('db.lua') > assert(dofile('calls.lua') =3D=3D deep and deep) > @@ -88,7 +97,7 @@ assert(dofile('locals.lua') =3D=3D 5) > dofile('constructs.lua') > dofile('code.lua') > do > - local f =3D coroutine.wrap(assert(loadfile('big.lua'))) > + local f =3D = coroutine.wrap(assert(loadfile(path_to_sources..'big.lua'))) > assert(f() =3D=3D 'b') > assert(f() =3D=3D 'a') > end > diff --git a/test/PUC-Lua-5.1-tests/verybig.lua = b/test/PUC-Lua-5.1-tests/verybig.lua > index 59e0142..edb170d 100644 > --- a/test/PUC-Lua-5.1-tests/verybig.lua > +++ b/test/PUC-Lua-5.1-tests/verybig.lua > @@ -93,7 +93,9 @@ for s in string.gmatch(prog, "$([^$]+)") do > if not n then io.write(s) else F[n]() end > end > io.close() > -result =3D dofile(file) > +-- LuaJIT: Adapt test for testing with out-of-source build. > +-- See comment in near `dofile()` redefinition. > +result =3D dofile(file, "") > assert(os.remove(file)) > print'OK' > return result > --=20 > 2.31.0 >=20