Merge remote-tracking branch 'origin/4.0'

Change-Id: I89c52ca2145a43c94d3366367ba72fde605dd577
This commit is contained in:
Eike Ziller
2016-05-31 12:01:58 +02:00
23 changed files with 148 additions and 95 deletions

View File

@@ -1280,6 +1280,7 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
bp.notifyBreakpointReleased(); bp.notifyBreakpointReleased();
DebuggerToolTipManager::deregisterEngine(this); DebuggerToolTipManager::deregisterEngine(this);
d->m_memoryAgent.handleDebuggerFinished(); d->m_memoryAgent.handleDebuggerFinished();
prepareForRestart();
} }
showMessage(msg, LogDebug); showMessage(msg, LogDebug);

View File

@@ -204,6 +204,7 @@ public:
virtual void selectWatchData(const QByteArray &iname); virtual void selectWatchData(const QByteArray &iname);
virtual void startDebugger(DebuggerRunControl *runControl); virtual void startDebugger(DebuggerRunControl *runControl);
virtual void prepareForRestart() {}
virtual void watchPoint(const QPoint &); virtual void watchPoint(const QPoint &);

View File

@@ -4300,6 +4300,14 @@ void GdbEngine::notifyInferiorSetupFailed()
DebuggerEngine::notifyInferiorSetupFailed(); DebuggerEngine::notifyInferiorSetupFailed();
} }
void GdbEngine::prepareForRestart()
{
m_rerunPending = false;
m_commandsDoneCallback = 0;
m_commandForToken.clear();
m_flagsForToken.clear();
}
void GdbEngine::handleInferiorPrepared() void GdbEngine::handleInferiorPrepared()
{ {
const DebuggerRunParameters &rp = runParameters(); const DebuggerRunParameters &rp = runParameters();

View File

@@ -71,6 +71,7 @@ private: ////////// General Interface //////////
virtual void handleGdbStartFailed(); virtual void handleGdbStartFailed();
void notifyInferiorSetupFailed() override; void notifyInferiorSetupFailed() override;
void prepareForRestart() override;
bool hasCapability(unsigned) const override; bool hasCapability(unsigned) const override;
void detachDebugger() override; void detachDebugger() override;

View File

@@ -87,19 +87,6 @@ LldbEngine::LldbEngine(const DebuggerRunParameters &startParameters)
m_lastAgentId = 0; m_lastAgentId = 0;
setObjectName(QLatin1String("LldbEngine")); setObjectName(QLatin1String("LldbEngine"));
if (startParameters.useTerminal) {
#ifdef Q_OS_WIN
// Windows up to xp needs a workaround for attaching to freshly started processes. see proc_stub_win
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
m_stubProc.setMode(ConsoleProcess::Suspend);
else
m_stubProc.setMode(ConsoleProcess::Debug);
#else
m_stubProc.setMode(ConsoleProcess::Debug);
m_stubProc.setSettings(ICore::settings());
#endif
}
connect(action(AutoDerefPointers), &SavedAction::valueChanged, connect(action(AutoDerefPointers), &SavedAction::valueChanged,
this, &LldbEngine::updateLocals); this, &LldbEngine::updateLocals);
connect(action(CreateFullBacktrace), &QAction::triggered, connect(action(CreateFullBacktrace), &QAction::triggered,
@@ -192,7 +179,26 @@ bool LldbEngine::prepareCommand()
void LldbEngine::setupEngine() void LldbEngine::setupEngine()
{ {
// FIXME: We can't handle terminals yet.
if (runParameters().useTerminal) { if (runParameters().useTerminal) {
qWarning("Run in Terminal is not supported yet with the LLDB backend");
showMessage(tr("Run in Terminal is not supported yet with the LLDB backend"), AppError);
runParameters().useTerminal = false;
}
if (runParameters().useTerminal) {
QTC_CHECK(false); // See above.
#ifdef Q_OS_WIN
// Windows up to xp needs a workaround for attaching to freshly started processes. see proc_stub_win
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
m_stubProc.setMode(ConsoleProcess::Suspend);
else
m_stubProc.setMode(ConsoleProcess::Debug);
#else
m_stubProc.setMode(ConsoleProcess::Debug);
m_stubProc.setSettings(ICore::settings());
#endif
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(_("TRYING TO START ADAPTER")); showMessage(_("TRYING TO START ADAPTER"));

View File

@@ -79,6 +79,10 @@ void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message,
{ {
QMutexLocker l(&m_mutex); QMutexLocker l(&m_mutex);
if (level <= qbs::LoggerWarning) {
doPrintWarning(qbs::ErrorInfo(message));
return;
}
m_messages.append(qbs::logLevelTag(level) + message); m_messages.append(qbs::logLevelTag(level) + message);
} }
QMetaObject::invokeMethod(this, "sendMessages", Qt::QueuedConnection); QMetaObject::invokeMethod(this, "sendMessages", Qt::QueuedConnection);

View File

@@ -77,7 +77,7 @@ QbsManager::QbsManager() : m_defaultPropertyProvider(new DefaultPropertyProvider
this, &QbsManager::updateAllProfiles); this, &QbsManager::updateAllProfiles);
m_logSink = new QbsLogSink(this); m_logSink = new QbsLogSink(this);
int level = qbs::LoggerWarning; int level = qbs::LoggerInfo;
const QString levelEnv = QString::fromLocal8Bit(qgetenv("QBS_LOG_LEVEL")); const QString levelEnv = QString::fromLocal8Bit(qgetenv("QBS_LOG_LEVEL"));
if (!levelEnv.isEmpty()) { if (!levelEnv.isEmpty()) {
bool ok = false; bool ok = false;

View File

@@ -59,18 +59,18 @@ QbsProjectParser::QbsProjectParser(QbsProject *project, QFutureInterface<bool> *
QbsProjectParser::~QbsProjectParser() QbsProjectParser::~QbsProjectParser()
{ {
if (m_qbsSetupProjectJob) { const auto deleteJob = [this](qbs::AbstractJob *job) {
m_qbsSetupProjectJob->disconnect(this); if (!job)
m_qbsSetupProjectJob->cancel(); return;
m_qbsSetupProjectJob->deleteLater(); if (job->state() == qbs::AbstractJob::StateFinished) {
m_qbsSetupProjectJob = 0; job->deleteLater();
} return;
if (m_ruleExecutionJob) {
m_ruleExecutionJob->disconnect(this);
m_ruleExecutionJob->cancel();
m_ruleExecutionJob->deleteLater();
m_ruleExecutionJob = 0;
} }
connect(job, &qbs::AbstractJob::finished, job, &qbs::AbstractJob::deleteLater);
job->cancel();
};
deleteJob(m_qbsSetupProjectJob);
deleteJob(m_ruleExecutionJob);
m_fi = 0; // we do not own m_fi, do not delete m_fi = 0; // we do not own m_fi, do not delete
} }
@@ -93,7 +93,8 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
// Some people don't like it when files are created as a side effect of opening a project, // Some people don't like it when files are created as a side effect of opening a project,
// so do not store the build graph if the build directory does not exist yet. // so do not store the build graph if the build directory does not exist yet.
params.setDryRun(!QFileInfo::exists(dir)); m_dryRun = !QFileInfo::exists(dir);
params.setDryRun(m_dryRun);
params.setBuildRoot(dir); params.setBuildRoot(dir);
params.setProjectFilePath(m_projectFilePath); params.setProjectFilePath(m_projectFilePath);
@@ -151,6 +152,7 @@ void QbsProjectParser::handleQbsParsingDone(bool success)
void QbsProjectParser::startRuleExecution() void QbsProjectParser::startRuleExecution()
{ {
qbs::BuildOptions options; qbs::BuildOptions options;
options.setDryRun(m_dryRun);
options.setExecuteRulesOnly(true); options.setExecuteRulesOnly(true);
m_ruleExecutionJob = m_project.buildAllProducts( m_ruleExecutionJob = m_project.buildAllProducts(
options, qbs::Project::ProductSelectionWithNonDefault, this); options, qbs::Project::ProductSelectionWithNonDefault, this);

View File

@@ -74,6 +74,7 @@ private:
qbs::BuildJob *m_ruleExecutionJob; qbs::BuildJob *m_ruleExecutionJob;
qbs::ErrorInfo m_error; qbs::ErrorInfo m_error;
qbs::Project m_project; qbs::Project m_project;
bool m_dryRun;
QFutureInterface<bool> *m_fi; QFutureInterface<bool> *m_fi;
int m_currentProgressBase; int m_currentProgressBase;

View File

@@ -127,7 +127,8 @@ QObject *FlameGraph::appendChild(QObject *parentObject, QQuickItem *parentItem,
} }
int FlameGraph::buildNode(const QModelIndex &parentIndex, QObject *parentObject, int depth) int FlameGraph::buildNode(const QModelIndex &parentIndex, QObject *parentObject, int depth,
int maximumDepth)
{ {
qreal position = 0; qreal position = 0;
qreal skipped = 0; qreal skipped = 0;
@@ -136,6 +137,9 @@ int FlameGraph::buildNode(const QModelIndex &parentIndex, QObject *parentObject,
QQmlContext *context = qmlContext(this); QQmlContext *context = qmlContext(this);
int rowCount = m_model->rowCount(parentIndex); int rowCount = m_model->rowCount(parentIndex);
int childrenDepth = depth; int childrenDepth = depth;
if (depth == maximumDepth - 1) {
skipped = parentSize;
} else {
for (int row = 0; row < rowCount; ++row) { for (int row = 0; row < rowCount; ++row) {
QModelIndex childIndex = m_model->index(row, 0, parentIndex); QModelIndex childIndex = m_model->index(row, 0, parentIndex);
qreal size = m_model->data(childIndex, m_sizeRole).toReal(); qreal size = m_model->data(childIndex, m_sizeRole).toReal();
@@ -147,7 +151,9 @@ int FlameGraph::buildNode(const QModelIndex &parentIndex, QObject *parentObject,
QObject *childObject = appendChild(parentObject, parentItem, context, childIndex, QObject *childObject = appendChild(parentObject, parentItem, context, childIndex,
position / parentSize, size / parentSize); position / parentSize, size / parentSize);
position += size; position += size;
childrenDepth = qMax(childrenDepth, buildNode(childIndex, childObject, depth + 1)); childrenDepth = qMax(childrenDepth, buildNode(childIndex, childObject, depth + 1,
maximumDepth));
}
} }
if (skipped > 0) { if (skipped > 0) {
@@ -170,7 +176,7 @@ void FlameGraph::rebuild()
return; return;
} }
m_depth = buildNode(QModelIndex(), this, 0); m_depth = buildNode(QModelIndex(), this, 0, m_maximumDepth);
emit depthChanged(m_depth); emit depthChanged(m_depth);
} }

View File

@@ -108,6 +108,8 @@ class FlameGraph : public QQuickItem
Q_PROPERTY(int sizeRole READ sizeRole WRITE setSizeRole NOTIFY sizeRoleChanged) Q_PROPERTY(int sizeRole READ sizeRole WRITE setSizeRole NOTIFY sizeRoleChanged)
Q_PROPERTY(qreal sizeThreshold READ sizeThreshold WRITE setSizeThreshold Q_PROPERTY(qreal sizeThreshold READ sizeThreshold WRITE setSizeThreshold
NOTIFY sizeThresholdChanged) NOTIFY sizeThresholdChanged)
Q_PROPERTY(int maximumDepth READ maximumDepth WRITE setMaximumDepth
NOTIFY maximumDepthChanged)
Q_PROPERTY(int depth READ depth NOTIFY depthChanged) Q_PROPERTY(int depth READ depth NOTIFY depthChanged)
public: public:
@@ -127,6 +129,19 @@ public:
int depth() const; int depth() const;
int maximumDepth() const
{
return m_maximumDepth;
}
void setMaximumDepth(int maximumDepth)
{
if (maximumDepth != m_maximumDepth) {
m_maximumDepth = maximumDepth;
emit maximumDepthChanged();
}
}
static FlameGraphAttached *qmlAttachedProperties(QObject *object); static FlameGraphAttached *qmlAttachedProperties(QObject *object);
signals: signals:
@@ -135,6 +150,7 @@ signals:
void sizeRoleChanged(int role); void sizeRoleChanged(int role);
void sizeThresholdChanged(qreal threshold); void sizeThresholdChanged(qreal threshold);
void depthChanged(int depth); void depthChanged(int depth);
void maximumDepthChanged();
private slots: private slots:
void rebuild(); void rebuild();
@@ -145,8 +161,10 @@ private:
int m_sizeRole = 0; int m_sizeRole = 0;
int m_depth = 0; int m_depth = 0;
qreal m_sizeThreshold = 0; qreal m_sizeThreshold = 0;
int m_maximumDepth = std::numeric_limits<int>::max();
int buildNode(const QModelIndex &parentIndex, QObject *parentObject, int depth); int buildNode(const QModelIndex &parentIndex, QObject *parentObject, int depth,
int maximumDepth);
QObject *appendChild(QObject *parentObject, QQuickItem *parentItem, QQmlContext *context, QObject *appendChild(QObject *parentObject, QQuickItem *parentItem, QQmlContext *context,
const QModelIndex &childIndex, qreal position, qreal size); const QModelIndex &childIndex, qreal position, qreal size);
}; };

View File

@@ -61,6 +61,7 @@ ScrollView {
model: flameGraphModel model: flameGraphModel
sizeRole: FlameGraphModel.DurationRole sizeRole: FlameGraphModel.DurationRole
sizeThreshold: 0.002 sizeThreshold: 0.002
maximumDepth: 25
y: flickable.height > height ? flickable.height - height : 0 y: flickable.height > height ? flickable.height - height : 0
delegate: Item { delegate: Item {

View File

@@ -179,10 +179,10 @@ def __getMkspecFromQMakeConf__(qmakeConf):
return os.path.basename(mkspec) return os.path.basename(mkspec)
def __getMkspecFromQmake__(qmakeCall): def __getMkspecFromQmake__(qmakeCall):
if getOutputFromCmdline("%s -query QT_VERSION" % qmakeCall).strip().startswith("5."): if getOutputFromCmdline([qmakeCall, "-query", "QT_VERSION"]).strip().startswith("5."):
return getOutputFromCmdline("%s -query QMAKE_XSPEC" % qmakeCall).strip() return getOutputFromCmdline([qmakeCall, "-query", "QMAKE_XSPEC"]).strip()
else: else:
QmakeConfPath = getOutputFromCmdline("%s -query QMAKE_MKSPECS" % qmakeCall).strip() QmakeConfPath = getOutputFromCmdline([qmakeCall, "-query", "QMAKE_MKSPECS"]).strip()
for tmpPath in QmakeConfPath.split(os.pathsep): for tmpPath in QmakeConfPath.split(os.pathsep):
tmpPath = tmpPath + os.sep + "default" + os.sep +"qmake.conf" tmpPath = tmpPath + os.sep + "default" + os.sep +"qmake.conf"
result = __getMkspecFromQMakeConf__(tmpPath) result = __getMkspecFromQMakeConf__(tmpPath)
@@ -326,7 +326,7 @@ def __isWinFirewallRunning__():
if not platform.system() in ('Microsoft' 'Windows'): if not platform.system() in ('Microsoft' 'Windows'):
__isWinFirewallRunning__.fireWallState = False __isWinFirewallRunning__.fireWallState = False
return False return False
result = getOutputFromCmdline("netsh firewall show state") result = getOutputFromCmdline(["netsh", "firewall", "show", "state"])
for line in result.splitlines(): for line in result.splitlines():
if "Operational mode" in line: if "Operational mode" in line:
__isWinFirewallRunning__.fireWallState = not "Disable" in line __isWinFirewallRunning__.fireWallState = not "Disable" in line

View File

@@ -277,7 +277,7 @@ def getQtInformationByQMakeCall(qtDir, which):
else: else:
test.fatal("You're trying to fetch an unknown information (%s)" % which) test.fatal("You're trying to fetch an unknown information (%s)" % which)
return None return None
return getOutputFromCmdline("%s -query %s" % (qmake, query)).strip() return getOutputFromCmdline([qmake, "-query", query]).strip()
def invokeContextMenuOnProject(projectName, menuItem): def invokeContextMenuOnProject(projectName, menuItem):
try: try:

View File

@@ -118,7 +118,8 @@ def waitForCleanShutdown(timeOut=10):
if not shutdownDone and datetime.utcnow() > endtime: if not shutdownDone and datetime.utcnow() > endtime:
break break
if platform.system() == 'Linux' and JIRA.isBugStillOpen(15749): if platform.system() == 'Linux' and JIRA.isBugStillOpen(15749):
pgrepOutput = getOutputFromCmdline('pgrep -f qtcreator_process_stub') pgrepOutput = getOutputFromCmdline(["pgrep", "-f", "qtcreator_process_stub"],
acceptedError=1)
pids = pgrepOutput.splitlines() pids = pgrepOutput.splitlines()
if len(pids): if len(pids):
print("Killing %d qtcreator_process_stub instances" % len(pids)) print("Killing %d qtcreator_process_stub instances" % len(pids))

View File

@@ -139,7 +139,7 @@ def which(program):
command = "where" command = "where"
else: else:
command = "which" command = "which"
foundPath = getOutputFromCmdline(command + " " + program) foundPath = getOutputFromCmdline([command, program], acceptedError=1)
if foundPath: if foundPath:
return foundPath.splitlines()[0] return foundPath.splitlines()[0]
else: else:
@@ -216,10 +216,11 @@ def logApplicationOutput():
return None return None
# get the output from a given cmdline call # get the output from a given cmdline call
def getOutputFromCmdline(cmdline): def getOutputFromCmdline(cmdline, environment=None, acceptedError=0):
try: try:
return subprocess.check_output(cmdline, shell=True) # TODO: do not use shell=True return subprocess.check_output(cmdline, env=environment)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
if e.returncode != acceptedError:
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode)) test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
return e.output return e.output

View File

@@ -224,16 +224,18 @@ class JIRA:
def __tryExternalTools__(self, proxy=None): def __tryExternalTools__(self, proxy=None):
global JIRA_URL global JIRA_URL
if proxy: if proxy:
cmdAndArgs = { 'curl':'-k --proxy %s' % proxy, cmdAndArgs = { 'curl':['-k', '--proxy', proxy],
'wget':'-qO-'} 'wget':['-qO-']}
else: else:
cmdAndArgs = { 'curl':'-k', 'wget':'-qO-' } cmdAndArgs = { 'curl':['-k'], 'wget':['-qO-']}
for call in cmdAndArgs: for call in cmdAndArgs:
prog = which(call) prog = which(call)
if prog: if prog:
if call == 'wget' and proxy and os.getenv("https_proxy", None) == None: if call == 'wget' and proxy and os.getenv("https_proxy", None) == None:
test.warning("Missing environment variable https_proxy for using wget with proxy!") test.warning("Missing environment variable https_proxy for using wget with proxy!")
return getOutputFromCmdline('"%s" %s %s/%s-%d' % (prog, cmdAndArgs[call], JIRA_URL, self._bugType, self._number)) cmdline = [prog] + cmdAndArgs[call]
cmdline += ['%s/%s-%d' % (JIRA_URL, self._bugType, self._number)]
return getOutputFromCmdline(cmdline)
return None return None
# this function crops multiple whitespaces from fetched and searches for expected # this function crops multiple whitespaces from fetched and searches for expected

View File

@@ -1,15 +1,15 @@
"0" "1" "6" "11" "0" "1" "6" "11"
"<program>" "" "1" "Main Program" "<program>" "" "1" "Main Program"
"main.qml:4" "Create" "2" "QtQuick.Window/Window" "main.qml:4" "Create" "2" "QtQuick.Window/Window"
"main.qml:12" "Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" "main.qml:15" "Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:12" "JavaScript" "2" "onTriggered" "main.qml:15" "JavaScript" "2" "onTriggered"
"main.qml:30" "Create" "2" "QtQuick/Text" "main.qml:33" "Create" "2" "QtQuick/Text"
"main.qml:1" "Compile" "1" "main.qml" "main.qml:1" "Compile" "1" "main.qml"
"main.qml:7" "Create" "2" "QtQuick/Timer" "main.qml:10" "Create" "2" "QtQuick/Timer"
"main.qml:32" "Binding" "1" "anchors.centerIn: parent" "main.qml:35" "Binding" "1" "anchors.centerIn: parent"
"main.qml:23" "Create" "2" "QtQuick/MouseArea" "main.qml:26" "Create" "2" "QtQuick/MouseArea"
"main.qml:11" "Binding" "3" "running: runCount < 2" "main.qml:14" "Binding" "3" "running: runCount < 2"
"main.qml:32" "JavaScript" "1" "expression for centerIn" "main.qml:35" "JavaScript" "1" "expression for centerIn"
"main.qml:24" "Binding" "1" "anchors.fill: parent" "main.qml:27" "Binding" "1" "anchors.fill: parent"
"main.qml:11" "JavaScript" "3" "expression for running" "main.qml:14" "JavaScript" "3" "expression for running"
"main.qml:24" "JavaScript" "1" "expression for fill" "main.qml:27" "JavaScript" "1" "expression for fill"
1 0 1 6 11
2 <program> 1 Main Program
3 main.qml:4 Create 2 QtQuick.Window/Window
4 main.qml:12 main.qml:15 Signal 2 onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
5 main.qml:12 main.qml:15 JavaScript 2 onTriggered
6 main.qml:30 main.qml:33 Create 2 QtQuick/Text
7 main.qml:1 Compile 1 main.qml
8 main.qml:7 main.qml:10 Create 2 QtQuick/Timer
9 main.qml:32 main.qml:35 Binding 1 anchors.centerIn: parent
10 main.qml:23 main.qml:26 Create 2 QtQuick/MouseArea
11 main.qml:11 main.qml:14 Binding 3 running: runCount < 2
12 main.qml:32 main.qml:35 JavaScript 1 expression for centerIn
13 main.qml:24 main.qml:27 Binding 1 anchors.fill: parent
14 main.qml:11 main.qml:14 JavaScript 3 expression for running
15 main.qml:24 main.qml:27 JavaScript 1 expression for fill

View File

@@ -51,7 +51,7 @@ def main():
result = setBreakpointsForCurrentProject(filesAndLines) result = setBreakpointsForCurrentProject(filesAndLines)
if result: if result:
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):8}, expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):8},
{os.path.join(workingDir, projectName, "main.qml"):10}] {os.path.join(workingDir, projectName, "main.qml"):13}]
# Only use 4.7.4 to work around QTBUG-25187 # Only use 4.7.4 to work around QTBUG-25187
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug") availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
progressBarWait() progressBarWait()

View File

@@ -165,7 +165,7 @@ def __getExpectedCompilers__():
if platform.system() in ('Linux', 'Darwin'): if platform.system() in ('Linux', 'Darwin'):
compilers.extend(["g++-4.0", "g++-4.2", "clang++"]) compilers.extend(["g++-4.0", "g++-4.2", "clang++"])
if platform.system() == 'Darwin': if platform.system() == 'Darwin':
xcodeClang = getOutputFromCmdline("xcrun --find clang++").strip("\n") xcodeClang = getOutputFromCmdline(["xcrun", "--find", "clang++"]).strip("\n")
if xcodeClang and os.path.exists(xcodeClang) and xcodeClang not in expected: if xcodeClang and os.path.exists(xcodeClang) and xcodeClang not in expected:
expected.append(xcodeClang) expected.append(xcodeClang)
for compiler in compilers: for compiler in compilers:
@@ -217,7 +217,7 @@ def __getExpectedDebuggers__():
result.extend(filter(lambda s: not ("lldb-platform" in s or "lldb-gdbserver" in s), result.extend(filter(lambda s: not ("lldb-platform" in s or "lldb-gdbserver" in s),
findAllFilesInPATH("lldb-*"))) findAllFilesInPATH("lldb-*")))
if platform.system() == 'Darwin': if platform.system() == 'Darwin':
xcodeLLDB = getOutputFromCmdline("xcrun --find lldb").strip("\n") xcodeLLDB = getOutputFromCmdline(["xcrun", "--find", "lldb"]).strip("\n")
if xcodeLLDB and os.path.exists(xcodeLLDB) and xcodeLLDB not in result: if xcodeLLDB and os.path.exists(xcodeLLDB) and xcodeLLDB not in result:
result.append(xcodeLLDB) result.append(xcodeLLDB)
return result return result

View File

@@ -31,10 +31,10 @@ def main():
return return
invokeMenuItem("File", "Open File or Project...") invokeMenuItem("File", "Open File or Project...")
unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt") unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt")
locale = "" locale = None
if not platform.system() in ('Windows', 'Microsoft'): if not platform.system() in ('Windows', 'Microsoft'):
locale = "LC_ALL=C " locale = {"LC_ALL":"C"}
sorted = getOutputFromCmdline("%ssort %s" % (locale, unsortedFile)).replace("\r", "") sorted = getOutputFromCmdline(["sort", unsortedFile], locale).replace("\r", "")
selectFromFileDialog(unsortedFile) selectFromFileDialog(unsortedFile)
editor = waitForObject("{type='TextEditor::TextEditorWidget' unnamed='1' " editor = waitForObject("{type='TextEditor::TextEditorWidget' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000) "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)