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 CCBDA9BBCC2; Mon, 29 Jan 2024 14:01:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CCBDA9BBCC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706526114; bh=bdtbThoYjskDIfTJ+txICxfu7Cv5flVgrrtT57db+Uo=; 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=WstDwRSfYd+YI4TTRXV0IJtjvPbxRy2zilXLvznSpps9cU4IgWswcf/CjPt7TCs0U CNDccaAriBSeGnhti+9cmkSZDI35TvzfCz5P5CgYB+PhMzrPedb6bMy8lbUeRMMl4h Uwqi5H60DTHsDiRZzPvvogNCDGbl5ubochzB17iU= 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 998F29DC60C for ; Mon, 29 Jan 2024 13:50:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 998F29DC60C Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1rUPDQ-0000000BQ6r-3wjk; Mon, 29 Jan 2024 13:50:13 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 29 Jan 2024 13:45:25 +0300 Message-ID: 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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD96A58C36AA2E996493B59CFE144E5211364883C69D379339B182A05F538085040A7E5B02B41398DDB33594132A326AF8BE7CA45E9C706937ADCA4176470581478BE3CD06344D71D5D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74B44AB1D52BB6B9BC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7CB9C0C663C74145DEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B73AB1701401CD87121F24A0175D55D8C2BC13947D25D0DD472C69AB6DB35F9C1A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE764603B5C71CE8B8F9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C390D92131081DE748117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF62D9D0CA8437EFEEBA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B66AF35D64F96D32B676E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C22494854413538E1713FE827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B666D37212B2E9A769089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5A5469217702AF6AC5002B1117B3ED6968447D29CA4B118BF92B673A2F5DDD7E7823CB91A9FED034534781492E4B8EEAD1E02C13459908652C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFE6FC393BC57AAA4F913CD64D60CC468CBDBB8A633D19B9EF659B8392C284C0DC31E81B06003A5D538FB01E7B8BF01A690E247CA40B2656C4B718120DE96C5CC5A1AAE498864BE427C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmd9AG1X07oR8UaaPPP3UnA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7692ADE1716BD58AE3F33594132A326AF8BE7CA45E9C706937AB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 25/26] test: enable LuaJIT test 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 moves the test from the to directory, includes it in , and names subtests. Also, since the tests may be shuffled, `cp.wrapon()` and `cp.wrapoff()` are used for each test separately. Also, this patch adds a workaround for the internal ASAN bug, see details in the comment in the . Part of tarantool/tarantool#9398 --- test/LuaJIT-tests/CMakeLists.txt | 16 ++++++++++ .../{misc => lang}/catch_wrap.lua | 29 +++++++++++++------ test/LuaJIT-tests/lang/index | 1 + 3 files changed, 37 insertions(+), 9 deletions(-) rename test/LuaJIT-tests/{misc => lang}/catch_wrap.lua (71%) diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt index c52bcc71..8ecfe3f6 100644 --- a/test/LuaJIT-tests/CMakeLists.txt +++ b/test/LuaJIT-tests/CMakeLists.txt @@ -24,6 +24,22 @@ else() list(APPEND LUAJIT_TESTS_ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}") endif() +if(LUAJIT_USE_ASAN) + # When running LuaJIT-tests under ASAN, the internal ASAN check + # failed: + # AddressSanitizer: CHECK failed: asan_interceptors.cpp:356 + # "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) + # This is a workaround suggested at + # https://github.com/google/sanitizers/issues/934. + execute_process( + COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libstdc++.so + OUTPUT_VARIABLE LIB_STDCPP + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + # Fortunately, we are not interested in macOS here. + list(APPEND LUAJIT_TESTS_ENV LD_PRELOAD="${LIB_STDCPP}") +endif() + add_custom_command(TARGET LuaJIT-tests COMMENT "Running LuaJIT-tests" COMMAND diff --git a/test/LuaJIT-tests/misc/catch_wrap.lua b/test/LuaJIT-tests/lang/catch_wrap.lua similarity index 71% rename from test/LuaJIT-tests/misc/catch_wrap.lua rename to test/LuaJIT-tests/lang/catch_wrap.lua index 7f656bcc..9d1e3478 100644 --- a/test/LuaJIT-tests/misc/catch_wrap.lua +++ b/test/LuaJIT-tests/lang/catch_wrap.lua @@ -1,45 +1,56 @@ +local cp = require("libcpptest") -local cp = require("cpptest") -cp.wrapon() +local unwind -do +do --- catch, no error + cp.wrapon() local a, b = pcall(cp.catch, function() return "x" end) assert(a == true and b == "x") + cp.wrapoff() end -do +do --- pcall throw + cp.wrapon() local a, b = pcall(function() cp.throw("foo") end) assert(a == false and b == "foo") + cp.wrapoff() end -local unwind -do +do --- catch throw + cp.wrapon() local a, b = pcall(cp.catch, function() cp.throw("foo") end) unwind = a assert((a == false and b == "foo") or (a == true and b == "catch ...")) + cp.wrapoff() end -do +do --- alloc, no error + cp.wrapon() local st = cp.alloc(function() return cp.isalloc() end) assert(st == true) assert(cp.isalloc() == false) + cp.wrapoff() end -do +do --- throw in alloc + cp.wrapon() local a, b = pcall(cp.alloc, function() assert(cp.isalloc() == true) return "foo", cp.throw end) assert(a == false and b == "foo") assert(cp.isalloc() == false) + cp.wrapoff() end -do +do --- error in alloc + cp.wrapon() local a, b = pcall(cp.alloc, function() assert(cp.isalloc() == true) return "foo", error end) assert(a == false and b == "foo") if unwind then assert(cp.isalloc() == false) end + cp.wrapoff() end diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index index dc0c2e14..87b0c5a0 100644 --- a/test/LuaJIT-tests/lang/index +++ b/test/LuaJIT-tests/lang/index @@ -1,6 +1,7 @@ andor.lua api_call.lua assignment.lua +catch_wrap.lua compare.lua compare_nan.lua constant -- 2.43.0