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,7 +210,7 @@ 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, @@ -208,7 +218,7 @@ 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 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/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/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(