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 8AAEE9DC624; Mon, 29 Jan 2024 13:53:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8AAEE9DC624 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706525635; bh=Hvc7V/M8DrfcKpX9NUpfVtOYFh3vLA44IelnQTyH3+U=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qL5O4cQv7u72TzF7keVm0vLJNUaKu3LjLuPAS11F7uzER+AKBOfHavYuTnTzvkYYr 1qY804T4AgBo5Blhj/2OQBV4BRBTMI4q7v2Q2drF/5t+oodJiA+5+2j8R8RACeHPqH speOlxXDTNQeF4FkSkXLUbvYDjF64btVZm2iIvdQ= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 4A81A9C2035 for ; Mon, 29 Jan 2024 13:49:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4A81A9C2035 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1rUPCl-0000000BQ6r-2Ohu; Mon, 29 Jan 2024 13:49:32 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 29 Jan 2024 13:45:09 +0300 Message-ID: <4d80dfc5a12d8e7d0ca668432543a9241dd58017.1706520765.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD96A58C36AA2E9964978ECFE5B85237D573AA18A5812ED51A7182A05F53808504084604FB5B28698F633594132A326AF8B867B97D4583B7624DCA41764705814787583B74AD1C403A3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7922FDBD9EBA3C5B4B287FD4696A6DC2FA8DF7F3B2552694A4E2F5AFA99E116B42401471946AA11AF7680F9384605B903D6AE5EDF9DDECFEF8F08D7030A58E5AD1A62830130A00468AEEEE3FBA3A834EE7353EFBB55337566743E074EEF98C241AE5011BA15A79E5DCB8E2F64A37354FDBEECAE0EB6A073FB389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C045A75973B56231AD8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6E5E764EB5D94DBD4CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249D169BA22B831DC9576E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8BAFA763333BC6A9753AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC2EE5AD8F952D28FBE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BF62623862A568E3375ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A575869027499AB8425002B1117B3ED69685084F46E88D7528C81EEE05487B0209823CB91A9FED034534781492E4B8EEAD329DC2EF12373DEAC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF9075184B28D96A2093B79A7385E2B94FF51EE3D32A85A6384C6D8719C35D16742DF5FAC740BFE7CD8FB01E7B8BF01A695419091CF3C89AD0B718120DE96C5CC5E7C7D29A79A0D23CC226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmd9AG1X07oTyPxbeqIj2Dg== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7695CBFD43FB30C3F5C33594132A326AF8B867B97D4583B7624B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [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 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" 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 -- 2.43.0