Skip to content

Commit 852470c

Browse files
committed
SquishTests: Update and clean up toggling of QML debugging
- The old code was waiting for labels but their properties were outdated. Since these were only used to issue a warning, I removed them. - After removing that, the remaining code branches could be merged. - The branch for CMake would try clicking a button which would not appear at this point in time anymore. That dialog - with changed properties - will now be shown when starting a build. It didn't matter because that brach was unused anyway. I removed it. Change-Id: I564ea7a7c918ba910d50cc42306683613222226d Reviewed-by: Christian Stenger <[email protected]>
1 parent 88446ae commit 852470c

File tree

2 files changed

+8
-36
lines changed

2 files changed

+8
-36
lines changed

tests/system/objects.map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@
213213
:scrollArea.Details_Utils::DetailsButton {text='Details' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
214214
:scrollArea.Edit build configuration:_QComboBox {leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'}
215215
:scrollArea.Edit build configuration:_QLabel {text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'}
216-
:scrollArea.Library not available_QLabel {name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
217216
:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {name='SrcFileName' type='Utils::FancyLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'}
218217
:splitter.Commit File(s)_VcsBase::QActionPushButton {text~='(Commit .+/.+ File.*)' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
219218
:splitter.Description_QGroupBox {container=':Qt Creator.splitter_QSplitter' name='descriptionBox' title='Description' type='QGroupBox' visible='1'}

tests/system/shared/build_utils.py

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -142,41 +142,14 @@ def verifyBuildConfig(currentTarget, configName, shouldBeDebug=False, enableShad
142142

143143
buildCfCombo = waitForObject("{leftWidget=':scrollArea.Edit build configuration:_QLabel' "
144144
"type='QComboBox' unnamed='1' visible='1'}")
145-
if shouldBeDebug:
146-
test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build")
147-
else:
148-
test.compare(buildCfCombo.currentText, 'Release', "Verifying whether it's a release build")
149-
if enableQmlDebug:
150-
try:
151-
libLabel = waitForObject(":scrollArea.Library not available_QLabel", 2000)
152-
mouseClick(libLabel, libLabel.width - 10, libLabel.height / 2, 0, Qt.LeftButton)
153-
except:
154-
pass
155-
# Since waitForObject waits for the object to be enabled,
156-
# it will wait here until compilation of the debug libraries has finished.
157-
runCMakeButton = ("{type='QPushButton' text='Run CMake' unnamed='1' "
158-
"window=':Qt Creator_Core::Internal::MainWindow'}")
159-
qmlDebuggingCombo = findObject(':Qt Creator.QML debugging and profiling:_QComboBox')
160-
if selectFromCombo(qmlDebuggingCombo, 'Enable'):
161-
if buildSystem is None or buildSystem == "CMake": # re-run cmake to apply
162-
clickButton(waitForObject(runCMakeButton))
163-
elif buildSystem == "qmake": # Don't rebuild now
164-
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
165-
try:
166-
problemFound = waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' "
167-
"type='QLabel' name='problemLabel' visible='1'}", 1000)
168-
if problemFound:
169-
test.warning('%s' % problemFound.text)
170-
except:
171-
pass
172-
else:
173-
qmlDebuggingCombo = findObject(':Qt Creator.QML debugging and profiling:_QComboBox')
174-
if selectFromCombo(qmlDebuggingCombo, "Disable"):
175-
test.log("Qml debugging libraries are available - unchecked qml debugging.")
176-
if buildSystem is None or buildSystem == "CMake": # re-run cmake to apply
177-
clickButton(waitForObject(runCMakeButton))
178-
elif buildSystem == "qmake": # Don't rebuild now
179-
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
145+
buildType = "Debug" if shouldBeDebug else "Release"
146+
test.compare(buildCfCombo.currentText, buildType,
147+
"Verifying whether it's a %s build" % buildType)
148+
qmlDebuggingCombo = waitForObject(':Qt Creator.QML debugging and profiling:_QComboBox')
149+
if (selectFromCombo(qmlDebuggingCombo, "Enable" if enableQmlDebug else "Disable")
150+
and buildSystem == "qmake"):
151+
# Don't rebuild now
152+
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
180153
clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton"))
181154
switchViewTo(ViewConstants.EDIT)
182155

0 commit comments

Comments
 (0)