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 4ADE2CC8EB7; Mon, 23 Sep 2024 10:20:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4ADE2CC8EB7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1727076047; bh=YyDgqOyIrYXCI+e4iYgorI5UnLdi81uCL/i5HVbqnTI=; 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=of/MPQsMTYWwtRer08bo1Dy0a5omHhcZQVQ92CFcZYz5kb3ieH/k8c95dtHYyWUxs qPh2FonPk5DTvvP/Kb05R+a/jMI1XbIMj+HQfM4rEmiI+CoIn97nYVFE8UFg48hG7d TvKwA2Fmp7CA9E2Ics1JYL/1ENpxaq6HASoaMOI0= Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [95.163.41.72]) (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 CE5E0CC8EAC for ; Mon, 23 Sep 2024 10:19:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CE5E0CC8EAC Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1ssdLn-0000000C9Sx-3WeF; Mon, 23 Sep 2024 10:19:16 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 23 Sep 2024 10:18:49 +0300 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9DEE1C835CE5EC5BA5B33675C163E80B26EF266116F939905182A05F5380850404C228DA9ACA6FE27949B39A74467D2CC0578E6996F38341378785432DAB5DBDCF1F23DB1DB19033229BB0F96A4111E0F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE741C7AE487E378FE7EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CDA089757FB31C668638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D860533267E2B2F28EA57B93FDDFD97B75B62EF66CC0D65ED1CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F602FA08A9622EC2389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B4B51A2BAB7FBE05117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF3BAFBCDF8379C95DBA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B63247F7D7586455C976E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CC415C329B279CF9D43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A578F0F21E6193B30D5002B1117B3ED6964FA223F8035E77F5ED71F038FC046993823CB91A9FED034534781492E4B8EEAD577AE849BCD98940C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF06C4BC9229AD6E56657AF96CE5F2A9F445E61989227871124C34B4A51A9603D4A0D894938C2B729CFD4E6A0B424C2B48C5AE5F44E0DDBC11D114F5CB28E833584528B20297EE30CFC226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojcsBYxvRMKezPRrC3wBYzUA== X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B59B323B2362175E1F10578E6996F38341378785432DAB5DBDCB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 3/7] cmake: introduce AppendTestEnvVar macro 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" It is useful to update the environment variable for some tests. For CMake versions >= 3.22, we can use ENVIRONMENT_MODIFICATION [1] instead. But unless we bump the CMake version, this macro is a workaround. [1]: https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html Part of tarantool/tarantool#9898 --- test/tarantool-tests/CMakeLists.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt index 11a84496..4530c9fd 100644 --- a/test/tarantool-tests/CMakeLists.txt +++ b/test/tarantool-tests/CMakeLists.txt @@ -18,6 +18,29 @@ macro(BuildTestCLib lib sources) set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}" PARENT_SCOPE) endmacro() +# FIXME: This is used only due to ancient CMake requirements. +# If we update to CMake >= 3.22, we can use +# ENVIRONMENT_MODIFICATION [1] instead. +# [1]: https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html +macro(AppendTestEnvVar testname var value) + get_test_property(${testname} ENVIRONMENT old_env) + foreach(loopvar "${old_env}") + if(loopvar MATCHES "^${var}=(.*)") + set(envvar_found TRUE) + set(loopvar "${var}=${value}${CMAKE_MATCH_1}") + endif() + list(APPEND new_env "${loopvar}") + endforeach() + if(NOT "${envvar_found}") + list(APPEND new_env "${var}=${value}") + endif() + set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${new_env}") + + unset(envvar_found) + unset(old_env) + unset(new_env) +endmacro() + add_subdirectory(ffi-ccall) add_subdirectory(fix-bit-shift-generation) add_subdirectory(gh-4427-ffi-sandwich) -- 2.46.0