Tests/Contracts: Update test for VTK release branch

The plan is to reinstate the VTK contracts test so that CMake
& VTK devs will both be made aware when a change in CMake causes
build problems for VTK.
This commit is contained in:
Zack Galbreath 2013-12-02 15:44:38 -05:00 committed by Brad King
parent f282a0bf83
commit 1b173f25b4
5 changed files with 79 additions and 31 deletions

View File

@ -0,0 +1,48 @@
# The VTK external project for CMake
# ---------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8)
project(VTK)
include(ExternalProject)
# find "HOME". VTK will be downloaded & built within a subdirectory.
if(NOT DEFINED HOME)
if(DEFINED ENV{CTEST_REAL_HOME})
set(HOME "$ENV{CTEST_REAL_HOME}")
else()
set(HOME "$ENV{HOME}")
endif()
if(NOT HOME AND WIN32)
# Try for USERPROFILE as HOME equivalent:
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
# But just use root of SystemDrive if USERPROFILE contains any spaces:
# (Default on XP and earlier...)
if(HOME MATCHES " ")
string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
endif()
endif()
endif()
set(base_dir "${HOME}/.cmake/Contracts/VTK")
set(stamp_dir "${base_dir}/stamp")
if(NOT DEFINED SITE)
site_name(SITE)
endif()
# configure our dashboard script
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Dashboard.cmake.in
${base_dir}/Dashboard.cmake
@ONLY)
# build & test VTK's release branch
ExternalProject_Add(${PROJECT_NAME}
GIT_REPOSITORY "git://vtk.org/VTK.git"
GIT_TAG "release"
STAMP_DIR ${stamp_dir}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_CTEST_COMMAND} -S "${base_dir}/Dashboard.cmake"
INSTALL_COMMAND ""
)

View File

@ -0,0 +1,28 @@
set(CTEST_SITE "@SITE@")
set(CTEST_BUILD_NAME "Contracts.VTK")
set(CTEST_DASHBOARD_ROOT "@base_dir@")
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/VTK")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/VTK-build")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_CONFIGURATION_TYPE Debug)
# Assume a Linux build, with a make that supports -j9. Modify this script if
# assumption is ever invalid.
#
set(CTEST_BUILD_COMMAND "@CMAKE_MAKE_PROGRAM@ -j9 -i")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
BUILD_EXAMPLES:BOOL=ON
BUILD_TESTING:BOOL=ON
VTK_WRAP_PYTHON:BOOL=ON
ExternalData_OBJECT_STORES:FILEPATH=@base_dir@/ExternalData
")
ctest_start(Nightly)
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE "PythonSmoke")
ctest_submit(BUILD "${CTEST_BINARY_DIRECTORY}")

View File

@ -0,0 +1,3 @@
set(exe "$ENV{HOME}/.cmake/Contracts/VTK/VTK-build/bin/vtkCommonCoreCxxTests")
set(args otherArrays)
set(VTK_RUN_TEST ${exe} ${args})

View File

@ -1,30 +0,0 @@
# The VTK external project for CMake
# ---------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8)
project(vtk542)
include(ExternalProject)
set(vtk_source "${CMAKE_CURRENT_BINARY_DIR}/VTK-source")
set(vtk_binary "${CMAKE_CURRENT_BINARY_DIR}/VTK-build")
ExternalProject_Add(VTK
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
URL "http://www.vtk.org/files/release/5.4/vtk-5.4.2.tar.gz"
URL_MD5 c2c797091d4b2128d9a1bd32c4b78227
SOURCE_DIR ${vtk_source}
BINARY_DIR ${vtk_binary}
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS
-DBUILD_EXAMPLES:BOOL=ON
-DBUILD_TESTING:BOOL=ON
INSTALL_COMMAND ""
)
# make it so that each build will run make in the VTK build tree
ExternalProject_Add_Step(VTK forcebuild
COMMAND ${CMAKE_COMMAND}
-E remove ${CMAKE_CURRENT_BUILD_DIR}/VTK-prefix/src/VTK-stamp/VTK-build
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)

View File

@ -1 +0,0 @@
set(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays)