[Lldb-commits] [lldb] r254948 - Add initial NetBSD support in lldbsuite/test/lldbtest.py
Kamil Rytarowski via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 7 13:25:57 PST 2015
Author: kamil
Date: Mon Dec 7 15:25:57 2015
New Revision: 254948
URL: http://llvm.org/viewvc/llvm-project?rev=254948&view=rev
Log:
Add initial NetBSD support in lldbsuite/test/lldbtest.py
Summary:
Add new functions:
- expectedFailureNetBSD()
- expectedFlakeyNetBSD()
- skipIfNetBSD()
Add new NetBSD entry in:
- getPlatform()
- getHostPlatform()
Assume that libc++ is installed and use the GNU toolchain
Reviewers: joerg, emaste, tfiala, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15262
Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
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=254948&r1=254947&r2=254948&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 7 15:25:57 2015
@@ -740,6 +740,9 @@ def expectedFailureFreeBSD(bugnumber=Non
def expectedFailureLinux(bugnumber=None, compilers=None, debug_info=None):
return expectedFailureOS(['linux'], bugnumber, compilers, debug_info=debug_info)
+def expectedFailureNetBSD(bugnumber=None, compilers=None, debug_info=None):
+ return expectedFailureOS(['netbsd'], bugnumber, compilers, debug_info=debug_info)
+
def expectedFailureWindows(bugnumber=None, compilers=None, debug_info=None):
return expectedFailureOS(['windows'], bugnumber, compilers, debug_info=debug_info)
@@ -826,11 +829,14 @@ def expectedFlakeyDarwin(bugnumber=None,
# For legacy reasons, we support both "darwin" and "macosx" as OS X triples.
return expectedFlakeyOS(getDarwinOSTriples(), bugnumber, compilers)
+def expectedFlakeyFreeBSD(bugnumber=None, compilers=None):
+ return expectedFlakeyOS(['freebsd'], bugnumber, compilers)
+
def expectedFlakeyLinux(bugnumber=None, compilers=None):
return expectedFlakeyOS(['linux'], bugnumber, compilers)
-def expectedFlakeyFreeBSD(bugnumber=None, compilers=None):
- return expectedFlakeyOS(['freebsd'], bugnumber, compilers)
+def expectedFlakeyNetBSD(bugnumber=None, compilers=None):
+ return expectedFlakeyOS(['netbsd'], bugnumber, compilers)
def expectedFlakeyCompiler(compiler, compiler_version=None, bugnumber=None):
if compiler_version is None:
@@ -927,6 +933,10 @@ def skipIfFreeBSD(func):
"""Decorate the item to skip tests that should be skipped on FreeBSD."""
return skipIfPlatform(["freebsd"])(func)
+def skipIfNetBSD(func):
+ """Decorate the item to skip tests that should be skipped on NetBSD."""
+ return skipIfPlatform(["netbsd"])(func)
+
def getDarwinOSTriples():
return ['darwin', 'macosx', 'ios']
@@ -996,6 +1006,8 @@ def getPlatform():
platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
if platform.startswith('freebsd'):
platform = 'freebsd'
+ elif platform.startswith('netbsd'):
+ platform = 'netbsd'
return platform
def getHostPlatform():
@@ -1009,6 +1021,8 @@ def getHostPlatform():
return 'darwin'
elif sys.platform.startswith('freebsd'):
return 'freebsd'
+ elif sys.platform.startswith('netbsd'):
+ return 'netbsd'
else:
return sys.platform
@@ -1311,7 +1325,7 @@ class Base(unittest2.TestCase):
# Set platform context.
if platformIsDarwin():
cls.platformContext = _PlatformContext('DYLD_LIBRARY_PATH', 'lib', 'dylib')
- elif getPlatform() == "linux" or getPlatform() == "freebsd":
+ elif getPlatform() in ("freebsd", "linux", "netbsd"):
cls.platformContext = _PlatformContext('LD_LIBRARY_PATH', 'lib', 'so')
else:
cls.platformContext = None
@@ -2063,7 +2077,7 @@ class Base(unittest2.TestCase):
""" Returns the proper -stdlib flag, or empty if not required."""
if self.platformIsDarwin() or self.getPlatform() == "freebsd":
stdlibflag = "-stdlib=libc++"
- else:
+ else: # this includes NetBSD
stdlibflag = ""
return stdlibflag
@@ -2238,6 +2252,8 @@ class Base(unittest2.TestCase):
cflags += "c++11"
if self.platformIsDarwin() or self.getPlatform() == "freebsd":
cflags += " -stdlib=libc++"
+ elif self.getPlatform() == "netbsd":
+ cflags += " -stdlib=libstdc++"
elif "clang" in self.getCompiler():
cflags += " -stdlib=libstdc++"
@@ -2269,7 +2285,7 @@ class Base(unittest2.TestCase):
return lib_dir
def getLibcPlusPlusLibs(self):
- if self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux':
+ if self.getPlatform() in ('freebsd', 'linux', 'netbsd'):
return ['libc++.so.1']
else:
return ['libc++.1.dylib','libc++abi.dylib']
More information about the lldb-commits
mailing list