Skip to content

Commit

Permalink
test: fix running 'small' lib tests for OOS build
Browse files Browse the repository at this point in the history
The 'small' lib test suite was not run for out-of-source builds since
the wrong symlink was created for test binaries and test-run couldn't
find them. Now it is fixed.

When test-run loads tests, first, it searches the suite.ini file and if
it exists test-run consider the dir as a test suite. So there was sense
to create a permanent link for 'small' lib tests.

Closes tarantool#4485

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff
  • Loading branch information
ylobankov committed Jun 28, 2022
1 parent 9be8ac5 commit 90328e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test/enterprise-unit
test/lib/
test/unit/*.test
test/unit/fiob
test/small
test/small/*.test
test/var
test/luajit-tap
test/unit/popen-child
Expand Down
13 changes: 9 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ if(POLICY CMP0037)
endif()
endif(POLICY CMP0037)

# The symlink is needed for out-of-source builds. In the case of in-source
# builds ${CMAKE_CURRENT_BINARY_DIR} == ${PROJECT_SOURCE_DIR}/test and the
# symlink already exists. It creates the symlink if the destination doesn't
# exist.
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/small
COMMAND ${CMAKE_COMMAND} -E create_symlink
${PROJECT_SOURCE_DIR}/src/lib/small/test/
${CMAKE_CURRENT_BINARY_DIR}/../src/lib/small/test/
${CMAKE_CURRENT_BINARY_DIR}/small
COMMENT Create a symlink for libsmall to fix out-of-source tests)
add_custom_target(symlink_small_tests ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small)
COMMENT Create the symlink for libsmall test binaries)

add_custom_target(symlink_libsmall_test_binaries ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small)

add_custom_target(test
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small
Expand Down
1 change: 1 addition & 0 deletions test/small

0 comments on commit 90328e0

Please sign in to comment.