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 ECDD6A72280; Thu, 11 Apr 2024 11:31:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ECDD6A72280 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1712824287; bh=3ROhfF5xVDL2yo+9YHavNKvFVgq9UaorpKzpihkb2O8=; 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=Ut0q0EXt6VxR6TAXS+cwIq0QNRxdxHYNAJh5lF8Oub2ZUkEMOJuViZUlxKYtLLWqQ v7lTdpaHPL1Y9CTlcvhUxjSWra4slKNVoLG6oHjAgl1FV5NLn07soIuY0aVMUp29lJ CjsrRj/BjkWDf9uNTn+B93/QQl5fCeWI+sUz9Anc= Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [95.163.41.82]) (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 330E5A72280 for ; Thu, 11 Apr 2024 11:31:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 330E5A72280 Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1rupq8-00000008SSC-0Uh3; Thu, 11 Apr 2024 11:31:24 +0300 Date: Thu, 11 Apr 2024 11:27:23 +0300 To: Sergey Bronnikov Message-ID: References: <6492e6d3-f18b-411f-b1ab-ba4a16d1b0a0@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6492e6d3-f18b-411f-b1ab-ba4a16d1b0a0@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D327C87852EB66D3B5F9CEDACDA8A376D5C6B368178EF610182A05F5380850404BEC2910B8E3A9B7C7A4B249DE6549FDEFC4B76C25D99561296E264666401CB468D1D63AC827A324 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77603ADE015AF816DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063737452AF4BFD067BF8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89DD9B2A155C052AD43903D950892F42B637432B787E3DB61CC7F00164DA146DAFE8445B8C89999728AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC81D471462564A2E19F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD182BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735BA6625F88748EAEFC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5F253DE4D7D4AA4195002B1117B3ED6962583E6F0633B712D03803A57F48E4E5A823CB91A9FED034534781492E4B8EEAD887A4342A344B6EDBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFE836B69F686DFDCCA01B9E43946EBEA4C32A139E258E7FE71C3843A1C529822FA2F8A0A94712AD9D43A9A4803F78FBB9998FB660E82703C3BEDEEAFC82A3939116B0C4E9D6211EDCC226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioja81YqLNwFplGcaSLyl5TzA== X-DA7885C5: 05F6A80267A8137DF255D290C0D534F92DA7AB25DC9FA4CDEE42429887DD2B74D74DA45C03754C205B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33B16D9C551193ABF623781A01477937E4D7685777FA9C2AA0E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 0/2] Mach-O generation fixes 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: Sergey Bronnikov , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, On 11.04.24, Sergey Bronnikov wrote: > Hi, > > On 08.04.2024 10:47, Sergey Kaplun wrote: > > Hi, Sergey! > > Thanks for the patch set! > > > > I'll proceed with the review according version on the branch: > > > > =================================================================== > >> Subject: [PATCH 1/3] test: introduce a helper read_file > > This patch LGTM, after fixing several nits below. > > > >> The test `lj-366-strtab-correct-size.test.lua` has a test helper > >> `read_file` that reads a file's content and returns it. > >> This helper will be useful for a test upcoming in the next commit, > >> so it is moved to test tools. > > So, missed the ticket mentioning: > > | Needed for tarantool/tarantool#9595 > It is actually not needed for 9595. OK, not insisting. > > > >> --- > >> .../lj-366-strtab-correct-size.test.lua | 10 +--------- > >> test/tarantool-tests/utils/tools.lua | 8 ++++++++ > >> 2 files changed, 9 insertions(+), 9 deletions(-) > >> > >> diff --git a/test/tarantool-tests/lj-366-strtab-correct-size.test.lua b/test/tarantool-tests/lj-366-strtab-correct-size.test.lua > >> index 8a97a441..0bb92da6 100644 > >> --- a/test/tarantool-tests/lj-366-strtab-correct-size.test.lua > >> +++ b/test/tarantool-tests/lj-366-strtab-correct-size.test.lua > >> @@ -138,14 +138,6 @@ local function create_obj_file(name) > >> return elf_filename > >> end > >> > >> --- Reads a file located in a specified path and returns its content. > >> -local function read_file(path) > >> - local file = assert(io.open(path), 'cannot open an object file') > >> - local content = file:read('*a') > >> - file:close() > >> - return content > >> -end > >> - > >> -- Parses a buffer in an ELF format and returns an offset and a size of strtab > >> -- and symtab sections. > >> local function read_elf(elf_content) > >> @@ -172,7 +164,7 @@ end > >> test:plan(3) > >> > >> local elf_filename = create_obj_file(MODULE_NAME) > >> -local elf_content = read_file(elf_filename) > >> +local elf_content = require('utils').tools.read_file(elf_filename) > > Minor: I suggest avoiding the change at this line. > > According to codestyle in other tests, we require helpers separately, > > even if they are used only once. > Where can I read a codestyle guide which you want to follow? This is just a general tradition for all test files. Usually, it is a good thing to do it this way because we don't want to use a lookup for the module every time the function is called. This is not related to your case directly, but if somebody moves this code to the function, he should also change this part anyway. Plus, as a bonus, we will get an earlier failure if the `read_file` module doesn't exist. > > > >> assert(#elf_content ~= 0, 'cannot read an object file') > >> > >> local strtab, symtab = read_elf(elf_content) > >> diff --git a/test/tarantool-tests/utils/tools.lua b/test/tarantool-tests/utils/tools.lua > >> index f35c6922..26b8c08d 100644 > >> --- a/test/tarantool-tests/utils/tools.lua > >> +++ b/test/tarantool-tests/utils/tools.lua > >> @@ -12,4 +12,12 @@ function M.profilename(name) > >> return (arg[0]:gsub('^(.+)/([^/]+)%.test%.lua$', replacepattern)) > >> end > >> > >> +-- Reads a file located in a specified path and returns its content. > > Typo: s/in/at/ > > Everything fine from Quillbot point of view. But I have it, see [1]. Sometimes it freezes, so you should reload the current page. > > > > > >> +function M.read_file(path) > >> + local file = assert(io.open(path), 'cannot open an object file') > >> + local content = file:read('*a') > >> + file:close() > >> + return content > >> +end > >> + > >> return M > >> -- > >> 2.44.0 > > =================================================================== > > [1]: https://ibb.co/XzCPC13 -- Best regards, Sergey Kaplun