From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6AC3F4696C3 for ; Wed, 15 Apr 2020 03:43:52 +0300 (MSK) From: Igor Munkin Date: Wed, 15 Apr 2020 03:36:46 +0300 Message-Id: <7d48bf3ef1f0475b5b805d8548071a535270d63e.1586909073.git.imun@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 2/2] test: adjust luajit-tap testing machinery List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org This changeset makes possible to run luajit-tap tests requiring libraries implemented in C: * symlink to luajit test is created on configuration phase instead of build one. * introduced a CMake function for building shared libraries required for luajit tests. Furthermore this commit enables CMake build for the following luajit-tap tests: * gh-4427-ffi-sandwich * lj-flush-on-trace Signed-off-by: Igor Munkin --- test/CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9b5df7dc5..0ae3843e3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,6 +13,13 @@ function(build_module module files) endif(TARGET_OS_DARWIN) endfunction() +function(build_lualib lib sources) + add_library(${lib} SHARED ${sources}) + set_target_properties(${lib} PROPERTIES PREFIX "") + if(TARGET_OS_DARWIN) + set_target_properties(${lib} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + endif(TARGET_OS_DARWIN) +endfunction() add_compile_flags("C;CXX" "-Wno-unused-parameter") @@ -21,13 +28,9 @@ if(POLICY CMP0037) cmake_policy(SET CMP0037 OLD) endif(POLICY CMP0037) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/luajit-tap - COMMAND ${CMAKE_COMMAND} -E create_symlink +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/third_party/luajit/test - ${CMAKE_CURRENT_BINARY_DIR}/luajit-tap - COMMENT Create a symlink for luajit test dir to fix out-of-source tests) -add_custom_target(symlink_luajit_tests ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/luajit-tap) + ${CMAKE_CURRENT_BINARY_DIR}/luajit-tap) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/small COMMAND ${CMAKE_COMMAND} -E create_symlink @@ -56,6 +59,8 @@ add_subdirectory(app) add_subdirectory(app-tap) add_subdirectory(box) add_subdirectory(unit) +add_subdirectory(luajit-tap/gh-4427-ffi-sandwich) +add_subdirectory(luajit-tap/lj-flush-on-trace) # Move tarantoolctl config if (NOT ${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) -- 2.25.0