aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Löhning <robert.loehning@qt.io>2022-10-20 23:07:08 +0200
committerRobert Löhning <robert.loehning@qt.io>2022-10-26 10:40:25 +0000
commit5bb883e7b807db667edbd6f0c0fa5a72f42c29fb (patch)
treed02e00edfc8d2be26353f8e3c63edc4e576216b0
parent927d8fd7d6ef6aecbd60ae02a7a31d07c4020a0e (diff)
Squish: Read expected Qt VS Tools version from environment variable
Change-Id: Ic20ac7a26b0defa24f9108156f775e482e701a37 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r--Tests/system/Readme.txt3
-rw-r--r--Tests/system/shared/utils.py11
2 files changed, 11 insertions, 3 deletions
diff --git a/Tests/system/Readme.txt b/Tests/system/Readme.txt
index 93d931d7..a24616d3 100644
--- a/Tests/system/Readme.txt
+++ b/Tests/system/Readme.txt
@@ -10,3 +10,6 @@ To run these tests:
Please note: The tests will run in your normal working environment. Settings you made may influence
the tests and vice versa.
+
+Some tests require the following environment variables to be set to the correct values:
+SQUISH_VSTOOLS_VERSION: The expected version of Qt VS Tools
diff --git a/Tests/system/shared/utils.py b/Tests/system/shared/utils.py
index e7551895..a7f4756d 100644
--- a/Tests/system/shared/utils.py
+++ b/Tests/system/shared/utils.py
@@ -83,6 +83,12 @@ def changesScheduledLabelExists():
def readExpectedVsToolsVersion():
+ expectedVersion = os.getenv("SQUISH_VSTOOLS_VERSION")
+ if expectedVersion:
+ return expectedVersion
+ test.warning("No expected Qt VS Tools version set.",
+ "The environment variable SQUISH_VSTOOLS_VERSION is not set. Falling back to "
+ "reading the expected version from version.targets")
try:
versionXml = minidom.parse("../../../../version.targets")
return versionXml.getElementsByTagName("QtVSToolsVersion")[0].firstChild.data
@@ -94,9 +100,8 @@ def readExpectedVsToolsVersion():
def verifyVsToolsVersion():
displayedVersion = waitForObjectExists(names.manage_Extensions_Version_Label).text
expectedVersion = readExpectedVsToolsVersion()
- test.verify(expectedVersion and displayedVersion.startswith(expectedVersion),
- "Expected version of VS Tools is displayed? Displayed: %s, Expected: %s"
- % (displayedVersion, expectedVersion))
+ test.compare(displayedVersion, expectedVersion,
+ "Expected version of VS Tools is displayed?")
def openVsToolsMenu(version):