Skip to content

Commit

Permalink
test: adjust luajit-tap testing machinery
Browse files Browse the repository at this point in the history
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

Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Reviewed-by: Sergey Ostanevich <sergos@tarantool.org>
Signed-off-by: Igor Munkin <imun@tarantool.org>
  • Loading branch information
igormunkin authored and kyukhin committed Apr 20, 2020
1 parent a159409 commit 335f80a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/CMakeLists.txt
Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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})
Expand Down

0 comments on commit 335f80a

Please sign in to comment.