summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2017-09-22 22:34:53 +0000
committerJason Molenda <jmolenda@apple.com>2017-09-22 22:34:53 +0000
commit0187a8f6f99d22bf2ce7727e705be4c18e8d6fe4 (patch)
tree95d5c0a42ec723578ffa47571ac0b7c6c0ef9a05 /lldb/packages/Python/lldbsuite/test/python_api
parentdf963a38a9e27fc43b485dfdf52bc1b090087e06 (diff)
downloadbcm5719-llvm-0187a8f6f99d22bf2ce7727e705be4c18e8d6fe4.tar.gz
bcm5719-llvm-0187a8f6f99d22bf2ce7727e705be4c18e8d6fe4.zip
Initial patchset to get the testsuite running against armv7 and arm64 iOS devices.
Normal customer devices won't be able to run these devices, we're hoping to get a public facing bot set up at some point. Both devices pass the testsuite without any errors or failures. I have seen some instability with the armv7 test runs, I may submit additional patches to address this. arm64 looks good. I'll be watching the bots for the rest of today; if any problems are introduced by this patch I'll revert it - if anyone sees a problem with their bot that I don't see, please do the same. I know it's a rather large patch. One change I had to make specifically for iOS devices was that debugserver can't create files. There were several tests that launch the inferior process redirecting its output to a file, then they retrieve the file. They were not trying to test file redirection in these tests, so I rewrote those to write their output to a file directly. llvm-svn: 314038
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api')
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/exprpath_synthetic/main.mm2
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c7
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py22
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/main.m2
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py7
8 files changed, 29 insertions, 18 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/exprpath_synthetic/main.mm b/lldb/packages/Python/lldbsuite/test/python_api/exprpath_synthetic/main.mm
index f7383a5a14d..9d4630dc7c4 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/exprpath_synthetic/main.mm
+++ b/lldb/packages/Python/lldbsuite/test/python_api/exprpath_synthetic/main.mm
@@ -6,7 +6,7 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
#include <vector>
int main (int argc, char const *argv[])
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py b/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
index 06ca772073a..a2d2cf12cdc 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -90,7 +90,7 @@ class FrameAPITestCase(TestBase):
# Make sure on arm targets we dont mismatch PC value on the basis of thumb bit.
# Frame PC will not have thumb bit set in case of a thumb
# instruction as PC.
- if self.getArchitecture() in ['arm']:
+ if self.getArchitecture() in ['arm', 'armv7', 'armv7k']:
pc_value_int &= ~1
self.assertTrue(
pc_value_int == frame.GetPC(),
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py b/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
index 44dd4a61850..fb4e54aa0bc 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
@@ -79,6 +79,7 @@ class HelloWorldTestCase(TestBase):
@add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24600")
@skipIfiOSSimulator
+ @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_with_attach_to_process_with_id_api(self):
"""Create target, spawn a process, and attach to it with process id."""
self.build(dictionary=self.d)
@@ -108,6 +109,7 @@ class HelloWorldTestCase(TestBase):
@add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24600")
@skipIfiOSSimulator
+ @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_with_attach_to_process_with_name_api(self):
"""Create target, spawn a process, and attach to it with process name."""
self.build(dictionary=self.d)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c b/lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c
index 1b942d0db15..001e9c01e6e 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c
+++ b/lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c
@@ -1,5 +1,5 @@
#include <stdio.h>
-
+#include <unistd.h>
int main(int argc, char const *argv[])
{
lldb_enable_attach();
@@ -10,9 +10,8 @@ int main(int argc, char const *argv[])
// Waiting to be attached by the debugger, otherwise.
char line[100];
- while (fgets(line, sizeof(line), stdin)) { // Waiting to be attached...
- printf("input line=>%s\n", line);
- }
+ while (1)
+ sleep (1); // Waiting to be attached...
printf("Exiting now\n");
}
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
index 49a78888ad8..a19cc5c375f 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -76,17 +76,18 @@ class RegistersIteratorTestCase(TestBase):
REGs = lldbutil.get_ESRs(frame)
if self.platformIsDarwin():
- num = len(REGs)
- if self.TraceOn():
- print(
- "\nNumber of exception state registers: %d" %
- num)
- for reg in REGs:
- self.assertTrue(reg)
+ if self.getArchitecture() != 'armv7' and self.getArchitecture() != 'armv7k':
+ num = len(REGs)
if self.TraceOn():
print(
- "%s => %s" %
- (reg.GetName(), reg.GetValue()))
+ "\nNumber of exception state registers: %d" %
+ num)
+ for reg in REGs:
+ self.assertTrue(reg)
+ if self.TraceOn():
+ print(
+ "%s => %s" %
+ (reg.GetName(), reg.GetValue()))
else:
self.assertIsNone(REGs)
@@ -99,7 +100,8 @@ class RegistersIteratorTestCase(TestBase):
REGs = lldbutil.get_registers(
frame, "Exception State Registers")
if self.platformIsDarwin():
- self.assertIsNotNone(REGs)
+ if self.getArchitecture() != 'armv7' and self.getArchitecture() != 'armv7k':
+ self.assertIsNotNone(REGs)
else:
self.assertIsNone(REGs)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py b/lldb/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
index 5314930ff99..71f77b36880 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
@@ -59,6 +59,7 @@ class ProcessIOTestCase(TestBase):
@skipIfWindows # stdio manipulation unsupported on Windows
@add_test_categories(['pyapi'])
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
+ @skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stdout_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without specifying STDIN or STDERR."""
self.build()
@@ -72,6 +73,7 @@ class ProcessIOTestCase(TestBase):
@skipIfWindows # stdio manipulation unsupported on Windows
@add_test_categories(['pyapi'])
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
+ @skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stderr_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without specifying STDIN or STDOUT."""
self.build()
@@ -85,6 +87,7 @@ class ProcessIOTestCase(TestBase):
@skipIfWindows # stdio manipulation unsupported on Windows
@add_test_categories(['pyapi'])
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
+ @skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stdout_stderr_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT and STDERR without redirecting STDIN."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/main.m b/lldb/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/main.m
index 599d36107f4..6ac70d1d06b 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/main.m
+++ b/lldb/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/main.m
@@ -6,7 +6,7 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface ThisClassTestsThings : NSObject
@end
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
index 33f1be77ad5..7ce312f52de 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
@@ -19,6 +19,10 @@ class WatchpointIteratorTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ # hardware watchpoints are not reported with a hardware index # on armv7 on ios devices
+ def affected_by_radar_34564183(self):
+ return (self.getArchitecture() == 'armv7' or self.getArchitecture() == 'armv7k') and self.platformIsDarwin()
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -99,7 +103,8 @@ class WatchpointIteratorTestCase(TestBase):
# meaningful hardware index at this point. Exercise the printed repr of
# SBWatchpointLocation.
print(watchpoint)
- self.assertTrue(watchpoint.GetHardwareIndex() != -1)
+ if not self.affected_by_radar_34564183():
+ self.assertTrue(watchpoint.GetHardwareIndex() != -1)
# SBWatchpoint.GetDescription() takes a description level arg.
print(lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull))
OpenPOWER on IntegriCloud