2008-12-09 01:39:30 +03:00
|
|
|
#
|
|
|
|
# This script launches a GUI test using Squish. You should not call
|
2009-04-19 20:47:01 +04:00
|
|
|
# the script directly; instead, you should access it via the
|
2008-12-09 01:39:30 +03:00
|
|
|
# SQUISH_ADD_TEST macro that is defined in FindSquish.cmake.
|
|
|
|
#
|
|
|
|
# This script starts the Squish server, launches the test on the
|
|
|
|
# client, and finally stops the squish server. If any of these steps
|
|
|
|
# fail (including if the tests do not pass) then a fatal error is
|
|
|
|
# raised.
|
|
|
|
#
|
|
|
|
|
2009-09-28 19:46:51 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2008-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:46:51 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2008-12-09 01:39:30 +03:00
|
|
|
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
|
|
|
|
|
|
|
# print out the variable that we are using
|
|
|
|
message(STATUS "squish_aut='${squish_aut}'")
|
|
|
|
|
|
|
|
message(STATUS "squish_server_executable='${squish_server_executable}'")
|
|
|
|
message(STATUS "squish_client_executable='${squish_client_executable}'")
|
|
|
|
message(STATUS "squish_libqtdir ='${squish_libqtdir}'")
|
|
|
|
message(STATUS "squish_test_case='${squish_test_case}'")
|
|
|
|
message(STATUS "squish_wrapper='${squish_wrapper}'")
|
|
|
|
message(STATUS "squish_env_vars='${squish_env_vars}'")
|
|
|
|
|
|
|
|
# parse enviornment variables
|
|
|
|
foreach(i ${squish_env_vars})
|
|
|
|
message(STATUS "parsing env var key/value pair ${i}")
|
|
|
|
string(REGEX MATCH "([^=]*)=(.*)" squish_env_name ${i})
|
|
|
|
message(STATUS "key=${CMAKE_MATCH_1}")
|
|
|
|
message(STATUS "value=${CMAKE_MATCH_2}")
|
|
|
|
set ( ENV{${CMAKE_MATCH_1}} ${CMAKE_MATCH_2} )
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if (QT4_INSTALLED)
|
|
|
|
# record qt lib directory
|
|
|
|
set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2008-12-09 01:39:30 +03:00
|
|
|
|
|
|
|
# run the test
|
|
|
|
if (WIN32)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
|
|
|
|
RESULT_VARIABLE test_rv
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2008-12-09 01:39:30 +03:00
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
|
|
|
|
RESULT_VARIABLE test_rv
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2008-12-09 01:39:30 +03:00
|
|
|
|
|
|
|
# check for an error with running the test
|
|
|
|
if(NOT "${test_rv}" STREQUAL "0")
|
|
|
|
message(FATAL_ERROR "Error running Squish test")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2008-12-09 01:39:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|