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 D9CEB6ECC0; Thu, 16 Dec 2021 18:06:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D9CEB6ECC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1639667177; bh=IXuZXTVinQBZCejEjWL6F6MZO7k5eSKH7zwEiuzV9tE=; 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=pxlOJ6QePQ4E4QygxGWP7G6g0xk1DFsewLT5WGTgwDdhOevY9hk+lS9pxLbYjLvXn RY7MFt5wAekKsX/2J80gt8eJWjSj37n0C9S3hIqxKwe6cd+WdxDnOm1zrt3BMNkAXH puifnY/dj64k+VjsDkQHpqEG8M8RmiIDs+q5bTv0= Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 B7B406ECC0 for ; Thu, 16 Dec 2021 18:06:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B7B406ECC0 Received: by smtp17.mail.ru with esmtpa (envelope-from ) id 1mxsKk-0008O4-KX; Thu, 16 Dec 2021 18:06:15 +0300 Date: Thu, 16 Dec 2021 18:04:25 +0300 To: Maxim Kokryashkin Message-ID: References: <20211013155500.2639254-1-m.kokryashkin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013155500.2639254-1-m.kokryashkin@tarantool.org> X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9FFF274446F725B74E2F491ACE130867A35CF0AA67CC42EA9182A05F538085040F41BE227C3B062C87464FA8D85AC3CB1447A4594F8AFBA2388EAA99EA017DB93 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE712EB008F780777E9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063779018AFA06A12C538638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8FC910D234496ABE072C441E1B338D6EE117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6753C3A5E0A5AB5B7089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5A6A4EDDCE3FD417A908804EEB6935608F62C4F427740AE64D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA759D2A03B9C34326B3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3444047AE358B40754FAF194E6B75CD92C0BBCFE471A15B15E7CBE5624049D77BD77D0E624D671EACC1D7E09C32AA3244CB12BD4CD2B34572B5B21F2C04DA60F6930452B15D76AEC1483B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojwI6cKrhU01IMNJqcACjnnw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4D2423FFD459FDFC3043AFBF3370763927F7019A35B9DBA63F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A84198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2] test: adapt disabled tests from PUC-Rio 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, Maxim! Thanks for the fixes! LGTM, except a few nits below. On 13.10.21, Maxim Kokryashkin wrote: > Version and status are printed in stdout instead stderr > since LuaJIT-2.0.0-beta11 (as it is not an error message). This behavior > is the same as in Lua 5.2, so necessary changes in tests can be > adapted from PUC-Rio Lua 5.2 test suite. > > However, those tests are disabled for Tarantool since its interactive > shell doesn't support '=' at the beginning of statements. > Here is an example: OK, so maybe we should create a ticket for that (and _PROMPT feature)? At least to mention it and wait for thumbs up. Igor, thoughts? > ======================================================================== Nit: it's better to use "|" for quoting in commit messages (I use "===" only for separate iterative diff from the rest part of the mail). See git log 77c4a0747693a2a27745616894943746548df875 for example. But it's just my recommendation.:) Feel free to ignore. > $ luajit > > = (6*2-6) -- === > 6 > > $ tarantool > tarantool> = (6*2-6) -- === > --- > - error: ' (6*2-6) -- ===:1: unexpected symbol near ''=''' > ... > ======================================================================== > > Part of tarantool/tarantool#5870 > --- > Changes in v2: > - Fixed comments as per review by Sergey > - Disabled some tests for Tarantool > - Added link to CI jobs > > Issue: https://github.com/tarantool/tarantool/issues/5687 > Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5687-adapt-tests-output-PUC-Rio > CI: https://github.com/tarantool/tarantool/tree/fckxorg/gh-5687-adapt-disabled-tests-from-PUC-Rio > > test/PUC-Rio-Lua-5.1-tests/main.lua | 97 ++++++++++++++++++++--------- > 1 file changed, 66 insertions(+), 31 deletions(-) > > diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua > index 07facc4c..38111560 100644 > --- a/test/PUC-Rio-Lua-5.1-tests/main.lua > +++ b/test/PUC-Rio-Lua-5.1-tests/main.lua > @@ -24,11 +24,33 @@ local prepfile = function (s, p) > assert(io.close()) > end > > -function checkout (s) > +-- Taken from PUC-Rio Lua 5.2 test suite. > +-- See comment for checkprogout(). > +function getoutput () > io.input(out) > local t = io.read("*a") > io.input():close() > assert(os.remove(out)) > + return t > +end > + > +-- Version and status are printed in stdout instead stderr since > +-- LuaJIT-2.0.0-beta11 (as it is not an error message). > +-- See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735 > +-- (Print version and JIT status to stdout, not stderr.). > +-- This behavior is the same as in Lua 5.2. > +-- See also https://github.com/tarantool/tarantool/issues/5687. > +-- This function is adapted from PUC-Rio Lua 5.2 test suite. > +-- It is used for test commands with -i flag. > +function checkprogout (s) > + local t = getoutput() > + for line in string.gmatch(s, ".-\n") do > + assert(string.find(t, line, 1, true)) > + end > +end > + > +function checkout (s) > + local t = getoutput() > if s ~= t then print(string.format("'%s' - '%s'\n", s, t)) end > assert(s == t) > return t > @@ -117,39 +139,52 @@ prepfile[[ > RUN("lua - < %s > %s", prog, out) > checkout("1\tnil\n") > > --- FIXME: Version and status are printed to stdout instead of > --- stderr since LuaJIT-2.0.0-beta11 (as it is not an error > --- message). See commit 0bd1a66f2f055211ef55834ccebca3b82d03c735 > --- (Print version and JIT status to stdout, not stderr.). > --- This behavior is the same as in Lua 5.2. > --- In Lua 5.2 this feature was introduced via commit > --- 9e7de9473c65baee1f567852a778f2d33a47ea83. > --- See also https://github.com/tarantool/tarantool/issues/5687. > -prepfile[[ > +-- FIXME: The following chunk is disabled for Tarantool since its interactive > +-- shell doesn't support '=' at the beginning of statements. > +-- Here is an example: Minor: linewidth for comments is 66 symbols. (Ignorable for comment with word-for-word quotes below.) > +-- $ luajit > +-- LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/ > +-- JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse > +-- > = (6*2-6) -- === > +-- 6 > + > +-- $ tarantool > +-- Tarantool 2.10.0-beta1-80-g201905544 > +-- type 'help' for interactive help > +-- tarantool> = (6*2-6) -- === > +-- --- > +-- - error: ' (6*2-6) -- ===:1: unexpected symbol near ''=''' > +-- ... > +if not _TARANTOOL then Side note: like this solution much more than just comment out this chunk! > +-- Test is adapted from PUC-Rio Lua 5.2 test suite. > +-- See comment for checkprogout(). > + prepfile[[ > = (6*2-6) -- === > a > = 10 > print(a) > = a]] > --- FIXME: Behavior is different for LuaJIT. See the comment above. > --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) > --- checkout("6\n10\n10\n\n") > - > -prepfile("a = [[b\nc\nd\ne]]\n=a") > -print(prog) > --- FIXME: Behavior is different for LuaJIT. See the comment above. > --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) > --- checkout("b\nc\nd\ne\n\n") > - > -prompt = "alo" > -prepfile[[ -- > + RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) > + checkprogout("6\n10\n10\n\n") > + > +-- Test is adapted from PUC-Rio Lua 5.2 test suite. > +-- See comment for checkprogout(). > + prepfile("a = [[b\nc\nd\ne]]\n=a") > + print(prog) > + RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) > + checkprogout("b\nc\nd\ne\n\n") > + > +-- Test is adapted from PUC-Rio Lua 5.2 test suite. > +-- See comment for checkprogout(). > + prompt = "alo" > + prepfile[[ -- > a = 2 > ]] > --- FIXME: Behavior is different for LuaJIT. See the comment above. > --- RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out) > --- checkout(string.rep(prompt, 3).."\n") > + RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out) > + local t = getoutput() > + assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt)) > > -s = [=[ -- > + s = [=[ -- > function f ( x ) > local a = [[ > xuxu > @@ -163,11 +198,11 @@ end > =( f( 10 ) ) > assert( a == b ) > =f( 11 ) ]=] > -s = string.gsub(s, ' ', '\n\n') > -prepfile(s) > --- FIXME: Behavior is different for LuaJIT. See the comment above. > --- RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) > --- checkout("11\n1\t2\n\n") > + s = string.gsub(s, ' ', '\n\n') > + prepfile(s) > + RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) > + checkprogout("11\n1\t2\n\n") > +end It's nothing bad in commenting "-- not _TARANTOOL" for this `end`. Feel free to ignore. > > prepfile[[#comment in 1st line without \n at the end]] > RUN("lua %s", prog) > -- > 2.33.0 > -- Best regards, Sergey Kaplun