[Lldb-commits] [lldb] r303248 - Make TestConflictingSymbol run on non-darwin targets

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed May 17 04:47:44 PDT 2017


Author: labath
Date: Wed May 17 06:47:44 2017
New Revision: 303248

URL: http://llvm.org/viewvc/llvm-project?rev=303248&view=rev
Log:
Make TestConflictingSymbol run on non-darwin targets

For remote targets we need to call registerSharedLibrariesWithTarget to
make sure they are installed alongside main executable. This also
required a small fixup in the the mentioned function as in this case
"One" was both a directory name and a library name template. I fixed it
to make sure it checks that the string refers to a file before it
assumed it was a full library path.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py?rev=303248&r1=303247&r2=303248&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py Wed May 17 06:47:44 2017
@@ -16,10 +16,16 @@ class TestConflictingSymbols(TestBase):
     mydir = TestBase.compute_mydir(__file__)
     NO_DEBUG_INFO_TESTCASE = True
 
-    @skipUnlessDarwin
     def test_conflicting_symbols(self):
         self.build()
-        self.common_setup()
+        exe = os.path.join(os.getcwd(), "a.out")
+        target = self.dbg.CreateTarget("a.out")
+        self.assertTrue(target, VALID_TARGET)
+
+        # Register our shared libraries for remote targets so they get
+        # automatically uploaded
+        environment = self.registerSharedLibrariesWithTarget(
+            target, ['One', 'Two'])
 
         One_line = line_number('One/One.c', '// break here')
         Two_line = line_number('Two/Two.c', '// break here')
@@ -31,7 +37,9 @@ class TestConflictingSymbols(TestBase):
         lldbutil.run_break_set_by_file_and_line(
             self, 'main.c', main_line, num_expected_locations=1, loc_exact=True)
 
-        self.runCmd("run", RUN_SUCCEEDED)
+        process = target.LaunchSimple(
+            None, environment, self.get_process_working_directory())
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
@@ -80,7 +88,3 @@ class TestConflictingSymbols(TestBase):
             error=True,
             substrs=[
                 "Multiple internal symbols"])
-
-    def common_setup(self):
-        exe = os.path.join(os.getcwd(), "a.out")
-        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=303248&r1=303247&r2=303248&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Wed May 17 06:47:44 2017
@@ -1934,7 +1934,7 @@ class TestBase(Base):
             # "libFoo.dylib" or "libFoo.so", or "Foo.so" for "Foo.so" or "libFoo.so", or just a
             # basename like "libFoo.so". So figure out which one it is and resolve the local copy
             # of the shared library accordingly
-            if os.path.exists(name):
+            if os.path.isfile(name):
                 local_shlib_path = name  # name is the full path to the local shared library
             else:
                 # Check relative names




More information about the lldb-commits mailing list