2013-05-15 13:17:33 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#############################################################################
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								##
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-14 18:07:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## Copyright (C) 2015 The Qt Company Ltd.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Contact: http://www.qt.io/licensing
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-15 13:17:33 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								##
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## This file is part of Qt Creator.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								##
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Commercial License Usage
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Licensees holding valid commercial Qt licenses may use this file in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## accordance with the commercial license agreement provided with the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Software or, alternatively, in accordance with the terms contained in
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-14 18:07:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## a written agreement between you and The Qt Company.  For licensing terms and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## conditions see http://www.qt.io/terms-conditions.  For further information
							 | 
						
					
						
							
								
									
										
										
										
											2014-10-01 13:21:18 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## use the contact form at http://www.qt.io/contact-us.
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-15 13:17:33 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								##
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## GNU Lesser General Public License Usage
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Alternatively, this file may be used under the terms of the GNU Lesser
							 | 
						
					
						
							
								
									
										
										
										
											2014-10-01 13:21:18 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## General Public License version 2.1 or version 3 as published by the Free
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Software Foundation and appearing in the file LICENSE.LGPLv21 and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## LICENSE.LGPLv3 included in the packaging of this file.  Please review the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## following information to ensure the GNU Lesser General Public License
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-13 16:51:38 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-15 13:17:33 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								##
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-14 18:07:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## In addition, as a special exception, The Qt Company gives you certain additional
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## rights.  These rights are described in The Qt Company LGPL Exception
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-15 13:17:33 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								##
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#############################################################################
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								source("../../shared/qtcreator.py")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								def main():
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    startApplication("qtcreator" + SettingsPath)
							 | 
						
					
						
							
								
									
										
										
										
											2013-02-22 14:31:39 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    if not startedWithoutPluginError():
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        return
							 | 
						
					
						
							
								
									
										
										
										
											2013-11-22 16:47:11 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Requires Qt 4.8
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-19 12:37:49 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    targets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # using a temporary directory won't mess up a potentially existing
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    workingDir = tempDir()
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-08 14:05:17 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targets)
							 | 
						
					
						
							
								
									
										
										
										
											2012-09-05 16:49:35 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if placeCursorToLine(editor, "MouseArea.*", True):
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        type(editor, '<Up>')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        type(editor, '<Return>')
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-11 17:38:58 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        typeLines(editor, ['Timer {',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                           'interval: 1000',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                           'running: true',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                           'onTriggered: console.log("Break here")'])
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        invokeMenuItem("File", "Save All")
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-03 11:47:35 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        filesAndLines = [
							 | 
						
					
						
							
								
									
										
										
										
											2014-04-08 15:34:46 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                        { "%s.Resources.qml\.qrc./.main\\.qml" % projectName : 'onTriggered.*' },
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-03 11:47:35 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                        { "%s.Sources.main\\.cpp" % projectName : "viewer.setOrientation\\(.+\\);" }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        ]
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        test.log("Setting breakpoints")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        result = setBreakpointsForCurrentProject(filesAndLines)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        if result:
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-08 10:49:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):10},
							 | 
						
					
						
							
								
									
										
										
										
											2014-04-08 15:34:46 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                                        {os.path.join(workingDir, projectName, "main.qml"):10}]
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-11 17:38:58 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            # Only use 4.7.4 to work around QTBUG-25187
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-18 16:31:48 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 15:50:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            progressBarWait()
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            if not availableConfigs:
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-11 17:38:58 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                test.fatal("Haven't found a suitable Qt version (need Qt 4.7.4) - leaving without debugging.")
							 | 
						
					
						
							
								
									
										
										
										
											2012-10-29 19:22:43 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            for kit, config in availableConfigs:
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                test.log("Selecting '%s' as build config" % config)
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-15 11:39:33 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                verifyBuildConfig(len(checkedTargets), kit, config, True, enableQmlDebug=True)
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                # explicitly build before start debugging for adding the executable as allowed program to WinFW
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                invokeMenuItem("Build", "Rebuild All")
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-21 17:29:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                waitForCompile(300000)
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                if not checkCompile():
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    test.fatal("Compile had errors... Skipping current build config")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    continue
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                allowAppThroughWinFW(workingDir, projectName, False)
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-18 16:31:48 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                if not doSimpleDebugging(len(checkedTargets), kit, config,
							 | 
						
					
						
							
								
									
										
										
										
											2014-02-28 16:28:38 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                                         len(expectedBreakpointsOrder), expectedBreakpointsOrder):
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    try:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        stopB = findObject(':Qt Creator.Stop_QToolButton')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        if stopB.enabled:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                            clickButton(stopB)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    except:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        pass
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                deleteAppFromWinFW(workingDir, projectName, False)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                # close application output window of current run to avoid mixing older output on the next run
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                clickButton(waitForObject("{type='CloseButton' unnamed='1' visible='1' "
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                          "window=':Qt Creator_Core::Internal::MainWindow'}"))
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-25 17:54:52 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                try:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    clickButton(waitForObject(":Close Debugging Session.Yes_QPushButton", 2000))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                except:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    pass
							 | 
						
					
						
							
								
									
										
										
										
											2014-02-28 16:28:38 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                if platform.system() == 'Darwin' and JIRA.isBugStillOpen(11595):
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    try:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        expectedBreakpointsOrder.remove({os.path.join(workingDir, projectName, "main.cpp"):10})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        test.warning("Removed cpp file after first run. (QTCREATORBUG-11595)")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    except:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        pass
							 | 
						
					
						
							
								
									
										
										
										
											2012-03-26 14:13:39 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        else:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								            test.fatal("Setting breakpoints failed - leaving without testing.")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    invokeMenuItem("File", "Exit")
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-23 14:01:40 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								def init():
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    removeQmlDebugFolderIfExists()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								def cleanup():
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    removeQmlDebugFolderIfExists()
							 |