summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-22 18:45:38 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-03-22 18:45:38 (GMT)
commit685d8935006ef8ea29f5ae6636dbb29b216fa9ef (patch)
tree85ae93c11e5271c60cbff78f63c622ada06753d5 /Tests
parentbc19ba603250af9187cfaedcb971b16d70718651 (diff)
parent80ccc9aafb555f5a3c6f5f8e2f5825e92eaffc54 (diff)
downloadCMake-685d8935006ef8ea29f5ae6636dbb29b216fa9ef.zip
CMake-685d8935006ef8ea29f5ae6636dbb29b216fa9ef.tar.gz
CMake-685d8935006ef8ea29f5ae6636dbb29b216fa9ef.tar.bz2
Merge topic 'fix-Java-test-enable-logic'
80ccc9a Disable Java test with Xcode generator 46c0a58 Enable Java test more carefully on Apple
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt57
1 files changed, 24 insertions, 33 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6da06f6..77c5752 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1868,39 +1868,30 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF()
ENDIF()
- if(NOT DEFINED CTEST_RUN_Java)
- if(APPLE)
- set(CTEST_RUN_Java OFF)
- else()
- set(CTEST_RUN_Java ON)
- endif()
- endif()
-
- IF(CTEST_RUN_Java)
- find_package(Java QUIET)
- IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
- GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
- FIND_FILE(JNI_H jni.h
- "${JNIPATH}/../include"
- "${JNIPATH}/../java/include")
- IF(JNI_H)
- FILE(READ "${JNI_H}" JNI_FILE)
- IF("${JNI_FILE}" MATCHES "JDK1_2")
- ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Java"
- "${CMake_BINARY_DIR}/Tests/Java"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project hello
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
- --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
- LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
- ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
- ENDIF(JNI_H)
- ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
- ENDIF(CTEST_RUN_Java)
+ find_package(Java QUIET)
+ IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW
+ AND NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Xcode")
+ GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
+ FIND_FILE(JNI_H jni.h
+ "${JNIPATH}/../include"
+ "${JNIPATH}/../java/include")
+ IF(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink
+ FILE(READ "${JNI_H}" JNI_FILE)
+ IF("${JNI_FILE}" MATCHES "JDK1_2")
+ ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Java"
+ "${CMake_BINARY_DIR}/Tests/Java"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project hello
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-two-config
+ --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
+ --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
+ ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
+ ENDIF()
+ ENDIF()
# add some cross compiler tests, for now only with makefile based generators
IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")