2016-01-15 14:55:33 +01:00
|
|
|
# Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2013-05-15 13:17:33 +02:00
|
|
|
|
2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2012-01-26 22:46:25 +01:00
|
|
|
BuildPath = tempDir()
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2020-07-23 16:43:12 +02:00
|
|
|
def cmakeSupported():
|
2017-06-08 17:18:31 +02:00
|
|
|
versionLines = filter(lambda line: "cmake version " in line,
|
|
|
|
|
getOutputFromCmdline(["cmake", "--version"]).splitlines())
|
|
|
|
|
try:
|
2022-03-24 21:02:03 +01:00
|
|
|
versionLine = list(versionLines)[0]
|
|
|
|
|
test.log("Using " + versionLine)
|
|
|
|
|
matcher = re.match("cmake version (\d+)\.(\d+)\.\d+", versionLine)
|
2017-06-08 17:18:31 +02:00
|
|
|
major = __builtin__.int(matcher.group(1))
|
|
|
|
|
minor = __builtin__.int(matcher.group(2))
|
|
|
|
|
except:
|
|
|
|
|
return False
|
2020-07-23 16:43:12 +02:00
|
|
|
|
|
|
|
|
return (major, minor) >= (3, 14)
|
2017-06-08 17:18:31 +02:00
|
|
|
|
2011-08-25 10:05:28 +02:00
|
|
|
def main():
|
2012-01-24 11:59:54 +01:00
|
|
|
if (which("cmake") == None):
|
2012-01-25 19:23:12 +01:00
|
|
|
test.fatal("cmake not found in PATH - needed to run this test")
|
2012-01-24 11:59:54 +01:00
|
|
|
return
|
2020-07-23 16:43:12 +02:00
|
|
|
if not cmakeSupported():
|
|
|
|
|
test.warning("CMake version is no more supported for QC")
|
|
|
|
|
return
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2022-11-04 17:50:19 +01:00
|
|
|
with GitClone("https://bitbucket.org/heldercorreia/speedcrunch.git",
|
|
|
|
|
"release-0.12.0") as SpeedCrunchPath:
|
|
|
|
|
if not SpeedCrunchPath:
|
|
|
|
|
test.fatal("Could not clone SpeedCrunch")
|
|
|
|
|
return
|
|
|
|
|
startQC()
|
|
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return
|
|
|
|
|
result = openCmakeProject(os.path.join(SpeedCrunchPath, "src", "CMakeLists.txt"),
|
|
|
|
|
BuildPath)
|
|
|
|
|
if not result:
|
|
|
|
|
test.fatal("Could not open/create cmake project - leaving test")
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return
|
|
|
|
|
waitForProjectParsing()
|
|
|
|
|
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
|
|
|
|
treeFile = "projecttree_speedcrunch.tsv"
|
|
|
|
|
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", treeFile)
|
|
|
|
|
|
|
|
|
|
# Invoke a rebuild of the application
|
|
|
|
|
selectFromLocator("t rebuild", "Rebuild All Projects")
|
|
|
|
|
|
|
|
|
|
# Wait for, and test if the build succeeded
|
|
|
|
|
waitForCompile(300000)
|
|
|
|
|
checkCompile()
|
|
|
|
|
checkLastBuild()
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2022-11-04 17:50:19 +01:00
|
|
|
invokeMenuItem("File", "Exit")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
def cleanup():
|
2012-01-26 22:46:25 +01:00
|
|
|
global BuildPath
|
|
|
|
|
deleteDirIfExists(BuildPath)
|