Modify the test cases so that each uses a unique executable name for the debugger to attach/launch.

I've see cases where there are lingering processes ("hello_world") staying around and the
test_with_dsym_and_attach_to_process_with_name_api() test case just hangs.

llvm-svn: 148417
This commit is contained in:
Johnny Chen 2012-01-18 21:20:03 +00:00
parent 82041c2e60
commit fef3e2797a
1 changed files with 15 additions and 8 deletions

View File

@ -16,7 +16,8 @@ class HelloWorldTestCase(TestBase):
Use dsym info and process launch API.
"""
self.buildDsym()
self.buildDsym(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_world_python()
@python_api_test
@ -25,7 +26,8 @@ class HelloWorldTestCase(TestBase):
Use dwarf debug map and process launch API.
"""
self.buildDwarf()
self.buildDwarf(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_world_python()
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@ -35,7 +37,8 @@ class HelloWorldTestCase(TestBase):
Use dsym info and attach to process with id API.
"""
self.buildDsym()
self.buildDsym(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_world_attach_with_id_api()
@python_api_test
@ -44,7 +47,8 @@ class HelloWorldTestCase(TestBase):
Use dwarf map (no dsym) and attach to process with id API.
"""
self.buildDwarf()
self.buildDwarf(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_world_attach_with_id_api()
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@ -54,7 +58,8 @@ class HelloWorldTestCase(TestBase):
Use dsym info and attach to process with name API.
"""
self.buildDsym()
self.buildDsym(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_world_attach_with_name_api()
@python_api_test
@ -63,14 +68,16 @@ class HelloWorldTestCase(TestBase):
Use dwarf map (no dsym) and attach to process with name API.
"""
self.buildDwarf()
self.buildDwarf(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
self.hello_world_attach_with_name_api()
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Get the full path to our executable to be debugged.
self.exe = os.path.join(os.getcwd(), "hello_world")
# Get the full path to our executable to be attached/debugged.
self.exe = os.path.join(os.getcwd(), self.testMethodName)
self.d = {'EXE': self.testMethodName}
# Find a couple of the line numbers within main.c.
self.line1 = line_number('main.c', '// Set break point at this line.')
self.line2 = line_number('main.c', '// Waiting to be attached...')