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 F2A822B297A; Mon, 27 Feb 2023 13:11:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F2A822B297A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1677492701; bh=nHjNFG1tMQ5fEyoirukH2vHkdGwhwsHyE/jf2Ov5D90=; 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=g5D1Xvk9GkWf6pa40B21Knmztu1m7fIwkbG/0n3HJsCwK9vt7n3jHdR4zUJYKKlA1 Gk/EKvIf9eFwsTorFKIxXvVKE15sejdGX2UxAlsuR0lGc3xKCNN/N9VRXhwAlya+qn zuoJOLlPaGWIgoRpmkq2h7dunbtt++24x+jc3iE4= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 9D6A721C253 for ; Mon, 27 Feb 2023 13:11:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9D6A721C253 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1pWaTq-00012i-RO; Mon, 27 Feb 2023 13:11:39 +0300 Date: Mon, 27 Feb 2023 13:08:02 +0300 To: Igor Munkin Message-ID: References: <23e688af9b21aa37b9b17994655ad78c98dbd951.1677236706.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23e688af9b21aa37b9b17994655ad78c98dbd951.1677236706.git.imun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9806C989EC2150E3379A3C40B9AC0CB6A78DC697FD8BD72D3182A05F538085040F27629BA5D47C43FDD7458007447C6187A47E008E1633C50BB4007AAB376A029 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CCB2BF7EAE70380AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374384886D4B4FC9F18638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8DB5588ADF93D65D44E94535EE065D9F5117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCE287FC2BA681BAD5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735200AC5B80A05675ACD28451B159A507268D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6F7FD1A3A8AE6177F089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3467D08F30473A58429430893EA528BD9E3464994C77EF5B1C8E5660E18FA6490A69C01C57065174101D7E09C32AA3244C64CF40A45CFBBDBAA310AFB3FA48674C64EE5813BBCA3A9DFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojY+HhiuGRi+q6kDOEAJ7QzQ== X-DA7885C5: CE91A8807FCB3403AB747BAA21D5D9E124F10BF67165C577CCBCDD8645DB86BE262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73933AF1F914F131DBF54D64804C7F337EF9949F4E0B9D1403550FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 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: 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, 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.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > index dd02130c..06985dcd 100644 > --- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > +++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.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. > + > diff --git a/test/tarantool-tests/lj-351-print-tostring-number.test.lua b/test/tarantool-tests/lj-351-print-tostring-number.test.lua > index da5b31be..72a9ec2b 100644 > --- a/test/tarantool-tests/lj-351-print-tostring-number.test.lua > +++ b/test/tarantool-tests/lj-351-print-tostring-number.test.lua > diff --git a/test/tarantool-tests/lj-351-print-tostring-number/script.lua b/test/tarantool-tests/lj-351-print-tostring-number/script.lua > new file mode 100644 > index 00000000..c3066f49 > --- /dev/null > +++ b/test/tarantool-tests/lj-351-print-tostring-number/script.lua > diff --git a/test/tarantool-tests/lj-586-debug-non-string-error.test.lua b/test/tarantool-tests/lj-586-debug-non-string-error.test.lua > index f02353fe..dcb730a2 100644 > --- a/test/tarantool-tests/lj-586-debug-non-string-error.test.lua > +++ b/test/tarantool-tests/lj-586-debug-non-string-error.test.lua > diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua > index c46b93f0..3351cc5a 100644 > --- a/test/tarantool-tests/lj-flush-on-trace.test.lua > +++ b/test/tarantool-tests/lj-flush-on-trace.test.lua > 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. > + > 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). > + local cmd = ('