Handle extra whitespace in linux distribution name.
authorEric Fiselier <eric@efcs.ca>
Fri, 21 Nov 2014 08:54:35 +0000 (08:54 +0000)
committerEric Fiselier <eric@efcs.ca>
Fri, 21 Nov 2014 08:54:35 +0000 (08:54 +0000)
llvm-svn: 222514

libcxx/test/lit.cfg

index bfb678f..cf92e87 100644 (file)
@@ -362,10 +362,11 @@ class Configuration(object):
         # Insert the distributions name and name-version into the available
         # features to allow tests to XFAIL on them.
         if sys.platform.startswith('linux'):
-            os_info = platform.linux_distribution()
-            self.config.available_features.add(os_info[0].lower())
-            self.config.available_features.add(
-                '%s-%s' % (os_info[0].lower(), os_info[1]))
+            name, ver, _ = platform.linux_distribution()
+            name = name.lower().strip()
+            ver = ver.lower().strip()
+            self.config.available_features.add(name)
+            self.config.available_features.add('%s-%s' % (name, ver))
 
     def configure_compile_flags(self):
         # Configure extra compiler flags.