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 3A6216EC56; Sat, 13 Mar 2021 22:07:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3A6216EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615662427; bh=eGPFHvDfL1CCEd48CJ56GLv9546cs/7w9gQ/Q8vTQTU=; 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=ILJkQvnlfCqJKHU6yC3C6sVm/IQydIIPz0AUUFCHWKL7enlcpSliFezSiGc1agdsi V7wfmAD2oHrFDc8Ih8peA/aZWD9erX+c1OgfUEDLSaF2Bfx+TdhzE2UTLacLIKSFEH Ih/LG3Jb709mT1yuGxdfuc42yggip8TLuWRedWoQ= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 747F46EC56 for ; Sat, 13 Mar 2021 22:07:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 747F46EC56 Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1lL9bN-0006oE-K6; Sat, 13 Mar 2021 22:07:06 +0300 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: <054383ce45cad544e65b12df1af9320b5f999f73.1615472551.git.skaplun@tarantool.org> Date: Sat, 13 Mar 2021 22:07:05 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <054383ce45cad544e65b12df1af9320b5f999f73.1615472551.git.skaplun@tarantool.org> To: Sergey Kaplun X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69BD3280B63F8A20CED6D6453DBFA9511E900894C459B0CD1B9BD99D45C179A8C49797F7C1E28662254D87364BE715B8F5845EDA4033ED105E6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE798E808258C20928CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371758572763D318798638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD5049B5B6C7ECD313550AD98D0AE8047E44A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C317B107DEF921CE79117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C2249045A9A90E9EED90B089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7CA819EB9AE8EA3DE343847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FDCD13837A2BCF0203C9F3DD0FB1AF5EB4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E923155C0AF1600DCBC20B6B58427014E5D533A2C0F2BFDEEEBCEE X-C1DE0DAB: 0D63561A33F958A526C9D9DBF523234A91CECFDBCF2A5ED2A2B909E05F40616CD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340297C696F996E384061EC910FC623B8E7E6E405430425B504DA98DC8FC454B5B0A9435F5310116A31D7E09C32AA3244CE3DD8E71082DC6E9F1EAEBC0F825892DCE0B41342B755BCDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj510EsIhvqdmetH9A8OXP7g== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81E1ACCC92925FFBBFA3F1B125FEFA1F0057B46B90E34C11C6DAD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 3/3] test: adapt Lua 5.1 test suite for Tarantool 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" Hi! Thanks for the patch! LGTM. Sergos. > On 12 Mar 2021, at 08:36, Sergey Kaplun wrote: >=20 > In some insignificant details Tarantool's behaviour is not the same > as the behaviour of Lua 5.1. >=20 > `progname` is not edged by '"' to be able run other test suites. >=20 > Tests in the following files are disabled with corresponding comments: > * gc.lua > * main.lua > * pm.lua >=20 > See full list of disabled tests to adapt in > https://github.com/tarantool/tarantool/issues/5870. >=20 > Tests in the following files are adapted for testing with Tarantool's > out-of-source build: > * all.lua > * verybig.lua >=20 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/CMakeLists.txt | 3 +++ > test/PUC-Lua-5.1-tests/all.lua | 16 ++++++++++++---- > test/PUC-Lua-5.1-tests/gc.lua | 9 ++++++--- > test/PUC-Lua-5.1-tests/main.lua | 24 +++++++++++++++++------- > test/PUC-Lua-5.1-tests/pm.lua | 6 +++++- > test/PUC-Lua-5.1-tests/verybig.lua | 4 +++- > 6 files changed, 46 insertions(+), 16 deletions(-) >=20 > diff --git a/test/PUC-Lua-5.1-tests/CMakeLists.txt = b/test/PUC-Lua-5.1-tests/CMakeLists.txt > index 08bee36..1249cab 100644 > --- a/test/PUC-Lua-5.1-tests/CMakeLists.txt > +++ b/test/PUC-Lua-5.1-tests/CMakeLists.txt > @@ -82,6 +82,9 @@ add_custom_command(TARGET PUC-Lua-5.1-tests > # LUA_INIT=3D"package.path=3D'?\;'..package.path" > # So use less preferable way for tests. > LUA_PATH=3D"${LUA_PATH}\;\;" > + # XXX: Adapt to run test on readonly file systems > + # with loadfile(CUR_SOURCE_DIR..filename). > + CUR_SOURCE_DIR=3D${CMAKE_CURRENT_SOURCE_DIR} > ${LUAJIT_TEST_COMMAND} ${TEST_RUNNER} > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > ) > diff --git a/test/PUC-Lua-5.1-tests/all.lua = b/test/PUC-Lua-5.1-tests/all.lua > index 8c4afac..52a6235 100755 > --- a/test/PUC-Lua-5.1-tests/all.lua > +++ b/test/PUC-Lua-5.1-tests/all.lua > @@ -58,9 +58,13 @@ end > -- > -- redefine dofile to run files through dump/undump > -- > -dofile =3D function (n) > +-- Adapt test for testing with Tarantool's out-of-source build > +-- on read only file system. CUR_SOURCE_DIR is set via CMake. > +local path_to_sources =3D os.getenv('CUR_SOURCE_DIR')..'/' > +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 +81,9 @@ do > end > end >=20 > -local f =3D assert(loadfile('gc.lua')) > +-- Adapt test for testing with Tarantool's out-of-source build > +-- on read only file system. > +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 +94,9 @@ assert(dofile('locals.lua') =3D=3D 5) > dofile('constructs.lua') > dofile('code.lua') > do > - local f =3D coroutine.wrap(assert(loadfile('big.lua'))) > + -- Adapt test for testing with Tarantool's out-of-source build > + -- on read only file system. > + 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/gc.lua = b/test/PUC-Lua-5.1-tests/gc.lua > index b767104..6c4097a 100644 > --- a/test/PUC-Lua-5.1-tests/gc.lua > +++ b/test/PUC-Lua-5.1-tests/gc.lua > @@ -128,9 +128,12 @@ do > local a =3D {} > until gcinfo() > 1000 > collectgarbage"restart" > - repeat > - local a =3D {} > - until gcinfo() < 1000 > + -- Tarantool has too much objects at start. > + -- gcinfo() is always greater than 1000. > + -- Test is disabled for Tarantool binary. > + -- repeat > + -- local a =3D {} > + -- until gcinfo() < 1000 > end >=20 > lim =3D 15 > diff --git a/test/PUC-Lua-5.1-tests/main.lua = b/test/PUC-Lua-5.1-tests/main.lua > index 12f3981..69eb5db 100644 > --- a/test/PUC-Lua-5.1-tests/main.lua > +++ b/test/PUC-Lua-5.1-tests/main.lua > @@ -11,7 +11,7 @@ out =3D os.tmpname() > do > local i =3D 0 > while arg[i] do i=3Di-1 end > - progname =3D '"'..arg[i+1]..'"' > + progname =3D arg[i+1] > end > print(progname) >=20 > @@ -50,8 +50,10 @@ end > -- test 2 files > prepfile("print(1); a=3D2") > prepfile("print(a)", otherprog) > -RUN("lua -l %s -l%s -lstring -l io %s > %s", prog, otherprog, = otherprog, out) > -checkout("1\n2\n2\n") > +-- Test is disabled for Tarantool binary. > +-- See https://github.com/tarantool/tarantool/issues/5747. > +-- RUN("lua -l %s -l%s -lstring -l io %s > %s", prog, otherprog, = otherprog, out) > +-- checkout("1\n2\n2\n") >=20 > local a =3D [[ > assert(table.getn(arg) =3D=3D 3 and arg[1] =3D=3D 'a' and > @@ -63,7 +65,10 @@ local a =3D [[ > ]] > a =3D string.format(a, progname) > prepfile(a) > -RUN('lua "-e " -- %s a b c', prog) > +-- Tarantool has different command line argument parsing. > +-- For example it always set itself as arg[-1]. > +-- Test is disabled for Tarantool binary. > +-- RUN('lua "-e " -- %s a b c', prog) >=20 > -- test 'arg' availability in libraries > -- LuaJIT v2.1.0-beta3 has extension from Lua 5.3: > @@ -85,8 +90,10 @@ prepfile[[print(({...})[30])]] > RUN("lua %s %s > %s", prog, string.rep(" a", 30), out) > checkout("a\n") >=20 > -RUN([[lua "-eprint(1)" -ea=3D3 -e "print(a)" > %s]], out) > -checkout("1\n3\n") > +-- Test is disabled for Tarantool binary. > +-- See https://github.com/tarantool/tarantool/issues/5747. > +-- RUN([[lua "-eprint(1)" -ea=3D3 -e "print(a)" > %s]], out) > +-- checkout("1\n3\n") >=20 > prepfile[[ > print( > @@ -177,7 +184,10 @@ assert(not os.remove(out)) >=20 > RUN("lua -v") >=20 > -NoRun("lua -h") > +-- Tarantool returns zero status at exit with -h option, unlike > +-- Lua does. > +-- Test is disabled for Tarantool binary. > +-- NoRun("lua -h") > NoRun("lua -e") > NoRun("lua -e a") > NoRun("lua -f") > diff --git a/test/PUC-Lua-5.1-tests/pm.lua = b/test/PUC-Lua-5.1-tests/pm.lua > index 366a31c..6e1b403 100644 > --- a/test/PUC-Lua-5.1-tests/pm.lua > +++ b/test/PUC-Lua-5.1-tests/pm.lua > @@ -207,7 +207,11 @@ function rev (s) > end >=20 > local x =3D string.rep('012345', 10) > -assert(rev(rev(x)) =3D=3D x) > +-- The first Tarantool's fiber has only 512Kb of stack. > +-- It is not enough for this recursive call. > +-- See also https://github.com/tarantool/tarantool/issues/5782. > +-- Test is disabled for Tarantool binary. > +-- assert(rev(rev(x)) =3D=3D x) >=20 >=20 > -- gsub with tables > diff --git a/test/PUC-Lua-5.1-tests/verybig.lua = b/test/PUC-Lua-5.1-tests/verybig.lua > index 59e0142..bfb95df 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) > +-- Adapt test for testing with Tarantool's out-of-source build > +-- on read only file system. > +result =3D dofile(file, "") > assert(os.remove(file)) > print'OK' > return result > --=20 > 2.28.0 >=20