--- tools/lldb/test/lldbtest.py.orig 2015-07-07 14:47:34 UTC +++ tools/lldb/test/lldbtest.py @@ -388,6 +388,9 @@ def system(commands, **kwargs): if not trace and retcode and sys.platform.startswith("freebsd"): trace = True + if not trace and retcode and sys.platform.startswith("bsdsunix"): + trace = True + with recording(test, trace) as sbuf: print >> sbuf print >> sbuf, "os command:", shellCommand @@ -669,6 +672,9 @@ def expectedFailureDarwin(bugnumber=None # For legacy reasons, we support both "darwin" and "macosx" as OS X triples. return expectedFailureOS(getDarwinOSTriples(), bugnumber, compilers) +def expectedFailureBSDSUniX(bugnumber=None, compilers=None): + return expectedFailureOS(['bsdsunix'], bugnumber, compilers) + def expectedFailureFreeBSD(bugnumber=None, compilers=None): return expectedFailureOS(['freebsd'], bugnumber, compilers) @@ -749,6 +755,9 @@ def expectedFlakeyDarwin(bugnumber=None, def expectedFlakeyLinux(bugnumber=None, compilers=None): return expectedFlakeyOS(['linux'], bugnumber, compilers) +def expectedFlakeyBSDSUniX(bugnumber=None, compilers=None): + return expectedFlakeyOS(['bsdsunix'], bugnumber, compilers) + def expectedFlakeyFreeBSD(bugnumber=None, compilers=None): return expectedFlakeyOS(['freebsd'], bugnumber, compilers) @@ -836,6 +845,10 @@ def skipIfNoSBHeaders(func): func(*args, **kwargs) return wrapper +def skipIfBSDSUniX(func): + """Decorate the item to skip tests that should be skipped on BSDSUniX.""" + return skipIfPlatform(["bsdsunix"])(func) + def skipIfFreeBSD(func): """Decorate the item to skip tests that should be skipped on FreeBSD.""" return skipIfPlatform(["freebsd"])(func) @@ -868,6 +881,8 @@ def getPlatform(): platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] if platform.startswith('freebsd'): platform = 'freebsd' + if platform.startswith('bsdsunix'): + platform = 'bsdsunix' return platform def getHostPlatform(): @@ -879,6 +894,8 @@ def getHostPlatform(): return 'windows' elif sys.platform.startswith('darwin'): return 'darwin' + elif sys.platform.startswith('bsdsunix'): + return 'bsdsunix' elif sys.platform.startswith('freebsd'): return 'freebsd' else: @@ -1140,7 +1157,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() == "linux" or getPlatform() == "freebsd" or getPlatform() == "bsdsunix": cls.platformContext = _PlatformContext('LD_LIBRARY_PATH', 'lib', 'so') else: cls.platformContext = None @@ -1882,7 +1899,7 @@ class Base(unittest2.TestCase): def getstdlibFlag(self): """ Returns the proper -stdlib flag, or empty if not required.""" - if self.platformIsDarwin() or self.getPlatform() == "freebsd": + if self.platformIsDarwin() or self.getPlatform() == "freebsd" or self.getPlatform() == "bsdsunix": stdlibflag = "-stdlib=libc++" else: stdlibflag = "" @@ -1912,7 +1929,7 @@ class Base(unittest2.TestCase): 'FRAMEWORK_INCLUDES' : "-F%s" % self.lib_dir, 'LD_EXTRAS' : "%s -Wl,-rpath,%s" % (dsym, self.lib_dir), } - elif sys.platform.startswith('freebsd') or sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile': + elif sys.platform.startswith('bsdsunix') or sys.platform.startswith('freebsd') or sys.platform.startswith("linux") or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile': d = {'CXX_SOURCES' : sources, 'EXE' : exe_name, 'CFLAGS_EXTRAS' : "%s %s -I%s" % (stdflag, stdlibflag, os.path.join(os.environ["LLDB_SRC"], "include")), @@ -1940,7 +1957,7 @@ class Base(unittest2.TestCase): 'FRAMEWORK_INCLUDES' : "-F%s" % self.lib_dir, 'LD_EXTRAS' : "%s -Wl,-rpath,%s -dynamiclib" % (dsym, self.lib_dir), } - elif self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux' or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile': + elif self.getPlatform() == 'bsdsunix' or self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux' or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile': d = {'DYLIB_CXX_SOURCES' : sources, 'DYLIB_NAME' : lib_name, 'CFLAGS_EXTRAS' : "%s -I%s -fPIC" % (stdflag, os.path.join(os.environ["LLDB_SRC"], "include")), @@ -2036,7 +2053,7 @@ class Base(unittest2.TestCase): cflags += "c++0x" else: cflags += "c++11" - if self.platformIsDarwin() or self.getPlatform() == "freebsd": + if self.platformIsDarwin() or self.getPlatform() == "freebsd" or self.getPlatform() == "bsdsunix": cflags += " -stdlib=libc++" elif "clang" in self.getCompiler(): cflags += " -stdlib=libstdc++" @@ -2068,7 +2085,7 @@ class Base(unittest2.TestCase): return self.lib_dir def getLibcPlusPlusLibs(self): - if self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux': + if self.getPlatform() == 'freebsd' or self.getPlatform() == 'bsdsunix' or self.getPlatform() == 'linux': return ['libc++.so.1'] else: return ['libc++.1.dylib','libc++abi.dylib']