aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-03-06 17:49:24 -0800
committerGerald Combs <gerald@wireshark.org>2015-03-07 02:02:19 +0000
commitacb62f1c7f8be6958c10df9d81c1c16369673825 (patch)
tree813fd03216e7756c2523cd1f9ac4307e9725568f /CMakeLists.txt
parent394d23ed7b99e0b7f623dc5ad1ed8698691546f4 (diff)
CMake: Generate a wrapper for test.sh.
Create a wrapper script that cd's to the test directory and execs test.sh. We need to handle build configurations so the path is a bit roundabout. Change-Id: I4c2a48c041bce2479422830110b1251b3f2c5a94 Reviewed-on: https://code.wireshark.org/review/7570 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b57da5b56..a19deae15a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2240,6 +2240,29 @@ if(DOC_DIR)
)
endif()
+# Test suite wrapper
+if(ENABLE_APPLICATION_BUNDLE)
+ set(TEST_SH_BIN_DIR ${CMAKE_BINARY_DIR}/run)
+else()
+ set(TEST_SH_BIN_DIR $<TARGET_FILE_DIR:epan>)
+ if (NOT "${CYGPATH_EXECUTABLE}" STREQUAL "CYGPATH_EXECUTABLE-NOTFOUND")
+ execute_process(
+ COMMAND ${CYGPATH_EXECUTABLE} -u ${TEST_SH_BIN_DIR}
+ OUTPUT_VARIABLE _cygwin_path
+ )
+ string(STRIP "${_cygwin_path}" _cygwin_path)
+ set(TEST_SH_BIN_DIR ${_cygwin_path})
+ endif()
+endif()
+
+add_custom_target(test-sh ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DTEST_SH_BIN_DIR=${TEST_SH_BIN_DIR}
+ -DTEST_SH_DIR=${CMAKE_SOURCE_DIR}/test
+ -P ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
+ DEPENDS ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
+)
+
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#