2 # This script launches a GUI test using Squish. You should not call
3 # the script directly; instead, you should acces 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 cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
14 # print out the variable that we are using
15 message(STATUS "squish_aut='${squish_aut}'")
17 message(STATUS "squish_server_executable='${squish_server_executable}'")
18 message(STATUS "squish_client_executable='${squish_client_executable}'")
19 message(STATUS "squish_libqtdir ='${squish_libqtdir}'")
20 message(STATUS "squish_test_case='${squish_test_case}'")
21 message(STATUS "squish_wrapper='${squish_wrapper}'")
22 message(STATUS "squish_env_vars='${squish_env_vars}'")
24 # parse enviornment variables
25 foreach(i ${squish_env_vars})
26 message(STATUS "parsing env var key/value pair ${i}")
27 string(REGEX MATCH "([^=]*)=(.*)" squish_env_name ${i})
28 message(STATUS "key=${CMAKE_MATCH_1}")
29 message(STATUS "value=${CMAKE_MATCH_2}")
30 set ( ENV{${CMAKE_MATCH_1}} ${CMAKE_MATCH_2} )
34 # record qt lib directory
35 set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
41 COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
42 RESULT_VARIABLE test_rv
48 COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
49 RESULT_VARIABLE test_rv
53 # check for an error with running the test
54 if(NOT "${test_rv}" STREQUAL "0")
55 message(FATAL_ERROR "Error running Squish test")
56 endif(NOT "${test_rv}" STREQUAL "0")