2 # This script launches a GUI test using Squish. You should not call
3 # the script directly; instead, you should access it via the
4 # SQUISH_ADD_TEST macro that is defined in FindSquish.cmake.
6 # This script starts the Squish server, launches the test on the
7 # client, and finally stops the squish server. If any of these steps
8 # fail (including if the tests do not pass) then a fatal error is
12 #=============================================================================
13 # Copyright 2008-2009 Kitware, Inc.
15 # Distributed under the OSI-approved BSD License (the "License");
16 # see accompanying file Copyright.txt for details.
18 # This software is distributed WITHOUT ANY WARRANTY; without even the
19 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 # See the License for more information.
21 #=============================================================================
22 # (To distribute this file outside of CMake, substitute the full
23 # License text for the above reference.)
25 cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
27 # print out the variable that we are using
28 message(STATUS "squish_aut='${squish_aut}'")
30 message(STATUS "squish_server_executable='${squish_server_executable}'")
31 message(STATUS "squish_client_executable='${squish_client_executable}'")
32 message(STATUS "squish_libqtdir ='${squish_libqtdir}'")
33 message(STATUS "squish_test_case='${squish_test_case}'")
34 message(STATUS "squish_wrapper='${squish_wrapper}'")
35 message(STATUS "squish_env_vars='${squish_env_vars}'")
37 # parse enviornment variables
38 foreach(i ${squish_env_vars})
39 message(STATUS "parsing env var key/value pair ${i}")
40 string(REGEX MATCH "([^=]*)=(.*)" squish_env_name ${i})
41 message(STATUS "key=${CMAKE_MATCH_1}")
42 message(STATUS "value=${CMAKE_MATCH_2}")
43 set ( ENV{${CMAKE_MATCH_1}} ${CMAKE_MATCH_2} )
47 # record Qt lib directory
48 set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
54 COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
55 RESULT_VARIABLE test_rv
61 COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
62 RESULT_VARIABLE test_rv
66 # check for an error with running the test
67 if(NOT "${test_rv}" STREQUAL "0")
68 message(FATAL_ERROR "Error running Squish test")