Modify the test case related to "target modules search-paths" as it suffers from code rotting.

llvm-svn: 131038
This commit is contained in:
Johnny Chen 2011-05-06 23:59:10 +00:00
parent 0de016dbb7
commit 32103ac2a9
1 changed files with 11 additions and 7 deletions
lldb/test/load_unload

View File

@ -21,8 +21,8 @@ class LoadUnloadTestCase(TestBase):
self.line_d_function = line_number('d.c',
'// Find this line number within d_dunction().')
def test_image_search_paths(self):
"""Test image list after moving libd.dylib, and verifies that it works with 'target image-search-paths add'."""
def test_modules_search_paths(self):
"""Test target modules list after moving libd.dylib, and verifies that it works with 'target modules search-paths add'."""
# Invoke the default build rule.
self.buildDefault()
@ -50,14 +50,18 @@ class LoadUnloadTestCase(TestBase):
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.expect("image list",
self.expect("target modules list",
substrs = [old_dylib])
self.expect("image list -t 3",
self.expect("target modules list -t 3",
patterns = ["%s-[^-]*-[^-]*" % self.getArchitecture()])
self.runCmd("target image-search-paths add %s %s" % (os.getcwd(), new_dir))
self.runCmd("target modules search-paths add %s %s" % (os.getcwd(), new_dir))
self.expect("target modules search-paths list",
substrs = [os.getcwd(), new_dir])
# Add teardown hook to clear image-search-paths after the test.
self.addTearDownHook(lambda: self.runCmd("target image-search-paths clear"))
self.expect("image list", "LLDB successfully locates the relocated dynamic library",
self.addTearDownHook(lambda: self.runCmd("target modules search-paths clear"))
self.expect("target modules list", "LLDB successfully locates the relocated dynamic library",
substrs = [new_dylib])