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 59DB057A520; Sun, 25 Feb 2024 14:38:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 59DB057A520 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1708861082; bh=QVObLKU9FlBGWKz9YDHfVtQQU1yTB5q1R0zRBAi+2eE=; 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=ESTMmmBS2mfv3INmYnIHzTjubUHzBAa2cLHKfK2V7TqhMQ1mN5MeVpukJk0mKm9ny XHvwUFPA+HujCDoiTe8VfZwJNnrB2IepAyqSyyyaS9ucIz3OVtSI8WZHlJSbALagaS YcOQpOtbzDkYIW3GSja8v2xuZa7/HSoAV7oKn9Ow= Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [95.163.41.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8F7C557A520 for ; Sun, 25 Feb 2024 14:38:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8F7C557A520 Received: by smtp36.i.mail.ru with esmtpa (envelope-from ) id 1reCpT-00000008Px4-3K5D; Sun, 25 Feb 2024 14:38:00 +0300 Date: Sun, 25 Feb 2024 14:37:59 +0300 To: Igor Munkin Message-ID: References: <24af2ffde3f76e954582ae298a6ed5b5262d74d5.1708856482.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24af2ffde3f76e954582ae298a6ed5b5262d74d5.1708856482.git.imun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD90B4B6FE9E606E4968A204394411ABF4F7845DBB17EFD739800894C459B0CD1B9F51D28480AC718D1F7F1B09466A47372CFD6DCAEED47C89CE8718E579D634D612890F9C47E136152 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70312E9A300D47E3BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D8FE4B420C2EEC248638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D09F8B9E6C095E3308C204A2F51E7CE5C5D786B3CAED7960CC7F00164DA146DAFE8445B8C89999728AA50765F790063741F7343E26298569389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC878444BBB7636F62AF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CAD74539164518AE5C0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C38C3FA5C133757E88BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFE478A468B35FE7671DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C309A7649CC036878F35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5121AD610E008ADD65002B1117B3ED696615A1B685408D81F3E67C18142C611B7823CB91A9FED034534781492E4B8EEADD0953842B444AAC3BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF7AED772BE45551D263037FC886BCF754060097532FA5CCB3514E68B4321DC278D9E67331CBA3B6E4A653534C7294CACC5DA7EC435E312A834CF8538A1B111F0A8450919CC43A33B45F4332CA8FE04980913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojhcsd5OwWmohtS2Wl6c94aw== X-Mailru-Sender: 7940E2A4EB16C9970E7603824FE97C20F51D28480AC718D1F7F1B09466A473722DA78E80D91D17D4B6F7D78CE1F58EAD61AD1BC23DFB21333DDE9B364B0DF289BB83A8C3DAEBA78A61AAEF30F77CACB9EAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] test: introduce routine to build error message 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Igor! Thanks for the patch! LGTM, except for a few comments below. On Sun, Feb 25, 2024 at 10:41:06AM +0000, Igor Munkin wrote: > LuaJIT modules yields the plain errors, but LuaJIT binary adds 'luajit:' Typo: s/yields/yield/ > prefix to it, so 411-luajit.t test in lua-Harness suite expects the > error message with the aforementioned prefix in the corresponding > assertions. At the same time, Tarantool prepends nothing to the error Typo: s/prepends/adds/ Or, alternatively, you can say: | Tarantool doesn't prepend errors produced by the LuaJIT module with | anything. > produced by LuaJIT module. Typo: s/LuaJIT/the LuaJIT/ > > To tweak the pattern to be used within the 411-luajit.t chunk, the > auxiliary error building function is introduced in this patch. > > Signed-off-by: Igor Munkin > --- > test/lua-Harness-tests/411-luajit.t | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/test/lua-Harness-tests/411-luajit.t b/test/lua-Harness-tests/411-luajit.t > index 6cfd6837..1b2da729 100755 > --- a/test/lua-Harness-tests/411-luajit.t > +++ b/test/lua-Harness-tests/411-luajit.t > @@ -31,6 +31,15 @@ if not jit or ujit or _TARANTOOL then > skip_all("only with LuaJIT") > end > > +-- XXX: Unfortunately, Lua patterns do not support optional > +-- capture groups, so the helper below implements poor man's > +-- optional capture groups for the patters matching LuaJIT CLI Typo: s/patters/patterns/ > +-- error messages. > +local function errbuild(message) > + local eprefix = _TARANTOOL and "" or "[^:]+: " IMO, `errprefix` or `err_prefix` would be better. Feel free to ignore, though. > + return table.concat({"^", eprefix, message}) > +end > + > local lua = _retrieve_progname() > > if not pcall(io.popen, lua .. [[ -e "a=1"]]) then > @@ -158,13 +167,13 @@ f = io.popen(cmd) > if compiled_with_jit then > equals(f:read'*l', 'Hello World', "-jon") > else > - matches(f:read'*l', "^[^:]+: JIT compiler permanently disabled by build option", "no jit") > + matches(f:read'*l', errbuild("JIT compiler permanently disabled by build option"), "no jit") > end > f:close() > > cmd = lua .. " -j bad hello-411.lua 2>&1" > f = io.popen(cmd) > -matches(f:read'*l', "^[^:]+: unknown luaJIT command or jit%.%* modules not installed", "-j bad") > +matches(f:read'*l', errbuild("unknown luaJIT command or jit%.%* modules not installed"), "-j bad") > f:close() > > if compiled_with_jit then > @@ -190,12 +199,12 @@ if compiled_with_jit then > > cmd = lua .. " -O+bad hello-411.lua 2>&1" > f = io.popen(cmd) > - matches(f:read'*l', "^[^:]+: unknown or malformed optimization flag '%+bad'", "-O+bad") > + matches(f:read'*l', errbuild("unknown or malformed optimization flag '%+bad'"), "-O+bad") > f:close() > else > cmd = lua .. " -O0 hello-411.lua 2>&1" > f = io.popen(cmd) > - matches(f:read'*l', "^[^:]+: attempt to index a nil value") > + matches(f:read'*l', errbuild("attempt to index a nil value")) > f:close() > end > > -- > 2.39.2 >