Author: kuba.brecka
Date: Tue Apr  5 08:57:42 2016
New Revision: 265395

URL: http://llvm.org/viewvc/llvm-project?rev=265395&view=rev
Log:
Fix ThreadSanitizer test cases to work on OS X 10.10 and older.


Modified:
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py?rev=265395&r1=265394&r2=265395&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
 Tue Apr  5 08:57:42 2016
@@ -35,6 +35,11 @@ class TsanBasicTestCase(TestBase):
 
         self.runCmd("run")
 
+        stop_reason = 
self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason()
+        if stop_reason == lldb.eStopReasonExec:
+            # On OS X 10.10 and older, we need to re-exec to enable 
interceptors.
+            self.runCmd("continue")
+
         # the stop reason of the thread should be breakpoint.
         self.expect("thread list", "A data race should be detected",
             substrs = ['stopped', 'stop reason = Data race detected'])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py?rev=265395&r1=265394&r2=265395&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
 Tue Apr  5 08:57:42 2016
@@ -28,6 +28,11 @@ class TsanThreadLeakTestCase(TestBase):
 
         self.runCmd("run")
 
+        stop_reason = 
self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason()
+        if stop_reason == lldb.eStopReasonExec:
+            # On OS X 10.10 and older, we need to re-exec to enable 
interceptors.
+            self.runCmd("continue")
+
         # the stop reason of the thread should be breakpoint.
         self.expect("thread list", "A thread leak should be detected",
             substrs = ['stopped', 'stop reason = Thread leak detected'])


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to