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 13466A6A7F3; Thu, 1 Feb 2024 19:19:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 13466A6A7F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706804364; 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=eCaDg2Dp0i3nncdtLLb+q6wp2j8yrVxqaAWJ9itVxJlWZDIqQu9amzMzB1DwyNlf6 6R8c2/RNFTqI7lGqN5dvHcDsJyIacngNlTcBAOlaG8vGop3riGgB0yQAVDcKjeW3O+ d9zZ6bRt+pVdFhT2xcSKcSoBfGCOkd8+fhUHUR18= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [95.163.41.97]) (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 61A25A6A7F3 for ; Thu, 1 Feb 2024 19:19:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 61A25A6A7F3 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1rVZmb-00000008muf-1IAg; Thu, 01 Feb 2024 19:19:21 +0300 Message-ID: Date: Thu, 1 Feb 2024 19:19:20 +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: 4F1203BC0FB41BD9010253A383FA2A7573E7F3991072333CCD6CE703AF9322E2182A05F538085040E9BB2FAA658441D0C7A4B249DE6549FDA882DAE6A0FF30243A16A0CF631EA9B95A3E3A1F90AE8952 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71D6E7AC8529A326CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D19071B5A26B4BDC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8089E15DD75294E7108C7B33A0F27DE87604D9FD5B0B75052CC7F00164DA146DAFE8445B8C89999728AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC81D471462564A2E19F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C4E7D9683544204AF6136E347CC761E074AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3BFFF513DCDB8CC61BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFE478A468B35FE7671DD303D21008E298D5E8D9A59859A8B6957A4DEDD2346B4275ECD9A6C639B01B78DA827A17800CE74F0F518E68DBD4F843847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5D0BE59EB0332637A5002B1117B3ED69611D32839E8A09993466072E6821086B3823CB91A9FED034534781492E4B8EEAD329DC2EF12373DEABDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF2685095F5CEC6CD6F6A89C14705BFEC719845BE956E2AD626352E75E1EB811AB2A6269F78606922FBAF4CF3B87E910B19BD6986D72525A1E307BE1D5C4D1C771D748C9091EA0D6795F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKdLLj0Q7SP8wcSlfZinwiA== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884582724CA24DB827C8197B151A33FA7A9F84CA0DBA977F0EB58FBEB1EEEFE0D026D645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 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