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 0D6AD2F0E58; Mon, 27 Feb 2023 21:07:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0D6AD2F0E58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1677521222; bh=bZIPmfdlFutaLzxtZQ4YL5JIFB++AR3aLHKyjukXqkk=; 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=DR7NrUjGQ5ZwFG3/C851d+8HRvZCidIkDgWumj3XvdlzCOn44EQZLUUBM8lNaMzNB pCIJzKz7IISyvTgO1e8WaJEkCj8rvzrNIdpdPEtfFk9sDMlsGR/8l6j0IXcSPBLwFG EDlnog1CE+RnGFd9B4WmTJ09yas1TNk/DmTckeHw= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 773202634FA for ; Mon, 27 Feb 2023 21:07:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 773202634FA Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1pWhtr-009sfZ-G7; Mon, 27 Feb 2023 21:07:00 +0300 Date: Mon, 27 Feb 2023 18:04:16 +0000 To: Sergey Kaplun Message-ID: References: <23e688af9b21aa37b9b17994655ad78c98dbd951.1677236706.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C9F4FFC1944D2347B7AA12E9F0993BE3DB2FE61C40C3BAF1182A05F5380850401AA5AEFDF04792A7A44B76B56493DDA633AC301DAEAD934B8310268F44413416 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E439DB85B4CC0F53EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D19071B5A26B4BDC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D873A5E24CE90B32520A99C67EB48E8892117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCD215BE4436AF2686A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B28585415E75ADA96FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEFAD5A440E159F97D9F804269016115C9D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3F8BD4E506CFA3D88C0837EA9F3D19764C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637A7EFCB0EB5ACB161EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: 1B70FBA5C9BEEE72C9761FC34675ADEB871C96603B655635EE9D5CB6078CC77C8116171A0311DA1B135824B3FEAB4495 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D341E08D7EE1804B763D07B26D23D6F7C6DA0B238CD20144D92A2F7B46C88C0408A4B148DEBD68DBCE31D7E09C32AA3244CD91F75DEC6B42AF42CA88E3456A8DB29F94338140B71B8EE927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojVEzEzQLXHiYyD8O/bqTGkA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D5315C7CEC0D8C0996639A13B70C401D3F58D1935B962FAFAE062326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/5] test: stop using utils.selfrun in tests 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 your review! See my answes below. On 27.02.23, Sergey Kaplun wrote: > Hi, Igor! > Thanks for the fixes! > LGTM, just a few minor nits below. > > On 27.02.23, Igor Munkin wrote: > > Unfortunately, is too complex to be maintained, so the > > corresponding tests are split into two files: the test itself and the > > script to be run by the test. As a result of the patch > > helper is introduced: it inherits some approaches from , > > but it's considered for more general use. > > > > Signed-off-by: Igor Munkin > > --- > > .../gh-4427-ffi-sandwich.test.lua | 88 +++++++++++-------- > > .../gh-4427-ffi-sandwich/script.lua | 25 ++++++ > > .../lj-351-print-tostring-number.test.lua | 34 +++---- > > .../lj-351-print-tostring-number/script.lua | 9 ++ > > .../lj-586-debug-non-string-error.test.lua | 2 +- > > .../lj-flush-on-trace.test.lua | 87 ++++++++++-------- > > .../lj-flush-on-trace/script.lua | 23 +++++ > > test/tarantool-tests/utils.lua | 80 +++++++---------- > > 8 files changed, 200 insertions(+), 148 deletions(-) > > create mode 100644 test/tarantool-tests/gh-4427-ffi-sandwich/script.lua > > create mode 100644 test/tarantool-tests/lj-351-print-tostring-number/script.lua > > create mode 100644 test/tarantool-tests/lj-flush-on-trace/script.lua > > > > diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua b/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua > > new file mode 100644 > > index 00000000..9ecd964e > > --- /dev/null > > +++ b/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua > > > > > +jit.opt.start("3", string.format("hotloop=%d", hotloop)) > > Do we need set level 3 direct here? > Also, I suggest to use single quotes according to our coding style in > tests. I don't remember, so removed. Quotes are fixed. The diff is below: ================================================================================ diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua b/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua index 9ecd964e..a7445e92 100644 --- a/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua +++ b/test/tarantool-tests/gh-4427-ffi-sandwich/script.lua @@ -14,7 +14,7 @@ local sandwich = require('libsandwich')(trigger) -- * if trigger <= hotloop -> trace recording is aborted -- * if trigger > hotloop -> trace is recorded but execution -- leads to panic -jit.opt.start("3", string.format("hotloop=%d", hotloop)) +jit.opt.start(string.format('hotloop=%d', hotloop)) local res for i = 0, hotloop + trigger do ================================================================================ > > > + > > diff --git a/test/tarantool-tests/lj-flush-on-trace/script.lua b/test/tarantool-tests/lj-flush-on-trace/script.lua > > new file mode 100644 > > index 00000000..d2c35534 > > --- /dev/null > > +++ b/test/tarantool-tests/lj-flush-on-trace/script.lua > > > > > +jit.opt.start("3", string.format("hotloop=%d", hotloop)) > > Do we need set level 3 direct here? > Also, I suggest to use single quotes according to our coding style in > tests. Ditto. ================================================================================ diff --git a/test/tarantool-tests/lj-flush-on-trace/script.lua b/test/tarantool-tests/lj-flush-on-trace/script.lua index d2c35534..d25c4a33 100644 --- a/test/tarantool-tests/lj-flush-on-trace/script.lua +++ b/test/tarantool-tests/lj-flush-on-trace/script.lua @@ -14,7 +14,7 @@ local flush = require('libflush')(trigger) -- * if trigger <= hotloop -> trace recording is aborted -- * if trigger > hotloop -> trace is recorded but execution -- leads to panic -jit.opt.start("3", string.format("hotloop=%d", hotloop)) +jit.opt.start(string.format('hotloop=%d', hotloop)) for i = 0, trigger + hotloop do ffiflush.flush(flush, i) ================================================================================ > > > + > > > > > diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua > > index eb11d40d..8355149b 100644 > > --- a/test/tarantool-tests/utils.lua > > +++ b/test/tarantool-tests/utils.lua > > > > > + SCRIPT = opts and opts.script or arg[0]:gsub('%.test%.lua$', '/script.lua'), > > + ENV = opts and makeenv(opts.env) or '', > > + REDIRECT = opts and opts.redirect or '', > > + }, { > > + __call = function(self, ...) > > + -- This line just makes the command for by the > > + -- following steps: > > + -- 1. Replace the placeholders with the corresponding values > > + -- given to the command constructor (e.g. script, env) > > + -- 2. Join all CLI arguments given to the __call metamethod > > + -- 3. Concatenate the results of step 1 and step 2 to obtain > > + -- the resulting command. > > Extra dot at the end of the sentence (or missing dots for previous > bullets). Thanks, fixed! The diff is below: ================================================================================ diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua index 83716bb3..8c1538d6 100644 --- a/test/tarantool-tests/utils.lua +++ b/test/tarantool-tests/utils.lua @@ -68,8 +68,8 @@ function M.makecmd(arg, opts) -- This line just makes the command for by the -- following steps: -- 1. Replace the placeholders with the corresponding values - -- given to the command constructor (e.g. script, env) - -- 2. Join all CLI arguments given to the __call metamethod + -- given to the command constructor (e.g. script, env). + -- 2. Join all CLI arguments given to the __call metamethod. -- 3. Concatenate the results of step 1 and step 2 to obtain -- the resulting command. local cmd = ('