diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-03-13 10:12:25 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-03-13 10:12:25 +0000 |
commit | 1253a81096a0aa43e172656d0b3092b71c295e3c (patch) | |
tree | 47b194ad074d64929d311783d43e790cf17f2b20 | |
parent | c2132d8f3325ba4dbaa0ee87567f479e9aa9e425 (diff) | |
download | bcm5719-llvm-1253a81096a0aa43e172656d0b3092b71c295e3c.tar.gz bcm5719-llvm-1253a81096a0aa43e172656d0b3092b71c295e3c.zip |
Skip fdleak tests on android
Android have more file descriptor opened by the shell what are inherited
to the process (different ones on device and on emulator).
Differential revision: http://reviews.llvm.org/D8299
llvm-svn: 232150
-rw-r--r-- | lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py | 7 | ||||
-rw-r--r-- | lldb/test/lldbtest.py | 15 |
2 files changed, 20 insertions, 2 deletions
diff --git a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py index a7c30ff19d7..b01acabd138 100644 --- a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py +++ b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py @@ -14,11 +14,13 @@ class AvoidsFdLeakTestCase(TestBase): @expectedFailure(lambda x: sys.version_info >= (2, 7, 8), "bugs.freebsd.org/197376") # python random leaks fd @skipIfWindows # The check for descriptor leakage needs to be implemented differently here. + @skipIfTargetAndroid # Android have some other file descriptors open by the shell def test_fd_leak_basic (self): self.do_test([]) @expectedFailure(lambda x: sys.version_info >= (2, 7, 8), "bugs.freebsd.org/197376") # python random leaks fd @skipIfWindows # The check for descriptor leakage needs to be implemented differently here. + @skipIfTargetAndroid # Android have some other file descriptors open by the shell def test_fd_leak_log (self): self.do_test(["log enable -f '/dev/null' lldb commands"]) @@ -40,13 +42,14 @@ class AvoidsFdLeakTestCase(TestBase): @expectedFailure(lambda x: sys.version_info >= (2, 7, 8), "bugs.freebsd.org/197376") # python random leaks fd @skipIfWindows # The check for descriptor leakage needs to be implemented differently here. + @skipIfTargetAndroid # Android have some other file descriptors open by the shell def test_fd_leak_multitarget (self): self.buildDefault() exe = os.path.join (os.getcwd(), "a.out") target = self.dbg.CreateTarget(exe) - breakpoint = target.BreakpointCreateBySourceRegex ('Set breakpoint here', lldb.SBFileSpec ("main.c", False)) - self.assertTrue(breakpoint, VALID_BREAKPOINT) + breakpoint = target.BreakpointCreateBySourceRegex ('Set breakpoint here', lldb.SBFileSpec ("main.c", False)) + self.assertTrue(breakpoint, VALID_BREAKPOINT) process1 = target.LaunchSimple (None, None, self.get_process_working_directory()) self.assertTrue(process1, PROCESS_IS_VALID) diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index 605ba5267f1..776d44f30f8 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -778,6 +778,21 @@ def skipIfi386(func): func(*args, **kwargs) return wrapper +def skipIfTargetAndroid(func): + """Decorate the item to skip tests that should be skipped when the target is Android.""" + if isinstance(func, type) and issubclass(func, unittest2.TestCase): + raise Exception("@skipIfTargetAndroid can only be used to decorate a test method") + @wraps(func) + def wrapper(*args, **kwargs): + from unittest2 import case + self = args[0] + triple = self.dbg.GetSelectedPlatform().GetTriple() + if re.match(".*-.*-.*-android", triple): + self.skipTest("skip on Android target") + else: + func(*args, **kwargs) + return wrapper + def skipUnlessCompilerRt(func): """Decorate the item to skip tests if testing remotely.""" if isinstance(func, type) and issubclass(func, unittest2.TestCase): |