Commit 43654bc7 authored by Brian Panneton's avatar Brian Panneton Committed by Kenneth Leiter

ENH: Moved the TestingSuite to more of a stand alone format

The TestingSuite should be able to be used on other projects much
more simply than before. Macros were renamed for better understanding.
parent 86d502b3
INCLUDE(TestingSetup)
# We should have one place that points to the cxx source directory and the cxx
# binary directory
SET(cxx_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
SET(cxx_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
GET_PROPERTY(cxx_dependencies GLOBAL PROPERTY CXX_TEST_DEPENDENCIES)
# CXX Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the cxx test dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for cxx tests
MACRO(ADD_TEST_CXX_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY CXX_TEST_DEPENDENCIES
"${dependencies}"
)
ENDIF(NOT ("${dependencies}" STREQUAL ""))
ENDMACRO(ADD_TEST_CXX_DEPENDENCIES dependencies)
# CXX Test Macro
# Author: Brian Panneton
......@@ -10,30 +25,24 @@
# Parameters:
# executable = executable name
# ${ARGN} = any arguments for the executable
MACRO(ADD_CXX_TEST executable)
IF(EXISTS ${ARGN})
SET(arguments "${ARGN}")
ELSE(EXISTS ${ARGN}) # Sanity Check
SET(arguments "")
ENDIF(EXISTS ${ARGN})
MACRO(ADD_TEST_CXX executable)
PARSE_TEST_ARGS("${ARGN}")
IF(EXISTS ${cxx_source_dir}/${executable}.cpp)
ADD_EXECUTABLE(${executable} ${cxx_source_dir}/${executable}.cpp)
ADD_EXECUTABLE(${executable}${dup} ${cxx_source_dir}/${executable}.cpp)
ENDIF(EXISTS ${cxx_source_dir}/${executable}.cpp)
IF(EXISTS ${cxx_source_dir}/${executable}.cxx)
ADD_EXECUTABLE(${executable} ${cxx_source_dir}/${executable}.cxx)
ADD_EXECUTABLE(${executable}${dup} ${cxx_source_dir}/${executable}.cxx)
ENDIF(EXISTS ${cxx_source_dir}/${executable}.cxx)
TARGET_LINK_LIBRARIES(${executable} ${cxx_dependencies})
GET_PROPERTY(cxx_dependencies GLOBAL PROPERTY CXX_TEST_DEPENDENCIES)
TARGET_LINK_LIBRARIES(${executable}${dup} ${cxx_dependencies})
STRING(REGEX MATCH "core" is_core "${cxx_binary_dir}")
IF(EXISTS ${is_core})
SET(is_core "Core")
ENDIF(EXISTS ${is_core})
ADD_TEST(Cxx${is_core}_${executable} ${executable} ${arguments})
ENDMACRO(ADD_CXX_TEST executable)
SET_CORE("${cxx_binary_dir}")
ADD_TEST(Cxx${is_core}_${executable}${dup} ${executable}${dup} ${arguments})
ENDMACRO(ADD_TEST_CXX executable)
# CXX Clean Macro
# Author: Brian Panneton
......@@ -41,8 +50,8 @@
# Parameters:
# executable = executable name
# ${ARGN} = files that the executable created
MACRO(CLEAN_CXX_TEST executable)
MACRO(CLEAN_TEST_CXX executable)
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES ${ARGN}
)
ENDMACRO(CLEAN_CXX_TEST executable)
ENDMACRO(CLEAN_TEST_CXX executable)
INCLUDE(TestDefines)
INCLUDE(TestingSetup)
# Variables that are set externally
SET(java_configure_files ${CMAKE_SOURCE_DIR}/core/CMake)
SET(java_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
SET(java_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
GET_PROPERTY(java_dependencies GLOBAL PROPERTY JAVA_TEST_DEPENDENCIES)
GET_PROPERTY(java_classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
# Java Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the java test dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for java tests
MACRO(ADD_TEST_JAVA_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_DEPENDENCIES
"${dependencies}"
)
ENDIF(NOT ("${dependencies}" STREQUAL ""))
ENDMACRO(ADD_TEST_JAVA_DEPENDENCIES dependencies)
# Java Add Classpath Macro
# Author: Brian Panneton
# Description: This macro adds the java test classpaths.
# Parameters:
# cp = any classpaths needed for java tests
MACRO(ADD_TEST_JAVA_CLASSPATH cp)
GET_PROPERTY(classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
IF(NOT ("${cp}" STREQUAL ""))
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_CLASSPATH
"${classpath}:${cp}"
)
ENDIF(NOT ("${cp}" STREQUAL ""))
ENDMACRO(ADD_TEST_JAVA_CLASSPATH cp)
# Java Add LDPath Macro
# Author: Brian Panneton
# Description: This macro adds the java test ldpaths.
# Parameters:
# ld = any ldpaths needed for java tests
MACRO(ADD_TEST_JAVA_LDPATH ld)
GET_PROPERTY(ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
IF("${ld}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_LDPATH
"${ldpath}:${ld}"
)
ENDIF("${ld}" STRGREATER "")
ENDMACRO(ADD_TEST_JAVA_LDPATH ld)
# Add Java Test Macro
# Author: Brian Panneton
......@@ -17,43 +55,37 @@ GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
# executable = executable name
# ${ARGN} = any arguments for the executable
#
MACRO(ADD_TEST_JAVA executable)
MACRO(ADD_JAVA_TEST executable)
IF(EXISTS ${ARGN})
SET(arguments "${ARGN}")
ELSE(EXISTS ${ARGN})
SET(arguments "")
ENDIF(EXISTS ${ARGN})
PARSE_TEST_ARGS("${ARGN}")
GET_PROPERTY(java_dependencies GLOBAL PROPERTY JAVA_TEST_DEPENDENCIES)
GET_PROPERTY(java_classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
ADD_CUSTOM_COMMAND(
OUTPUT ${java_binary_dir}/${executable}.class
WORKING_DIRECTORY ${java_binary_dir}
DEPENDS ${java_source_dir}/${executable}.java
${java_dependencies}
COMMAND ${JAVA_COMPILE}
ARGS -cp ${java_classpath}
-d ${java_binary_dir}
ARGS -cp '${java_classpath}'
-d '${java_binary_dir}'
${java_source_dir}/${executable}.java
)
SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_TARGETS "${java_binary_dir}/${executable}.class")
STRING(REGEX MATCH "core" is_core "${java_binary_dir}")
IF(EXISTS ${is_core})
SET(is_core "Core")
ENDIF(EXISTS ${is_core})
ADD_TEST(Java${is_core}_${executable} ${CMAKE_COMMAND}
SET_CORE("${java_binary_dir}")
ADD_TEST(Java${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D EXECUTABLE=${executable}
-D ARGUMENTS=${arguments}
-D CLASSPATH=${java_classpath}
-D LDPATH=${java_ldpath}
-P ${java_binary_dir}/JavaTestDriver.cmake
-P ${java_binary_dir}/TestDriverJava.cmake
)
ENDMACRO(ADD_JAVA_TEST)
ENDMACRO(ADD_TEST_JAVA executable)
# Java Clean Macro
# Author: Brian Panneton
......@@ -61,12 +93,32 @@ ENDMACRO(ADD_JAVA_TEST)
# Parameters:
# executable = executable name
# ${ARGN} = files that the executable created
MACRO(CLEAN_JAVA_TEST executable)
MACRO(CLEAN_TEST_JAVA executable)
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES ${ARGN}
)
ENDMACRO(CLEAN_JAVA_TEST executable)
ENDMACRO(CLEAN_TEST_JAVA executable)
# Java Create Target Macro
# Author: Brian Panneton
# Description: This macro sets up the python test target
# Parameters: none
MACRO(CREATE_TARGET_TEST_JAVA)
IF(EXISTS JavaCore_ALLTEST)
SET(JavaCore_ALLTEST JavaCore_ALLTEST)
ENDIF(EXISTS JavaCore_ALLTEST)
SET_CORE("${java_binary_dir}")
GET_PROPERTY(targets GLOBAL PROPERTY JAVA_TEST_TARGETS)
ADD_CUSTOM_TARGET(Java${is_core}_ALLTEST ALL DEPENDS
${JavaCore_ALLTEST} ${targets})
IF(NOT ("${is_core}" STREQUAL ""))
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_TARGETS "")
ENDIF(NOT ("${is_core}" STREQUAL ""))
ENDMACRO(CREATE_TARGET_TEST_JAVA)
# Configure the java 'driver' file
CONFIGURE_FILE(${java_configure_files}/JavaTestDriver.cmake.in ${java_binary_dir}/JavaTestDriver.cmake @ONLY)
CONFIGURE_FILE(${TESTING_SUITE_DIR}/TestingSuite/TestDriverJava.cmake.in ${java_binary_dir}/TestDriverJava.cmake @ONLY)
# We cannot call ${PYTHON_EXECUTABLE} or ${PYTHON_LIBRARIES} because
# they do not get propagated down to this subdirectory
SET(PYTHON_EXECUTABLE python)
INCLUDE(TestingSetup)
# Variables that are set externally
SET(python_configure_files ${CMAKE_SOURCE_DIR}/core/CMake)
SET(python_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
SET(python_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
GET_PROPERTY(python_dependencies GLOBAL PROPERTY PYTHON_TEST_DEPENDENCIES)
GET_PROPERTY(python_pythonpath GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH)
# Python Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the python test dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for python tests
MACRO(ADD_TEST_PYTHON_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY PYTHON_TEST_DEPENDENCIES
"${dependencies}"
)
ENDIF(NOT ("${dependencies}" STREQUAL ""))
ENDMACRO(ADD_TEST_PYTHON_DEPENDENCIES dependencies)
# Python Add PythonPath Macro
# Author: Brian Panneton
# Description: This macro adds the python test pythonpaths.
# Parameters:
# pyp = any pythonpaths needed for python tests
MACRO(ADD_TEST_PYTHON_PYTHONPATH pyp)
GET_PROPERTY(pythonpath GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH)
IF(NOT ("${pyp}" STREQUAL ""))
SET_PROPERTY(GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH
"${pythonpath}:${pyp}"
)
ENDIF(NOT ("${pyp}" STREQUAL ""))
ENDMACRO(ADD_TEST_PYTHON_PYTHONPATH cp)
# Add Python Test Macro
# Author: Brian Panneton
......@@ -18,15 +42,14 @@ GET_PROPERTY(python_pythonpath GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH)
# executable = executable name
# ${ARGN} = any arguments for the executable
#
MACRO(ADD_PYTHON_TEST executable)
MACRO(ADD_TEST_PYTHON executable)
IF(EXISTS ${ARGN})
SET(arguments "${ARGN}")
ELSE(EXISTS ${ARGN})
SET(arguments "")
ENDIF(EXISTS ${ARGN})
PARSE_TEST_ARGS("${ARGN}")
GET_PROPERTY(python_dependencies GLOBAL
PROPERTY PYTHON_TEST_DEPENDENCIES)
GET_PROPERTY(python_pythonpath GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH)
ADD_CUSTOM_COMMAND(
OUTPUT ${python_binary_dir}/${executable}.pyc
WORKING_DIRECTORY ${python_binary_dir}
......@@ -43,19 +66,16 @@ MACRO(ADD_PYTHON_TEST executable)
SET_PROPERTY(GLOBAL APPEND PROPERTY PYTHON_TEST_TARGETS "${python_binary_dir}/${executable}.pyc")
STRING(REGEX MATCH "core" is_core "${python_binary_dir}")
IF(EXISTS ${is_core})
SET(is_core "Core")
ENDIF(EXISTS ${is_core})
ADD_TEST(Python${is_core}_${executable} ${CMAKE_COMMAND}
SET_CORE("${python_binary_dir}")
ADD_TEST(Python${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D EXECUTABLE=${executable}
-D ARGUMENTS=${arguments}
-D PYTHONPATH=${python_pythonpath}
-P ${python_binary_dir}/PythonTestDriver.cmake
-P ${python_binary_dir}/TestDriverPython.cmake
)
ENDMACRO(ADD_PYTHON_TEST)
ENDMACRO(ADD_TEST_PYTHON executable)
# Python Clean Macro
# Author: Brian Panneton
......@@ -63,13 +83,35 @@ ENDMACRO(ADD_PYTHON_TEST)
# Parameters:
# executable = executable name
# ${ARGN} = files that the executable created
MACRO(CLEAN_PYTHON_TEST executable)
MACRO(CLEAN_TEST_PYTHON executable)
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES ${ARGN}
${executable}.py
)
ENDMACRO(CLEAN_PYTHON_TEST executable)
ENDMACRO(CLEAN_TEST_PYTHON executable)
# Python Create Target Macro
# Author: Brian Panneton
# Description: This macro sets up the python test target
# Parameters: none
MACRO(CREATE_TARGET_TEST_PYTHON)
IF(EXISTS PythonCore_ALLTEST)
SET(PythonCore_ALLTEST PythonCore_ALLTEST)
ENDIF(EXISTS PythonCore_ALLTEST)
SET_CORE("${python_binary_dir}")
GET_PROPERTY(targets GLOBAL PROPERTY PYTHON_TEST_TARGETS)
ADD_CUSTOM_TARGET(Python${is_core}_ALLTEST ALL DEPENDS
${PythonCore_ALLTEST} ${targets})
IF(NOT ("${is_core}" STREQUAL ""))
SET_PROPERTY(GLOBAL PROPERTY PYTHON_TEST_TARGETS "")
ENDIF(NOT ("${is_core}" STREQUAL ""))
ENDMACRO(CREATE_TARGET_TEST_PYTHON)
# Configure the python 'driver' file
CONFIGURE_FILE(${python_configure_files}/PythonTestDriver.cmake.in ${python_binary_dir}/PythonTestDriver.cmake @ONLY)
CONFIGURE_FILE(${TESTING_SUITE_DIR}/TestingSuite/TestDriverPython.cmake.in ${python_binary_dir}/TestDriverPython.cmake @ONLY)
......@@ -5,8 +5,8 @@ IF(WIN32)
STRING(REGEX REPLACE ":" ";" CLASSPATH ${CLASSPATH})
ENDIF(WIN32)
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}$ENV{LD_LIBRARY_PATH}")
SET(ENV{CLASSPATH} "${CLASSPATH}$ENV{CLASSPATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}:$ENV{LD_LIBRARY_PATH}")
SET(ENV{CLASSPATH} "${CLASSPATH}:$ENV{CLASSPATH}")
MESSAGE("| Calling:\t${java_runtime} ${EXECUTABLE} ${ARGUMENTS}")
EXECUTE_PROCESS(
......
......@@ -5,7 +5,7 @@ IF(WIN32)
STRING(REGEX REPLACE ":" ";" PYTHONPATH ${PYTHONPATH})
ENDIF(WIN32)
SET(ENV{PYTHONPATH} "${PYTHONPATH}$ENV{PYTHONPATH}")
SET(ENV{PYTHONPATH} "${PYTHONPATH}:$ENV{PYTHONPATH}")
MESSAGE("| Calling:\t${python_runtime} ${EXECUTABLE} ${ARGUMENTS}")
EXECUTE_PROCESS(
......
# List of global variables needed by tests
SET(defines
JAVA_TEST_DEPENDENCIES
JAVA_TEST_CLASSPATH
JAVA_TEST_LDPATH
JAVA_TEST_TARGETS
PYTHON_TEST_DEPENDENCIES
CXX_TEST_DEPENDENCIES
)
# Make sure they are defined
FOREACH(def IN LISTS defines)
GET_PROPERTY(is_defined GLOBAL PROPERTY ${def} DEFINED)
IF(NOT is_defined)
DEFINE_PROPERTY(GLOBAL PROPERTY ${def}
BRIEF_DOCS "${def}"
FULL_DOCS "${def} No Documentation"
)
ENDIF()
ENDFOREACH()
# Set the testing suite dir
SET(TESTING_SUITE_DIR "${CMAKE_SOURCE_DIR}/CMake" CACHE PATH "Testing Suite CMake Dir")
MARK_AS_ADVANCED(TESTING_SUITE_DIR)
# Argument Parsing Macro
# Author: Brian Panneton
# Description: This macro parses the provided argument string and sets the vars
# Parameters:
# ${test_args} = the argument string for the test
# Output:
# ${arguments} = whatever is left after stripping the arguments
# ${dup} = number or string to append to a duplicate test
#
MACRO(PARSE_TEST_ARGS test_args)
STRING(COMPARE NOTEQUAL "${test_args}" "" check)
IF(${check})
SET(arguments "${test_args}")
# Here we strip out any arguments for the testing suite
# ${dup}
STRING(REGEX MATCH "dup=.*;" dup "${test_args}")
STRING(REGEX REPLACE "dup=" "" dup "${dup}")
STRING(REGEX REPLACE ";" "" dup "${dup}")
STRING(REGEX REPLACE "dup=.*;" "" arguments "${arguments}")
ELSE(${check})
SET(arguments "") # Sanity Check
ENDIF(${check})
ENDMACRO(PARSE_TEST_ARGS test_args)
# Set Core Macro
# Author: Brian Panneton
# Description: This macro checks the directory provided to see if it is a core
# Parameters:
# dir = the directory to be checked
# Output:
# is_core = variable is set to 'Core' is core was found in dir
MACRO(SET_CORE dir)
STRING(REGEX MATCH "core" is_core "${dir}")
IF(EXISTS ${is_core})
SET(is_core "Core")
ENDIF(EXISTS ${is_core})
ENDMACRO(SET_CORE dir)
......@@ -8,7 +8,9 @@ SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake ${CMAKE_CURRENT_SOURCE_DIR}/core/CMake)
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/TestingSuite)
# Should we build with testing
option(XDMF_BUILD_TESTING OFF)
......@@ -35,6 +37,7 @@ endif(XDMF_WRAP_PYTHON OR XDMF_WRAP_JAVA)
# If we are wrapping python, let's include it in the top level
if(XDMF_WRAP_PYTHON)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
......
# List of global variables needed by tests
SET(defines
JAVA_TEST_DEPENDENCIES
JAVA_TEST_CLASSPATH
JAVA_TEST_LDPATH
JAVA_TEST_TARGETS
PYTHON_TEST_DEPENDENCIES
CXX_TEST_DEPENDENCIES
)
# Make sure they are defined
FOREACH(def IN LISTS defines)
GET_PROPERTY(is_defined GLOBAL PROPERTY ${def} DEFINED)
IF(NOT is_defined)
DEFINE_PROPERTY(GLOBAL PROPERTY ${def}
BRIEF_DOCS "${def}"
FULL_DOCS "${def} No Documentation"
)
ENDIF()
ENDFOREACH()
......@@ -7,7 +7,6 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
find_package(Boost REQUIRED)
if(Boost_FOUND)
......
# Include our test macros
include(AddTestsCxx)
# Add any dependencies that the cxx core tests may need
# Note: The tests already depend on their own file
SET_PROPERTY(GLOBAL APPEND PROPERTY CXX_TEST_DEPENDENCIES
"XdmfCore"
)
# Include our test macros
include (UseCxxTest)
ADD_TEST_CXX_DEPENDENCIES("XdmfCore")
# Add any cxx tests here:
# Note: We don't want to use a foreach loop to test the files incase we
# have extra arguments (ie: ADD_CXX_TEST(testname inputfile))
# have extra arguments (ie: ADD_TEST_CXX(testname inputfile))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
ADD_CXX_TEST(TestXdmfArray)
ADD_CXX_TEST(TestXdmfArrayWriteRead)
ADD_CXX_TEST(TestXdmfHDF5Controller)
ADD_CXX_TEST(TestXdmfHDF5Writer)
ADD_CXX_TEST(TestXdmfInformation)
ADD_TEST_CXX(TestXdmfArray)
ADD_TEST_CXX(TestXdmfArrayWriteRead)
ADD_TEST_CXX(TestXdmfHDF5Controller)
ADD_TEST_CXX(TestXdmfHDF5Writer)
ADD_TEST_CXX(TestXdmfInformation)
# Add any cxx cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
# have multiple files (ie: CLEAN_CXX_TEST(testname outputfile1 ...))
# have multiple files (ie: CLEAN_TEST_CXX(testname outputfile1 ...))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
CLEAN_CXX_TEST(TestXdmfArray)
CLEAN_CXX_TEST(TestXdmfArrayWriteRead
CLEAN_TEST_CXX(TestXdmfArray)
CLEAN_TEST_CXX(TestXdmfArrayWriteRead
test.h5)
CLEAN_CXX_TEST(TestXdmfHDF5Controller)
CLEAN_CXX_TEST(TestXdmfHDF5Writer
CLEAN_TEST_CXX(TestXdmfHDF5Controller)
CLEAN_TEST_CXX(TestXdmfHDF5Writer
hdf5WriterTest.h5)
CLEAN_CXX_TEST(TestXdmfInformation)
CLEAN_TEST_CXX(TestXdmfInformation)
INCLUDE(AddTestsJava)
#Add any dependencies that the java core tests may need
# Note: The tests already depend on their own file
SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_DEPENDENCIES
"${XDMF_CORE_JAVA_JAR}"
)
ADD_TEST_JAVA_DEPENDENCIES("${XDMF_CORE_JAVA_JAR}")
# Add any classpath directories that the java tests may need
# Note: JAVA_TEST_CLASSPATH is also set in core
GET_PROPERTY(java_classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_CLASSPATH
".:${XDMF_CORE_JAVA_JAR}:"
)
ADD_TEST_JAVA_CLASSPATH(".:${XDMF_CORE_JAVA_JAR}")
# Add any ldpath directories that the java tests may need
# Note: JAVA_TEST_LDPATH is also set in core
GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_LDPATH
"${CMAKE_BINARY_DIR}:"
)
# Include our test macros
include (UseJavaTest)
ADD_TEST_JAVA_LDPATH("${CMAKE_BINARY_DIR}")
# Add any java tests here:
# Note: We don't want to use a foreach loop to test the files incase we
# have extra arguments (ie: ADD_JAVA_TEST(testname inputfile))
# have extra arguments (ie: ADD_TEST_JAVA(testname inputfile))
# Read UseJavaTest.cmake for more information
# ------------------------
ADD_JAVA_TEST(TestXdmfEquals)
ADD_TEST_JAVA(TestXdmfEquals)
# Add any java cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
# have multiple files (ie: CLEAN_JAVA_TEST(testname outputfile1 ...))
# have multiple files (ie: CLEAN_TEST_JAVA(testname outputfile1 ...))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
CLEAN_JAVA_TEST(TestXdmfEquals)
CLEAN_TEST_JAVA(TestXdmfEquals)
# Add a custom target for all java tests
# Note: ${TARGETS} is set in ADD_JAVA_TEST
GET_PROPERTY(targets GLOBAL PROPERTY JAVA_TEST_TARGETS)
ADD_CUSTOM_TARGET(Java_Core_Test_target ALL DEPENDS XdmfCoreJava ${targets})
# Note: ${TARGETS} is set in ADD_TEST_JAVA
#GET_PROPERTY(targets GLOBAL PROPERTY JAVA_TEST_TARGETS)
#ADD_CUSTOM_TARGET(Java_Core_Test_target ALL DEPENDS XdmfCoreJava ${targets})
CREATE_TARGET_TEST_JAVA()
include(AddTestsPython)
# Add any dependencies that the python tests may need
# Note: The tests already depend on their own file
SET_PROPERTY(GLOBAL APPEND PROPERTY PYTHON_TEST_DEPENDENCIES
)
ADD_TEST_PYTHON_DEPENDENCIES("")
# Add any pythonpath directories that the python tests may need
GET_PROPERTY(python_pythonpath GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH)
SET_PROPERTY(GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH
"${CMAKE_BINARY_DIR}:"
)
# Include our test macros
include(UsePythonTest)
ADD_TEST_PYTHON_PYTHONPATH("${CMAKE_BINARY_DIR}")
# Add any python tests here:
# Note: we don't want to use a foreach loop to test the files incase we
# have extra arguments (ie: ADD_PYTHON_TEST(testname inputfile))
# have extra arguments (ie: ADD_TEST_PYTHON(testname inputfile))
# Read UsePythonTest.cmake for more information
# ---------------------
ADD_PYTHON_TEST(TestXdmfArray)
ADD_PYTHON_TEST(TestXdmfEquals)
ADD_TEST_PYTHON(TestXdmfArray)
ADD_TEST_PYTHON(TestXdmfEquals)
# Add any python cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
# have multiple files (ie: CLEAN_PYTHON_TEST(testname outputfile1 ...))
# have multiple files (ie: CLEAN_TEST_PYTHON(testname outputfile1 ...))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
CLEAN_PYTHON_TEST(TestXdmfArray)
CLEAN_PYTHON_TEST(TestXdmfEquals)
CLEAN_TEST_PYTHON(TestXdmfArray)
CLEAN_TEST_PYTHON(TestXdmfEquals)
# Add a custom target for all python tests
# Note: ${TARGETS} is set in ADD_PYTHON_TEST
GET_PROPERTY(targets GLOBAL PROPERTY PYTHON_TEST_TARGETS)
ADD_CUSTOM_TARGET(Python_Core_Test_target ALL DEPENDS ${targets})
# Note: ${TARGETS} is set in ADD_TEST_PYTHON
#GET_PROPERTY(targets GLOBAL PROPERTY PYTHON_TEST_TARGETS)
#ADD_CUSTOM_TARGET(Python_Core_Test_target ALL DEPENDS ${targets})
CREATE_TARGET_TEST_PYTHON()
# We need to reset the targets since we created a core target
SET_PROPERTY(GLOBAL PROPERTY PYTHON_TEST_TARGETS "")
#SET_PROPERTY(GLOBAL PROPERTY PYTHON_TEST_TARGETS "")
# Include our test macros
include(AddTestsCxx)
# Add any dependencies that the cxx tests may need
# Note: The tests already depend on their own file
SET_PROPERTY(GLOBAL APPEND PROPERTY CXX_TEST_DEPENDENCIES
"Xdmf"
)
# Include our test macros
include (UseCxxTest)
ADD_TEST_CXX_DEPENDENCIES("Xdmf")
# Add any cxx tests here:
# Note: We don't want to use a foreach loop to test the files incase we
# have extra arguments (id: ADD_CXX_TEST(testname inputfile))
# have extra arguments (id: ADD_TEST_CXX(testname inputfile))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
ADD_CXX_TEST(TestXdmfAttribute)
ADD_CXX_TEST(TestXdmfGeometry)
ADD_CXX_TEST(TestXdmfGrid)
ADD_CXX_TEST(TestXdmfGridCollection)
ADD_CXX_TEST(TestXdmfGridRegular)
ADD_CXX_TEST(TestXdmfReader)
ADD_CXX_TEST(TestXdmfSet)
ADD_CXX_TEST(TestXdmfTime)
ADD_CXX_TEST(TestXdmfTopology)
ADD_CXX_TEST(TestXdmfVisitorValueCounter)
ADD_CXX_TEST(TestXdmfWriter)
ADD_CXX_TEST(TestXdmfWriterHDF5ThenXML)
ADD_CXX_TEST(TestXdmfXPath)
ADD_TEST_CXX(TestXdmfAttribute)
ADD_TEST_CXX(TestXdmfGeometry)
ADD_TEST_CXX(TestXdmfGrid)
ADD_TEST_CXX(TestXdmfGridCollection)
ADD_TEST_CXX(TestXdmfGridRegular)
ADD_TEST_CXX(TestXdmfReader)
ADD_TEST_CXX(TestXdmfSet)
ADD_TEST_CXX(TestXdmfTime)
ADD_TEST_CXX(TestXdmfTopology)
ADD_TEST_CXX(TestXdmfVisitorValueCounter)
ADD_TEST_CXX(TestXdmfWriter)
ADD_TEST_CXX(TestXdmfWriterHDF5ThenXML)
ADD_TEST_CXX(TestXdmfXPath)
# Add any cxx cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
# have multiple files (ie: CLEAN_CXX_TEST(testname outputfile1 ...))
# have multiple files (ie: CLEAN_TEST_CXX(testname outputfile1 ...))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
CLEAN_CXX_TEST(TestXdmfAttribute)
CLEAN_CXX_TEST(TestXdmfGeometry)
CLEAN_CXX_TEST(TestXdmfGrid)
CLEAN_CXX_TEST(TestXdmfGridCollection
CLEAN_TEST_CXX(TestXdmfAttribute)
CLEAN_TEST_CXX(TestXdmfGeometry)
CLEAN_TEST_CXX(TestXdmfGrid)
CLEAN_TEST_CXX(TestXdmfGridCollection
TestXdmfGridCollection1.xmf
TestXdmfGridCollection2.xmf
TestXdmfGridCollectionHDF1.h5
TestXdmfGridCollectionHDF1.xmf
TestXdmfGridCollectionHDF2.xmf
)
CLEAN_CXX_TEST(TestXdmfGridRegular
CLEAN_TEST_CXX(TestXdmfGridRegular
TestXdmfGridRegular1.xmf
TestXdmfGridRegular2.xmf
)
CLEAN_CXX_TEST(TestXdmfReader
CLEAN_TEST_CXX(TestXdmfReader
TestXdmfReader1.h5
TestXdmfReader1.xmf
TestXdmfReader2.xmf
)
CLEAN_CXX_TEST(TestXdmfSet)
CLEAN_CXX_TEST(TestXdmfTime)
CLEAN_CXX_TEST(TestXdmfTopology)
CLEAN_CXX_TEST(TestXdmfVisitorValueCounter)
CLEAN_CXX_TEST(TestXdmfWriter
CLEAN_TEST_CXX(TestXdmfSet)
CLEAN_TEST_CXX(TestXdmfTime)
CLEAN_TEST_CXX(TestXdmfTopology)
CLEAN_TEST_CXX(TestXdmfVisitorValueCounter)
CLEAN_TEST_CXX(TestXdmfWriter
output.h5
output.xmf)
CLEAN_CXX_TEST(TestXdmfWriterHDF5ThenXML)
CLEAN_CXX_TEST(TestXdmfXPath
CLEAN_TEST_CXX(TestXdmfWriterHDF5ThenXML)