ENH: only use newer java for testing

This commit is contained in:
Bill Hoffman 2004-09-24 16:34:20 -04:00
parent 0a26f8d46c
commit 4b87fdada4
1 changed files with 15 additions and 11 deletions

View File

@ -659,17 +659,21 @@ IF(BUILD_TESTING)
INCLUDE(FindJava) INCLUDE(FindJava)
IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE) IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE)
ADD_TEST(Java ${CMAKE_CTEST_COMMAND} EXEC_PROGRAM(${CMAKE_Java_COMPILER} -version OUTPUT_VARIABLE OUT)
--build-and-test IF(OUT MATCHES "invalid flag")
"${CMake_SOURCE_DIR}/Tests/Java" MESSAGE("This java does not even know what version it is!")
"${CMake_BINARY_DIR}/Tests/Java" ELSE(OUT MATCHES "invalid flag")
--build-generator ${CMAKE_GENERATOR} ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
--build-project hello --build-and-test
--build-makeprogram ${MAKEPROGRAM} "${CMake_SOURCE_DIR}/Tests/Java"
--build-two-config "${CMake_BINARY_DIR}/Tests/Java"
--build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --build-generator ${CMAKE_GENERATOR}
# --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) --build-project hello
--test-command ${JAVA_RUNTIME} HelloWorld) --build-makeprogram ${MAKEPROGRAM}
--build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
ENDIF(OUT MATCHES "invalid flag")
ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE) ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")