From 0bc4fa2be22a7973b8968a392f28fff59aa115e3 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn <gladhorn@kde.org> Date: Thu, 16 Apr 2020 23:48:05 +0200 Subject: FindSquish: Fix finding on Windows The whole script looks rather dated and dusty, but it actually does find newer Squish versions - e.g. version 6.5 here. I assume more work is needed, but at least with this tiny patch the path is located on Windws when the SQUISH_INSTALL_DIR environment variable is set. --- Modules/FindSquish.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index 7d49505..e6f3ad4 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -137,7 +137,8 @@ if(NOT SQUISH_INSTALL_DIR) string(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}") # Look for an installation - find_path(SQUISH_INSTALL_DIR bin/squishrunner + find_path(SQUISH_INSTALL_DIR + NAMES bin/squishrunner bin/squishrunner.exe HINTS # Look for an environment variable SQUISH_INSTALL_DIR. ENV SQUISH_INSTALL_DIR -- cgit v0.12 From 879b279154fd3b7593c80a429b4c05fcd532175b Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn <frederik.gladhorn@remarkable.com> Date: Mon, 20 Apr 2020 22:04:45 +0200 Subject: FindSquish: Fix launching the Squish server process on Windows There are countless posts (e.g. stack overflow) that start /b takes a window title as first argument. Once I added a random string there the server was started and things started to work. --- Modules/Squish4RunTestCase.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Squish4RunTestCase.bat b/Modules/Squish4RunTestCase.bat index ad1cc8c..5bd815a 100755 --- a/Modules/Squish4RunTestCase.bat +++ b/Modules/Squish4RunTestCase.bat @@ -12,7 +12,7 @@ echo "Adding AUT... %SQUISHSERVER% --config addAUT %AUT% %AUTDIR%" %SQUISHSERVER% --config addAUT "%AUT%" "%AUTDIR%" echo "Starting the squish server... %SQUISHSERVER%" -start /B %SQUISHSERVER% +start /B "Squish Server" %SQUISHSERVER% echo "Running the test case...%SQUISHRUNNER% --testsuite %TESTSUITE% --testcase %TESTCASE%" %SQUISHRUNNER% --testsuite "%TESTSUITE%" --testcase "%TESTCASE%" -- cgit v0.12 From c77c92791c3a1d80e691c70b6018e51bdcf4e465 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn <frederik.gladhorn@remarkable.com> Date: Mon, 20 Apr 2020 22:07:57 +0200 Subject: FindSquish: Fix setting the application under test The AUT (application under test) was previously set by trying to extract the target location, which is no longer supported. --- Modules/FindSquish.cmake | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index e6f3ad4..eec8876 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -260,10 +260,6 @@ function(SQUISH_V4_ADD_TEST testName) message(FATAL_ERROR "Required argument TEST not given for SQUISH_ADD_TEST()") endif() - get_target_property(testAUTLocation ${_SQUISH_AUT} LOCATION) - get_filename_component(testAUTDir ${testAUTLocation} PATH) - get_filename_component(testAUTName ${testAUTLocation} NAME) - get_filename_component(absTestSuite "${_SQUISH_SUITE}" ABSOLUTE) if(NOT EXISTS "${absTestSuite}") message(FATAL_ERROR "Could not find squish test suite ${_SQUISH_SUITE} (checked ${absTestSuite})") @@ -278,11 +274,11 @@ function(SQUISH_V4_ADD_TEST testName) set(_SQUISH_SETTINGSGROUP "CTest_$ENV{LOGNAME}") endif() - add_test(${testName} - ${CMAKE_COMMAND} -V -VV + add_test(NAME ${testName} + COMMAND ${CMAKE_COMMAND} -V -VV "-Dsquish_version:STRING=4" - "-Dsquish_aut:STRING=${testAUTName}" - "-Dsquish_aut_dir:STRING=${testAUTDir}" + "-Dsquish_aut:STRING=$<TARGET_FILE_NAME:${_SQUISH_AUT}>" + "-Dsquish_aut_dir:STRING=$<TARGET_FILE_DIR:${_SQUISH_AUT}>" "-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}" "-Dsquish_client_executable:STRING=${SQUISH_CLIENT_EXECUTABLE}" "-Dsquish_libqtdir:STRING=${QT_LIBRARY_DIR}" -- cgit v0.12