2013-05-15 13:17:33 +02:00
|
|
|
#############################################################################
|
|
|
|
|
##
|
2014-01-07 13:27:11 +01:00
|
|
|
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2013-05-15 13:17:33 +02:00
|
|
|
## Contact: http://www.qt-project.org/legal
|
|
|
|
|
##
|
|
|
|
|
## 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
|
|
|
|
|
## a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
## conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
## use the contact form at http://qt.digia.com/contact-us.
|
|
|
|
|
##
|
|
|
|
|
## GNU Lesser General Public License Usage
|
|
|
|
|
## Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
## General Public License version 2.1 as published by the Free Software
|
|
|
|
|
## Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
## packaging of this file. Please review the following information to
|
|
|
|
|
## ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
##
|
|
|
|
|
## In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
## rights. These rights are described in the Digia Qt LGPL Exception
|
|
|
|
|
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
##
|
|
|
|
|
#############################################################################
|
|
|
|
|
|
2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
2012-03-26 14:04:31 +02:00
|
|
|
import re
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
SpeedCrunchPath = ""
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2012-01-17 15:09:50 +01:00
|
|
|
def buildConfigFromFancyToolButton(fancyToolButton):
|
2011-12-08 18:45:31 +01:00
|
|
|
beginOfBuildConfig = "<b>Build:</b> "
|
|
|
|
|
endOfBuildConfig = "<br/><b>Deploy:</b>"
|
|
|
|
|
toolTipText = str(fancyToolButton.toolTip)
|
|
|
|
|
beginIndex = toolTipText.find(beginOfBuildConfig) + len(beginOfBuildConfig)
|
|
|
|
|
endIndex = toolTipText.find(endOfBuildConfig)
|
|
|
|
|
return toolTipText[beginIndex:endIndex]
|
|
|
|
|
|
2011-08-25 10:05:28 +02:00
|
|
|
def main():
|
2011-09-27 11:04:12 +02:00
|
|
|
if not neededFilePresent(SpeedCrunchPath):
|
|
|
|
|
return
|
2011-08-31 13:51:32 +02:00
|
|
|
startApplication("qtcreator" + SettingsPath)
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return
|
2014-05-12 14:23:29 +02:00
|
|
|
suitableKits = Targets.DESKTOP_480_GCC
|
2013-04-04 13:19:23 +02:00
|
|
|
if platform.system() in ('Windows', 'Microsoft'):
|
2013-06-21 17:46:53 +02:00
|
|
|
suitableKits |= Targets.DESKTOP_480_MSVC2010
|
2013-04-04 13:19:23 +02:00
|
|
|
checkedTargets = openQmakeProject(SpeedCrunchPath, suitableKits)
|
2013-04-25 19:08:55 +02:00
|
|
|
progressBarWait(30000)
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2011-12-08 18:45:31 +01:00
|
|
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2013-01-18 16:31:48 +01:00
|
|
|
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Release")
|
2012-05-21 16:24:23 +02:00
|
|
|
if not availableConfigs:
|
|
|
|
|
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
|
2012-10-29 19:22:43 +01:00
|
|
|
for kit, config in availableConfigs:
|
2013-01-18 16:31:48 +01:00
|
|
|
selectBuildConfig(len(checkedTargets), kit, config)
|
2012-01-17 15:09:50 +01:00
|
|
|
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
|
2012-01-17 13:47:47 +01:00
|
|
|
if buildConfig != config:
|
|
|
|
|
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
|
|
|
|
|
continue
|
|
|
|
|
test.log("Testing build configuration: " + config)
|
|
|
|
|
invokeMenuItem("Build", "Run qmake")
|
2014-01-21 17:29:35 +01:00
|
|
|
waitForCompile()
|
2012-01-17 13:47:47 +01:00
|
|
|
invokeMenuItem("Build", "Rebuild All")
|
2014-01-21 17:29:35 +01:00
|
|
|
waitForCompile(300000)
|
2012-01-17 13:47:47 +01:00
|
|
|
checkCompile()
|
|
|
|
|
checkLastBuild()
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
# Add a new run configuration
|
|
|
|
|
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
|
|
|
|
|
def init():
|
|
|
|
|
global SpeedCrunchPath
|
2012-10-17 21:11:57 +02:00
|
|
|
SpeedCrunchPath = os.path.join(srcPath, "creator-test-data", "speedcrunch", "src", "speedcrunch.pro")
|
2011-08-25 10:05:28 +02:00
|
|
|
cleanup()
|
|
|
|
|
|
|
|
|
|
def cleanup():
|
|
|
|
|
# Make sure the .user files are gone
|
2011-09-27 11:39:01 +02:00
|
|
|
cleanUpUserFiles(SpeedCrunchPath)
|
2012-10-17 21:11:57 +02:00
|
|
|
for dir in glob.glob(os.path.join(srcPath, "creator-test-data", "speedcrunch", "speedcrunch-build-*")):
|
|
|
|
|
deleteDirIfExists(dir)
|