Commit 41f72735 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

tests: port paraview tests

parent c3290e4d
......@@ -179,5 +179,3 @@ function (superbuild_add_packaging)
endfunction ()
process_dependencies()
add_subdirectory(Testing)
#cmake_dependent_option(TEST_NIGHTLY_BINARIES
# "When enabled, tests are run on binaries downloaded from the specified URL rather than generated binaries" OFF
# BUILD_TESTING OFF)
mark_as_advanced(TEST_NIGHTLY_BINARIES)
if (NOT BUILD_TESTING)
return()
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/tests.cmake)
# This needs the following variables to be set.
# PARAVIEW_EXECUTABLE
# PVPYTHON_EXECUTABLE
# PVSERVER_EXECUTABLE
# PVBATCH_EXECUTABLE
#------------------------------------------------------------------------------
set (INSTALLED_PACKAGE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/InstalledPackageRoot")
if(WIN32)
set (glob_pattern "ParaView*.zip")
set (package_generation_test "GenerateParaViewPackage-ZIP")
set (PARAVIEW_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/paraview.exe")
set (PVPYTHON_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/pvpython.exe")
set (PVSERVER_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/pvserver.exe")
set (PVBATCH_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/pvbatch.exe")
elseif(APPLE)
set (glob_pattern "ParaView*.dmg")
set (package_generation_test "GenerateParaViewPackage")
set (PARAVIEW_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/paraview.app/Contents/MacOS/paraview")
set (PVPYTHON_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/paraview.app/Contents/bin/pvpython")
set (PVSERVER_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/paraview.app/Contents/bin/pvserver")
set (PVBATCH_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/paraview.app/Contents/bin/pvbatch")
else()
set (glob_pattern "ParaView*.tar.gz")
set (package_generation_test "GenerateParaViewPackage")
set (PARAVIEW_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/paraview")
set (PVPYTHON_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/pvpython")
set (PVSERVER_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/pvserver")
set (PVBATCH_EXECUTABLE "${INSTALLED_PACKAGE_ROOT}/bin/pvbatch")
endif()
add_test(NAME PrepareBinariesForTesting
COMMAND ${CMAKE_COMMAND}
-DBINARY_DIRECTORY:PATH=${ParaViewSuperBuild_BINARY_DIR}
-DOUTPUT_DIRECTORY:PATH=${INSTALLED_PACKAGE_ROOT}
-DGLOB_PATTERN:STRING=${glob_pattern}
-P ${CMAKE_CURRENT_LIST_DIR}/PrepareBinaries.cmake
)
set_tests_properties(PrepareBinariesForTesting PROPERTIES
LABELS "PARAVIEW" DEPENDS ${package_generation_test})
#------------------------------------------------------------------------------
# Simple test to launch the application and load all plugins.
add_test(NAME TestUI
COMMAND "${PARAVIEW_EXECUTABLE}"
"-dr"
"--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestUI.xml"
"--exit")
set_tests_properties(TestUI PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#------------------------------------------------------------------------------
# Simple test to test paraviewweb.
#
# if (NOT WIN32)
# # we don't package ParaViewWeb on Windows anymore.
# add_test(NAME Test-pvweb
# COMMAND "${PVPYTHON_EXECUTABLE}"
# "${CMAKE_CURRENT_SOURCE_DIR}/basic_paraviewweb.py")
# set_tests_properties(Test-pvweb PROPERTIES
# LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
# endif()
#------------------------------------------------------------------------------
# Simple test to test pvpython/pvbatch.
add_test(NAME Test-pvpython
COMMAND "${PVPYTHON_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/basic_python.py")
set_tests_properties(Test-pvpython PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
if (NOT WIN32)
# Windows MPI has issues with pvbatch.
add_test(NAME Test-pvbatch
COMMAND "${PVBATCH_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/basic_python.py")
set_tests_properties(Test-pvbatch PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
endif()
# Test to load various data files to ensure reader support.
#----------------------------------------------------------------------------
add_test(NAME TestData-csg.silo
COMMAND "${PARAVIEW_EXECUTABLE}"
"-dr"
"--data=${CMAKE_CURRENT_SOURCE_DIR}/Data/csg.silo"
"--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestData-cs_silo.xml"
"--exit")
set_tests_properties(TestData-csg.silo PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
add_test(NAME TestData-5blocks.cgns
COMMAND "${PARAVIEW_EXECUTABLE}"
"-dr"
"--data=${CMAKE_CURRENT_SOURCE_DIR}/Data/5blocks.cgns"
"--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestData-5blocks_cgns.xml"
"--exit")
set_tests_properties(TestData-5blocks.cgns PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
# Disabling this test for now since the Data file is too big. We probably need
# to add support for Data repository similar to ParaView/VTK soon.
#add_test(NAME TestData-Scenario1_p1.xmf
# COMMAND "${PARAVIEW_EXECUTABLE}"
# "-dr"
# "--data=${CMAKE_CURRENT_SOURCE_DIR}/Data/Scenario1_p1.xmf"
# "--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
# "--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestData.xml"
# "--exit")
#set_tests_properties(TestData-Scenario1_p1.xmf PROPERTIES
# LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
add_test(NAME TestMatplotlib
COMMAND "${PARAVIEW_EXECUTABLE}"
"-dr"
"--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestMatplotlib.xml"
"--test-baseline=${CMAKE_CURRENT_SOURCE_DIR}/Baselines/Superbuild-TestMatplotlib.png"
"--exit")
set_tests_properties(TestMatplotlib PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
add_test(NAME TestPythonView
COMMAND "${PARAVIEW_EXECUTABLE}"
"-dr"
"--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestPythonView.xml"
"--test-baseline=${CMAKE_CURRENT_SOURCE_DIR}/Baselines/TestPythonView.png"
"--exit")
set_tests_properties(TestPythonView PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
add_test(NAME TestFindData
COMMAND "${PARAVIEW_EXECUTABLE}"
"-dr"
"--test-directory=${SuperBuild_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_SOURCE_DIR}/TestFindData.xml"
"--test-baseline=${CMAKE_CURRENT_SOURCE_DIR}/Baselines/Superbuild-TestFindData.png"
"--exit")
set_tests_properties(TestFindData PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
add_test(NAME PrintVersionServer COMMAND "${PVSERVER_EXECUTABLE}" "--version")
set_tests_properties(PrintVersionServer PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
#----------------------------------------------------------------------------
add_test(NAME PrintVersionClient COMMAND "${PARAVIEW_EXECUTABLE}" "--version")
set_tests_properties(PrintVersionClient PROPERTIES
LABELS "PARAVIEW" DEPENDS "PrepareBinariesForTesting")
......@@ -5,6 +5,10 @@ if (PARAVIEW_TEST_REMOTE_WEB)
include("${CMAKE_CURRENT_LIST_DIR}/paraview.test.web.cmake")
endif ()
if (paraview_enabled)
include("${CMAKE_CURRENT_LIST_DIR}/paraview.test.cmake")
endif ()
if (paraviewsdk_enabled)
include("${CMAKE_CURRENT_LIST_DIR}/paraviewsdk.test.cmake")
endif ()
#------------------------------------------------------------------------------
set(paraview_extract_dir "${CMAKE_CURRENT_BINARY_DIR}/test-extraction")
if (WIN32)
set(generator "ZIP")
set(paraview_exe "${paraview_extract_dir}/bin/paraview.exe")
set(pvpython_exe "${paraview_extract_dir}/bin/pvpython.exe")
set(pvserver_exe "${paraview_extract_dir}/bin/pvserver.exe")
set(pvbatch_exe "${paraview_extract_dir}/bin/pvbatch.exe")
elseif (APPLE)
set(generator "DragNDrop")
set(paraview_exe "${paraview_extract_dir}/paraview.app/Contents/MacOS/paraview")
set(pvpython_exe "${paraview_extract_dir}/paraview.app/Contents/bin/pvpython")
set(pvserver_exe "${paraview_extract_dir}/paraview.app/Contents/bin/pvserver")
set(pvbatch_exe "${paraview_extract_dir}/paraview.app/Contents/bin/pvbatch")
else ()
set(generator "TGZ")
set(glob_pattern "ParaView*.tar.gz")
set(paraview_exe "${paraview_extract_dir}/bin/paraview")
set(pvpython_exe "${paraview_extract_dir}/bin/pvpython")
set(pvserver_exe "${paraview_extract_dir}/bin/pvserver")
set(pvbatch_exe "${paraview_extract_dir}/bin/pvbatch")
endif ()
superbuild_add_extract_test("${generator}" "${paraview_extract_dir}"
LABEL "PARAVIEW")
set(paraview_tests)
set(gui_enabled FALSE)
if (qt4_enabled OR qt5_enabled)
set(gui_enabled TRUE)
endif ()
#------------------------------------------------------------------------------
# Simple test to launch the application and load all plugins.
add_test(
NAME paraview-testui
COMMAND "${paraview_exe}"
"-dr"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestUI.xml"
"--exit")
list(APPEND paraview_tests
paraview-testui)
#------------------------------------------------------------------------------
# Simple test to test pvpython/pvbatch.
if (python_enabled)
add_test(
NAME paraview-pvpython
COMMAND "${pvpython_exe}"
"${CMAKE_CURRENT_LIST_DIR}/python/basic_python.py")
list(APPEND paraview_tests
paraview-pvpython)
if (NOT WIN32)
# MSMPI has issues with pvbatch.
add_test(
NAME paraview-pvbatch
COMMAND "${pvbatch_exe}"
"${CMAKE_CURRENT_LIST_DIR}/python/basic_python.py")
list(APPEND paraview_tests
paraview-pvbatch)
endif ()
endif ()
#----------------------------------------------------------------------------
# Test to load various data files to ensure reader support.
if (cgns_enabled AND gui_enabled)
add_test(
NAME paraview-data-csg.silo
COMMAND "${paraview_exe}"
"-dr"
"--data=${CMAKE_CURRENT_LIST_DIR}/data/csg.silo"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestData-cs_silo.xml"
"--exit")
list(APPEND paraview_tests
paraview-data-csg.silo)
#----------------------------------------------------------------------------
add_test(
NAME paraview-data-5blocks.cgns
COMMAND "${paraview_exe}"
"-dr"
"--data=${CMAKE_CURRENT_LIST_DIR}/data/5blocks.cgns"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestData-5blocks_cgns.xml"
"--exit")
list(APPEND paraview_tests
paraview-data-5blocks.cgns)
endif ()
#----------------------------------------------------------------------------
# Disabling this test for now since the Data file is too big. We probably need
# to add support for Data repository similar to ParaView/VTK soon.
if (gui_enabled AND xdmf3_enabled AND FALSE)
add_test(
NAME paraview-data-Scenario1_p1.xmf
COMMAND "${paraview_exe}"
"-dr"
"--data=${CMAKE_CURRENT_LIST_DIR}/data/Scenario1_p1.xmf"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestData.xml"
"--exit")
list(APPEND paraview_tests
paraview-data-Scenario1_p1.xmf)
endif ()
#----------------------------------------------------------------------------
if (matplotlib_enabled)
add_test(
NAME paraview-matplotlib
COMMAND "${paraview_exe}"
"-dr"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestMatplotlib.xml"
"--test-baseline=${CMAKE_CURRENT_LIST_DIR}/baselines/Superbuild-TestMatplotlib.png"
"--exit")
list(APPEND paraview_tests
paraview-matplotlib)
endif ()
#----------------------------------------------------------------------------
if (python_enabled)
add_test(
NAME paraview-pythonview
COMMAND "${paraview_exe}"
"-dr"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestPythonView.xml"
"--test-baseline=${CMAKE_CURRENT_LIST_DIR}/baselines/TestPythonView.png"
"--exit")
list(APPEND paraview_tests
paraview-pythonview)
endif ()
#----------------------------------------------------------------------------
if (gui_enabled)
add_test(
NAME paraview-finddata
COMMAND "${paraview_exe}"
"-dr"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${CMAKE_CURRENT_LIST_DIR}/xml/TestFindData.xml"
"--test-baseline=${CMAKE_CURRENT_LIST_DIR}/baselines/Superbuild-TestFindData.png"
"--exit")
list(APPEND paraview_tests
paraview-finddata)
endif ()
#----------------------------------------------------------------------------
add_test(
NAME paraview-version-server
COMMAND "${pvserver_exe}"
"--version")
list(APPEND paraview_tests
paraview-version-server)
#----------------------------------------------------------------------------
if (gui_enabled)
add_test(
NAME paraview-version-client
COMMAND "${paraview_exe}"
"--version")
list(APPEND paraview_tests
paraview-version-client)
endif ()
#----------------------------------------------------------------------------
set_tests_properties(${paraview_tests}
PROPERTIES
LABELS "PARAVIEW"
DEPENDS "extract-${generator}")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment