[libcxx] r223601 - Give lit.cfg's threading options default values when not defined.

Eric Fiselier eric at efcs.ca
Sun Dec 7 00:52:19 PST 2014


Author: ericwf
Date: Sun Dec  7 02:52:19 2014
New Revision: 223601

URL: http://llvm.org/viewvc/llvm-project?rev=223601&view=rev
Log:
Give lit.cfg's threading options default values when not defined.

Modified:
    libcxx/trunk/test/lit.cfg

Modified: libcxx/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=223601&r1=223600&r2=223601&view=diff
==============================================================================
--- libcxx/trunk/test/lit.cfg (original)
+++ libcxx/trunk/test/lit.cfg Sun Dec  7 02:52:19 2014
@@ -202,10 +202,10 @@ class Configuration(object):
                 val = default
         return val
 
-    def get_lit_bool(self, name):
+    def get_lit_bool(self, name, default=None):
         conf = self.get_lit_conf(name)
         if conf is None:
-            return None
+            return default
         if conf.lower() in ('1', 'true'):
             return True
         if conf.lower() in ('', '0', 'false'):
@@ -415,9 +415,8 @@ class Configuration(object):
                                    '-D__STDC_LIMIT_MACROS',
                                    '-D__STDC_CONSTANT_MACROS']
         # Configure threading features.
-        enable_threads = self.get_lit_bool('enable_threads')
-        enable_monotonic_clock = self.get_lit_bool('enable_monotonic_clock')
-        assert enable_threads is not None and enable_monotonic_clock is not None
+        enable_threads = self.get_lit_bool('enable_threads', True)
+        enable_monotonic_clock = self.get_lit_bool('enable_monotonic_clock', True)
         if not enable_threads:
             self.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
             self.config.available_features.add('libcpp-has-no-threads')





More information about the cfe-commits mailing list