diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-10-12 22:39:52 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-10-12 22:39:52 +0000 |
commit | 0924b412012e106758528d92511dd3132161e21b (patch) | |
tree | e751eabdb2a45b781bf36a8e1ce5a3cc02eb1917 /lldb/test/macosx | |
parent | d759c21029acc4ce3eafe59720408672ba2ae135 (diff) | |
download | bcm5719-llvm-0924b412012e106758528d92511dd3132161e21b.tar.gz bcm5719-llvm-0924b412012e106758528d92511dd3132161e21b.zip |
Avoid using hardcoded line number to break on. Use the line_number() utility
function to get the line number to break on during setUp().
llvm-svn: 116356
Diffstat (limited to 'lldb/test/macosx')
-rw-r--r-- | lldb/test/macosx/universal/TestUniversal.py | 17 | ||||
-rw-r--r-- | lldb/test/macosx/universal/main.c | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/lldb/test/macosx/universal/TestUniversal.py b/lldb/test/macosx/universal/TestUniversal.py index 7785f63a11f..935cf30303f 100644 --- a/lldb/test/macosx/universal/TestUniversal.py +++ b/lldb/test/macosx/universal/TestUniversal.py @@ -9,6 +9,11 @@ class UniversalTestCase(TestBase): mydir = "macosx/universal" + def setUp(self): + super(UniversalTestCase, self).setUp() + # Find the line number to break inside main(). + self.line = line_number('main.c', '// Set break point at this line.') + @unittest2.skipUnless(sys.platform.startswith("darwin") and os.uname()[4]=='i386', "requires Darwin & i386") def test_process_launch_for_universal(self): @@ -26,8 +31,10 @@ class UniversalTestCase(TestBase): substrs = ["testit' (x86_64)."]) # Break inside the main. - self.expect("breakpoint set -f main.c -l 5", BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.c', line = 5, locations = 1") + self.expect("breakpoint set -f main.c -l %d" % self.line, + BREAKPOINT_CREATED, + startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" % + self.line) # We should be able to launch the x86_64 executable. self.runCmd("run", RUN_SUCCEEDED) @@ -47,8 +54,10 @@ class UniversalTestCase(TestBase): substrs = ["testit' (i386)."]) # Break inside the main. - self.expect("breakpoint set -f main.c -l 5", BREAKPOINT_CREATED, - startstr = "Breakpoint created: 1: file ='main.c', line = 5, locations = 1") + self.expect("breakpoint set -f main.c -l %d" % self.line, + BREAKPOINT_CREATED, + startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" % + self.line) # We should be able to launch the i386 executable as well. self.runCmd("run", RUN_SUCCEEDED) diff --git a/lldb/test/macosx/universal/main.c b/lldb/test/macosx/universal/main.c index ab50a3bcf9d..9351c77f714 100644 --- a/lldb/test/macosx/universal/main.c +++ b/lldb/test/macosx/universal/main.c @@ -2,6 +2,6 @@ int main (int argc, char **argv) { - printf ("Hello there!\n"); + printf ("Hello there!\n"); // Set break point at this line. return 0; } |