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 71AACA6A7C1; Thu, 1 Feb 2024 19:06:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 71AACA6A7C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706803600; bh=eSmGm5Lq8JExQgFyV1WN5LP7jmTDMW8w4XtG3Qu4pBc=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=j5URKBP5aCNmmvEbzoQdOUdZiimbuQb8bDJRUsoEFrym5QcBbfwo+9c7Km0lSbudF bevhhfHrw74xrJLoK16H2fwOgvYsVMVtm+z3kAYWF3gb0Dm/bySPFjixsD+C+4aHbY C4r08VB9+MAx/QztiMrljLDoEcE0R0qlQrx9tiiA= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [95.163.41.83]) (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 2A869A6A7C2 for ; Thu, 1 Feb 2024 19:06:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2A869A6A7C2 Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1rVZaI-00000008ERF-228s; Thu, 01 Feb 2024 19:06:38 +0300 Message-ID: Date: Thu, 1 Feb 2024 19:06:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <4d80dfc5a12d8e7d0ca668432543a9241dd58017.1706520765.git.skaplun@tarantool.org> In-Reply-To: <4d80dfc5a12d8e7d0ca668432543a9241dd58017.1706520765.git.skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9010253A383FA2A7558E71ABFCCB10C0F849C87377FFEB849182A05F538085040EF9FC0C7268CCE12C7A4B249DE6549FDA48249A6E80DB18CBBCBD0CDED06F3521BB5EE8A55BF1B9C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71D6E7AC8529A326CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D19071B5A26B4BDC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B0C4322121E142BECAACB8C2FAD8071397774A3E17738EC5CC7F00164DA146DAFE8445B8C89999728AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC81D471462564A2E19F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C632EDEA9CD5989A39735652A29929C6C4AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C31DA0D137B259B101BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFE478A468B35FE7671DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3E83E68DE7309FD8D35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A51C88E3BF1FBF30AF5002B1117B3ED6963C54FC5F48AEC6D6B91D2EB2DEE3878C823CB91A9FED034534781492E4B8EEAD329DC2EF12373DEABDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF2685095F5CEC6CD6F6A89C14705BFEC719845BE956E2AD626352E75E1EB811AB2A6269F78606922FBAF4CF3B87E910B16A22C6AB450DE19F0BF2FF6D33C6E18E133D2A45920D1D8D5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKdLLj0Q7SP+gOBSRN2uHmQ== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458CD6C3E70786219CA81508210FEB0A3EAD45115A12B8C2AA5DFE141BD10D5BB75645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 09/26] test: enable in LuaJIT-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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey thanks for the patch! LGTM after renaming test On 1/29/24 13:45, Sergey Kaplun wrote: > This patch changes `dofile()` (which uses an unreliable relative file > path and mutates `_G` with global functions to be defined) to the > corresponding require and renames the C library in the `require()` call. > It adds groups with the names of subtests and enables the test in > . It renames structure and enum typedefs to avoid conflicts with > cdef in other tests. The GC threshold is increased since all tests run > in a single process, so the number of GC objects is greater. > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/lib/ffi/ffi_convert.lua | 35 +++++++++++------------ > test/LuaJIT-tests/lib/ffi/index | 1 + > 2 files changed, 18 insertions(+), 18 deletions(-) > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_convert.lua b/test/LuaJIT-tests/lib/ffi/ffi_convert.lua > index bd3fb1f9..284f2b53 100644 > --- a/test/LuaJIT-tests/lib/ffi/ffi_convert.lua > +++ b/test/LuaJIT-tests/lib/ffi/ffi_convert.lua > @@ -1,8 +1,7 @@ > local ffi = require("ffi") > > -local ctest = require("ctest") > - > -dofile("../common/ffi_util.inc") > +local ctest = require("libctest") > +local fails = require("common.fails") > > local tonumber = tonumber > > @@ -32,15 +31,15 @@ typedef struct arrinc_t { > int a[]; > } arrinc_t; > > -typedef enum uenum_t { > +typedef enum uenum_convert_t { > UE0, UE71 = 71, UE72 > -} uenum_t; > +} uenum_convert_t; > > -typedef enum ienum_t { > +typedef enum ienum_convert_t { > IE0, IEM12 = -12, IEM11 > -} ienum_t; > +} ienum_convert_t; > > -typedef struct foo_t { > +typedef struct foo_convert_t { > bool b; > int8_t i8; > uint8_t u8; > @@ -79,9 +78,9 @@ typedef struct foo_t { > int si_guard; > nest_t sn; > uni_t ui; > - uenum_t ue; > - ienum_t ie; > -} foo_t; > + uenum_convert_t ue; > + ienum_convert_t ie; > +} foo_convert_t; > > char *strcpy(char *dest, const char *src); > typedef struct FILE FILE; > @@ -89,11 +88,11 @@ int fileno(FILE *stream); > int _fileno(FILE *stream); > ]] > > -do > - local foo_t = ffi.typeof("foo_t") > - local sz = ffi.sizeof(foo_t) > - local x = foo_t() > - local y = foo_t() > +do --- misc > + local foo_convert_t = ffi.typeof("foo_convert_t") > + local sz = ffi.sizeof(foo_convert_t) > + local x = foo_convert_t() > + local y = foo_convert_t() > ffi.fill(x, sz, 0xff) > ffi.fill(y, sz, 0xee) > > @@ -769,7 +768,7 @@ do > x.ppf = ffi.C.strcpy > end > > -do > +do --- GC cdata __index > collectgarbage() > local oc = collectgarbage("count") > local cd = ffi.new"struct { struct { int a; } x;}" > @@ -780,7 +779,7 @@ do > for i=1,2 do > f(cd) > local nc = collectgarbage("count") > - assert(nc < oc + 200, "GC step missing for cdata __index") > + assert(nc < oc * 3, "GC step missing for cdata __index") > jit.off(f) > end > end > diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index > index 0a72daed..5c2be87f 100644 > --- a/test/LuaJIT-tests/lib/ffi/index > +++ b/test/LuaJIT-tests/lib/ffi/index > @@ -7,6 +7,7 @@ ffi_bitfield.lua > ffi_call.lua > ffi_callback.lua > ffi_const.lua > +ffi_convert.lua > istype.lua > jit_array.lua > jit_complex.lua