aboutsummaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-28 00:11:56 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-28 00:11:56 +0000
commite4cc017c5d44c1046e6afdfc1e68d756c8748b6b (patch)
tree3e0be3b2b40f6ef509cd4d00f0e4d1166d575209 /test/CMakeLists.txt
parentf1752bac0b0c00717478bc6633e4afb527bd46da (diff)
downloadrspamd-e4cc017c5d44c1046e6afdfc1e68d756c8748b6b.tar.gz
rspamd-e4cc017c5d44c1046e6afdfc1e68d756c8748b6b.zip
Rework lua tests one more time.
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index b4fa018d2..18a826026 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -24,10 +24,18 @@ TARGET_LINK_LIBRARIES(rspamd-test stemmer)
IF(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
# Also add dependencies for convenience
- FILE(GLOB LUA_TESTS "${CMAKE_CURRENT_SOURCE_DIR}/lua/*")
+ FILE(GLOB_RECURSE LUA_TESTS "${CMAKE_CURRENT_SOURCE_DIR}/lua/*")
+ ADD_CUSTOM_TARGET(units-dir COMMAND
+ ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/lua/unit"
+ )
+ ADD_DEPENDENCIES(rspamd-test units-dir)
FOREACH(_LF IN LISTS LUA_TESTS)
GET_FILENAME_COMPONENT(_NM "${_LF}" NAME)
- SET(_DS "${CMAKE_CURRENT_BINARY_DIR}/lua/${_NM}")
+ IF("${_LF}" MATCHES "^.*/unit/.*$")
+ SET(_DS "${CMAKE_CURRENT_BINARY_DIR}/lua/unit/${_NM}")
+ ELSE()
+ SET(_DS "${CMAKE_CURRENT_BINARY_DIR}/lua/${_NM}")
+ ENDIF()
ADD_CUSTOM_TARGET("${_NM}" COMMAND
${CMAKE_COMMAND} -E copy_if_different ${_LF} ${_DS}
SOURCES "${_LF}"