[lit] Implement support of per test timeout in lit.
[oota-llvm.git] / utils / lit / tests / lit.cfg
index 2111b72748b5964f302e62f6262416d48dabfbec..4b38241d5a7d3ebbc3ff9867304feda4c0b9492a 100644 (file)
@@ -43,3 +43,12 @@ if lit_config.params.get('check-coverage', None):
 # Add a feature to detect the Python version.
 config.available_features.add("python%d.%d" % (sys.version_info[0],
                                                   sys.version_info[1]))
+
+# Add a feature to detect if psutil is available
+try:
+    import psutil
+    lit_config.note('Found python psutil module')
+    config.available_features.add("python-psutil")
+except ImportError:
+    lit_config.warning('Could not import psutil. Some tests will be skipped and'
+                       ' the --timeout command line argument will not work.')