[Lldb-commits] [lldb] r243329 - Only test ObjC expression options on Darwin.

Chaoren Lin chaorenl at google.com
Mon Jul 27 14:15:02 PDT 2015


Author: chaoren
Date: Mon Jul 27 16:15:01 2015
New Revision: 243329

URL: http://llvm.org/viewvc/llvm-project?rev=243329&view=rev
Log:
Only test ObjC expression options on Darwin.

Reviewers: dawn, emaste, vharron, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11539

Modified:
    lldb/trunk/test/expression_command/options/TestExprOptions.py

Modified: lldb/trunk/test/expression_command/options/TestExprOptions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/options/TestExprOptions.py?rev=243329&r1=243328&r2=243329&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/options/TestExprOptions.py (original)
+++ lldb/trunk/test/expression_command/options/TestExprOptions.py Mon Jul 27 16:15:01 2015
@@ -26,9 +26,15 @@ class ExprOptionsTestCase(TestBase):
         self.line = line_number('main.cpp', '// breakpoint_in_main')
         self.exe = os.path.join(os.getcwd(), "a.out")
 
-    @expectedFailureFreeBSD # ObjC expression broken on FreeBSD?
-    @expectedFailureLinux # ObjC expression broken on Linux?
-    def test_expr_options(self):
+    @skipUnlessDarwin
+    def test_expr_options_objc_cpp(self):
+        self.expr_options(test_objc = True, test_cpp = True)
+
+    @skipIfDarwin # Already covered by test_expr_options_objc_cpp
+    def test_expr_options_cpp(self):
+        self.expr_options(test_objc = False, test_cpp = True)
+
+    def expr_options(self, test_objc, test_cpp):
         """These expression command options should work as expected."""
         self.buildDefault()
 
@@ -53,47 +59,49 @@ class ExprOptionsTestCase(TestBase):
         frame = threads[0].GetFrameAtIndex(0)
         options = lldb.SBExpressionOptions()
 
-        # -- test --language on ObjC builtin type using the SB API's --
-        # Make sure we can evaluate the ObjC builtin type 'id':
-        val = frame.EvaluateExpression('id my_id = 0; my_id')
-        self.assertTrue(val.IsValid())
-        self.assertTrue(val.GetError().Success())
-        self.assertEqual(val.GetValueAsUnsigned(0), 0)
-        self.DebugSBValue(val)
-
-        # Make sure it still works if language is set to ObjC:
-        options.SetLanguage(lldb.eLanguageTypeObjC)
-        val = frame.EvaluateExpression('id my_id = 0; my_id', options)
-        self.assertTrue(val.IsValid())
-        self.assertTrue(val.GetError().Success())
-        self.assertEqual(val.GetValueAsUnsigned(0), 0)
-        self.DebugSBValue(val)
-
-        # Make sure it fails if language is set to C:
-        options.SetLanguage(lldb.eLanguageTypeC)
-        val = frame.EvaluateExpression('id my_id = 0; my_id', options)
-        self.assertTrue(val.IsValid())
-        self.assertFalse(val.GetError().Success())
-
-        # -- test --language on C++ expression using the SB API's --
-        # Make sure we can evaluate 'ns::func'.
-        val = frame.EvaluateExpression('ns::func')
-        self.assertTrue(val.IsValid())
-        self.assertTrue(val.GetError().Success())
-        self.DebugSBValue(val)
-
-        # Make sure it still works if language is set to C++:
-        options.SetLanguage(lldb.eLanguageTypeC_plus_plus)
-        val = frame.EvaluateExpression('ns::func', options)
-        self.assertTrue(val.IsValid())
-        self.assertTrue(val.GetError().Success())
-        self.DebugSBValue(val)
-
-        # Make sure it fails if language is set to C:
-        options.SetLanguage(lldb.eLanguageTypeC)
-        val = frame.EvaluateExpression('ns::func', options)
-        self.assertTrue(val.IsValid())
-        self.assertFalse(val.GetError().Success())
+        if test_objc:
+            # -- test --language on ObjC builtin type using the SB API's --
+            # Make sure we can evaluate the ObjC builtin type 'id':
+            val = frame.EvaluateExpression('id my_id = 0; my_id')
+            self.assertTrue(val.IsValid())
+            self.assertTrue(val.GetError().Success())
+            self.assertEqual(val.GetValueAsUnsigned(0), 0)
+            self.DebugSBValue(val)
+
+            # Make sure it still works if language is set to ObjC:
+            options.SetLanguage(lldb.eLanguageTypeObjC)
+            val = frame.EvaluateExpression('id my_id = 0; my_id', options)
+            self.assertTrue(val.IsValid())
+            self.assertTrue(val.GetError().Success())
+            self.assertEqual(val.GetValueAsUnsigned(0), 0)
+            self.DebugSBValue(val)
+
+            # Make sure it fails if language is set to C:
+            options.SetLanguage(lldb.eLanguageTypeC)
+            val = frame.EvaluateExpression('id my_id = 0; my_id', options)
+            self.assertTrue(val.IsValid())
+            self.assertFalse(val.GetError().Success())
+
+        if test_cpp:
+            # -- test --language on C++ expression using the SB API's --
+            # Make sure we can evaluate 'ns::func'.
+            val = frame.EvaluateExpression('ns::func')
+            self.assertTrue(val.IsValid())
+            self.assertTrue(val.GetError().Success())
+            self.DebugSBValue(val)
+
+            # Make sure it still works if language is set to C++:
+            options.SetLanguage(lldb.eLanguageTypeC_plus_plus)
+            val = frame.EvaluateExpression('ns::func', options)
+            self.assertTrue(val.IsValid())
+            self.assertTrue(val.GetError().Success())
+            self.DebugSBValue(val)
+
+            # Make sure it fails if language is set to C:
+            options.SetLanguage(lldb.eLanguageTypeC)
+            val = frame.EvaluateExpression('ns::func', options)
+            self.assertTrue(val.IsValid())
+            self.assertFalse(val.GetError().Success())
 
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list