[Lldb-commits] [PATCH] D18481: Add argument to expectedFailureAll decorator to xfail for environment variables, and xfail tests for hard float abi and -mthumb on android arm

Ying Chen via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 25 13:12:55 PDT 2016


chying created this revision.
chying added reviewers: chaoren, zturner.
chying added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer, rengolin, aemerson.

xfail TestCallUserAnonTypedef.test for -mthumb, TestReturnValue.test_with_python for hard fp, TestLldbGdbServer.software_breakpoint_set_and_remove_work for hard fp.

http://reviews.llvm.org/D18481

Files:
  packages/Python/lldbsuite/test/decorators.py
  packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
  packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
  packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py

Index: packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
===================================================================
--- packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -1122,6 +1122,7 @@
         self.set_inferior_startup_launch()
         self.qMemoryRegionInfo_reports_heap_address_as_readable_writeable()
 
+    @expectedFailureAll(bugnumber="llvm.org/pr27075", compiler="gcc", archs=["arm"], env_flags={"CFLAGS_EXTRAS": "-mthumb"})
     def software_breakpoint_set_and_remove_work(self):
         # Start up the inferior.
         procs = self.prep_debug_monitor_and_inferior(
Index: packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
+++ packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
@@ -21,6 +21,7 @@
     @expectedFailureAll(oslist=["linux"], compiler="clang", compiler_version=["<=", "3.6"], archs=["i386"])
     @expectedFailureAll(bugnumber="llvm.org/pr25785", hostoslist=["windows"], compiler="gcc", archs=["i386"], triple='.*-android')
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
+    @expectedFailureAll(bugnumber="llvm.org/pr27073", compiler="gcc", archs=["arm"], env_flags={"CFLAGS_EXTRAS": "-mfloat-abi=hard"})
     @add_test_categories(['pyapi'])
     def test_with_python(self):
         """Test getting return values from stepping out."""
Index: packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
===================================================================
--- packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
+++ packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
@@ -23,6 +23,7 @@
         # Find the breakpoint
         self.line = line_number('main.cpp', '// lldb testsuite break')
 
+    @expectedFailureAll(bugnumber="llvm.org/pr27074", compiler="gcc", archs=["arm"], env_flags={"CFLAGS_EXTRAS": "-mfloat-abi=hard"})
     def test(self):
         """Test typedeffed untagged struct arguments for function call expressions"""
         self.build()
Index: packages/Python/lldbsuite/test/decorators.py
===================================================================
--- packages/Python/lldbsuite/test/decorators.py
+++ packages/Python/lldbsuite/test/decorators.py
@@ -132,13 +132,20 @@
     else:
         return skipTestIfFn_impl
 
+def _check_expected_env_flag(env_flags):
+    for env, value in env_flags.iteritems():
+        env_val = os.environ.get(env)
+        if env_val is None or value not in env_val.split():
+            return False
+    return True
+
 def _decorateTest(mode,
                  bugnumber=None, oslist=None, hostoslist=None,
                  compiler=None, compiler_version=None,
                  archs=None, triple=None,
                  debug_info=None,
                  swig_version=None, py_version=None,
-                 remote=None):
+                 remote=None, env_flags=None):
     def fn(self):
         skip_for_os = _match_decorator_property(lldbplatform.translate(oslist), self.getPlatform())
         skip_for_hostos = _match_decorator_property(lldbplatform.translate(hostoslist), lldbplatformutil.getHostPlatform())
@@ -151,6 +158,8 @@
         skip_for_swig_version = (swig_version is None) or (not hasattr(lldb, 'swig_version')) or (_check_expected_version(swig_version[0], swig_version[1], lldb.swig_version))
         skip_for_py_version = (py_version is None) or _check_expected_version(py_version[0], py_version[1], sys.version_info)
 
+        skip_for_env_flags = (env_flags is None) or _check_expected_env_flag(env_flags)
+
         # For the test to be skipped, all specified (e.g. not None) parameters must be True.
         # An unspecified parameter means "any", so those are marked skip by default.  And we skip
         # the final test if all conditions are True.
@@ -162,7 +171,8 @@
                       (triple, skip_for_triple, "target triple"),
                       (swig_version, skip_for_swig_version, "swig version"),
                       (py_version, skip_for_py_version, "python version"),
-                      (remote, skip_for_remote, "platform locality (remote/local)")]
+                      (remote, skip_for_remote, "platform locality (remote/local)"),
+                      (env_flags, skip_for_env_flags, "environment flags")]
         reasons = []
         final_skip_result = True
         for this_condition in conditions:
@@ -200,15 +210,15 @@
                        archs=None, triple=None,
                        debug_info=None,
                        swig_version=None, py_version=None,
-                       remote=None):
+                       remote=None, env_flags=None):
     return _decorateTest(DecorateMode.Xfail,
                         bugnumber=bugnumber,
                         oslist=oslist, hostoslist=hostoslist,
                         compiler=compiler, compiler_version=compiler_version,
                         archs=archs, triple=triple,
                         debug_info=debug_info,
                         swig_version=swig_version, py_version=py_version,
-                        remote=remote)
+                        remote=remote, env_flags=env_flags)
 
 
 # provide a function to skip on defined oslist, compiler version, and archs


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18481.51679.patch
Type: text/x-patch
Size: 5613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160325/d3e2a8ac/attachment.bin>


More information about the lldb-commits mailing list