From 8b7dff6fdc1999ec547b009d97fcbb15140770f9 Mon Sep 17 00:00:00 2001
From: Christian Stenger <christian.stenger@digia.com>
Date: Fri, 13 Sep 2013 11:07:03 +0200
Subject: [PATCH] Squish: Fix tst_debug_empty_main for Mac

Change-Id: I57cd9647d07cfbf823bdff63dd1c2f5c3050cb7c
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
---
 tests/system/objects.map                                 | 2 +-
 tests/system/suite_debugger/tst_debug_empty_main/test.py | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/system/objects.map b/tests/system/objects.map
index d3f0a2897cb..63d5b8d7312 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -114,7 +114,7 @@
 :Options_Core::Internal::SettingsDialog	{type='Core::Internal::SettingsDialog' unnamed='1' visible='1' windowTitle~='(Options|Preferences)'}
 :Options_QListView	{type='QListView' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
 :QML Debugging.No_QPushButton	{text='No' type='QPushButton' unnamed='1' visible='1' window=':QML Debugging_QMessageBox'}
-:QML Debugging_QMessageBox	{type='QMessageBox' unnamed='1' visible='1' windowTitle='QML Debugging'}
+:QML Debugging_QMessageBox	{text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'}
 :QWebPage	{type='QWebPage' unnamed='1'}
 :Qt Creator.Add Bookmark_QToolButton	{text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
 :Qt Creator.Analyzer Toolbar_QDockWidget	{name='Analyzer Toolbar' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Analyzer Toolbar'}
diff --git a/tests/system/suite_debugger/tst_debug_empty_main/test.py b/tests/system/suite_debugger/tst_debug_empty_main/test.py
index 6c8de770d70..a055bcd0a91 100644
--- a/tests/system/suite_debugger/tst_debug_empty_main/test.py
+++ b/tests/system/suite_debugger/tst_debug_empty_main/test.py
@@ -91,6 +91,8 @@ def __handleAppOutputWaitForDebuggerFinish__():
                 "Verifying whether debugging has finished.")
 
 def performDebugging(workingDir, projectName, checkedTargets):
+    # for checking if it's a plain C application (as project names are set to match project type)
+    sampleC = re.compile("SampleC\d{3}")
     for kit, config in iterateBuildConfigs(len(checkedTargets), "Debug"):
         test.log("Selecting '%s' as build config" % config)
         selectBuildConfig(len(checkedTargets), kit, config)
@@ -111,7 +113,10 @@ def performDebugging(workingDir, projectName, checkedTargets):
         invokeMenuItem("Debug", "Toggle Breakpoint")
         clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))
         handleDebuggerWarnings(config, isMsvc)
-        clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton"))
+        # on Mac the breakpoint won't get hit if it's a C++ based application and the breakpoint is
+        # set to an empty code line inside an empty main
+        if platform.system() != "Darwin" or sampleC.match(projectName):
+            clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton"))
         __handleAppOutputWaitForDebuggerFinish__()
         removeOldBreakpoints()
         deleteAppFromWinFW(workingDir, projectName, False)
-- 
GitLab