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 46A5C98C13E; Fri, 19 Jan 2024 14:49:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 46A5C98C13E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1705664944; bh=vx4MuRPaRgaQwTrbb0JNC36+ELhFl1nxOrpK+YNcq1A=; 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=VSjqR+jPh6DekZ+FKFCjmUl95VAuZ7fmmfeQSO2M5zV0PM182DGCiPmyqCXrGt0+O H9nXoepnOdX49u2cOrA8Ssek5K8WkB0I9A07E0aKZcXzVoRsJeDY6Eu7NHXvcxb8Jx 6+OPa1jnpWcwphfvLEPr0rAmm/UxmdfZABpRKcoU= Received: from smtp16.i.mail.ru (smtp16.i.mail.ru [95.163.41.69]) (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 454E2988E4D for ; Fri, 19 Jan 2024 14:37:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 454E2988E4D Received: by smtp16.i.mail.ru with esmtpa (envelope-from ) id 1rQnBv-00FDC7-27; Fri, 19 Jan 2024 14:37:43 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Fri, 19 Jan 2024 14:32:47 +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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9AE5B4AFB3AE2A5909B38FFCAAE1FB38606686B0B5065941A182A05F538085040F123F1E2346288F9CD49626DD364B07CA17098F1D9FA2429E19652869BE442ED X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FE853634EDEBEC2EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372A1E89AC32EDFEB98638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8656636126A94E4C4A433D49CCA9E1AC4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC9FC99A4BA45EE8B4A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FF04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C088D2E8BEBF93D4B068655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C1156E5889A6D309143847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A53A569027D03E55DC3DE3FD803DF40A2F81294F5DFBB85847F87CCE6106E1FC07E67D4AC08A07B9B0034D30FDF2F620DB9C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF07975A0E75DBF62807D4F0504B8C12E32C925FE302E774B083C7A760292F7543327C9FD717F337186197189FEE4B1C7AF390263F09581068590B832D1DE551E8A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojJsr4kcGAUCOM+SBpV2P5Bg== X-DA7885C5: BB414CF94C09800022358C9D20223E7BE872E2EF69D42EE5D2B873AA2C89946F262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33AEDF4B16248C5EE30A8E2D07C0FD12060FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 24/25] 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 (74%) 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 74% rename from test/LuaJIT-tests/misc/catch_wrap.lua rename to test/LuaJIT-tests/lang/catch_wrap.lua index 7f656bcc..fa54cd67 100644 --- a/test/LuaJIT-tests/misc/catch_wrap.lua +++ b/test/LuaJIT-tests/lang/catch_wrap.lua @@ -1,45 +1,56 @@ - local cp = require("cpptest") -cp.wrapon() -do +local unwind + +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