test: Handle libc++ shared lib name on FreeBSD
authorEd Maste <emaste@freebsd.org>
Mon, 9 Sep 2013 14:04:04 +0000 (14:04 +0000)
committerEd Maste <emaste@freebsd.org>
Mon, 9 Sep 2013 14:04:04 +0000 (14:04 +0000)
(I didn't take a guess at the Linux names, as these tests are currently
skipped with the comment "No standard locations for libc++ on Linux.")

llvm-svn: 190307

lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
lldb/test/lldbtest.py

index 1caf228..fe4ad15 100644 (file)
@@ -57,7 +57,7 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.expect('image list',substrs=['libc++.1.dylib','libc++abi.dylib'])
+        self.expect('image list', substrs = self.getLibcPlusPlusLibs())
 
         self.expect('frame variable ivI', substrs = ['item = 3'])
         self.expect('expr ivI', substrs = ['item = 3'])
index 05a96e3..760fe4b 100644 (file)
@@ -55,7 +55,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.expect('image list',substrs=['libc++.1.dylib','libc++abi.dylib'])
+        self.expect('image list', substrs = self.getLibcPlusPlusLibs())
 
         self.runCmd("frame variable ii --show-types")
                 
index bb2bec1..ec450e1 100644 (file)
@@ -55,7 +55,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.expect('image list',substrs=['libc++.1.dylib','libc++abi.dylib'])
+        self.expect('image list', substrs = self.getLibcPlusPlusLibs())
 
         self.runCmd("frame variable ii --show-types")
                 
index 7ee0a14..67db560 100644 (file)
@@ -55,7 +55,7 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.expect('image list',substrs=['libc++.1.dylib','libc++abi.dylib'])
+        self.expect('image list', substrs = self.getLibcPlusPlusLibs())
 
         self.expect("frame variable ii",substrs = ["size=0","{}"])
         self.runCmd("continue")
index e1d9171..a60f7d1 100644 (file)
@@ -55,7 +55,7 @@ class LibcxxSetDataFormatterTestCase(TestBase):
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.expect('image list',substrs=['libc++.1.dylib','libc++abi.dylib'])
+        self.expect('image list', substrs = self.getLibcPlusPlusLibs())
 
         self.expect("frame variable ii",substrs = ["size=0","{}"])
         self.runCmd("continue")
index a696157..ee1e8a2 100644 (file)
@@ -1444,6 +1444,12 @@ class Base(unittest2.TestCase):
         else:
             return self.lib_dir
 
+    def getLibcPlusPlusLibs(self):
+        if sys.platform.startswith('freebsd'):
+            return ['libc++.so.1']
+        else:
+            return ['libc++.1.dylib','libc++abi.dylib']
+
 class TestBase(Base):
     """
     This abstract base class is meant to be subclassed.  It provides default