From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 3658D469719 for ; Thu, 15 Oct 2020 19:19:39 +0300 (MSK) From: Timur Safin Date: Thu, 15 Oct 2020 19:19:30 +0300 Message-Id: <11457da6c5f5f29b511a809cbc0908b19458d284.1602778378.git.tsafin@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] (no subject) List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imun@tarantool.org, alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Subject: [PATCH] luajit - avoid hardcode of paths to luajit test We try to avoid hardcode of paths to LuaJIT tests, which live in the 3rd party repository and might get updated without our notice. - to simplify cmake code we introduce symlink inside of `test` directory which is now pointing to `third_party/luajit/test` subdirectory - and we use `file(GLOB...)` statement now to propagate list of all available test directories we found inside of luajit submodule. Closes #5425 --- test/CMakeLists.txt | 14 +++++++++++--- test/luajit | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) create mode 120000 test/luajit diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7b28e2bd4..8e36cba6c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,6 +20,16 @@ function(build_lualib lib sources) endif(TARGET_OS_DARWIN) endfunction() +macro(add_subdirectories base_directory) + file(GLOB entries RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${base_directory}/*") + foreach(entry ${entries}) + if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${entry}) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${entry} + ${PROJECT_BINARY_DIR}/${entry}) + endif() + endforeach() +endmacro() + add_compile_flags("C;CXX" "-Wno-unused-parameter") @@ -75,9 +85,7 @@ add_subdirectory(app-tap) add_subdirectory(box) add_subdirectory(box-tap) add_subdirectory(unit) -add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/luajit/test/gh-4427-ffi-sandwich ${PROJECT_BINARY_DIR}/third_party/luajit/test/gh-4427-ffi-sandwich) -add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/luajit/test/lj-flush-on-trace ${PROJECT_BINARY_DIR}/third_party/luajit/test/lj-flush-on-trace) -add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/luajit/test/misclib-getmetrics-capi ${PROJECT_BINARY_DIR}/third_party/luajit/test/misclib-getmetrics-capi) +add_subdirectories(luajit) # Move tarantoolctl config if (NOT ${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) diff --git a/test/luajit b/test/luajit new file mode 120000 index 000000000..c83b4ed65 --- /dev/null +++ b/test/luajit @@ -0,0 +1 @@ +../third_party/luajit/test \ No newline at end of file -- 2.20.1