[LNT] r231484 - Adds check for needed tools for nightly tests

Renato Golin renato.golin at linaro.org
Fri Mar 6 08:06:37 PST 2015


Author: rengolin
Date: Fri Mar  6 10:06:37 2015
New Revision: 231484

URL: http://llvm.org/viewvc/llvm-project?rev=231484&view=rev
Log:
Adds check for needed tools for nightly tests

This patch adds test for the required tools to run the nightly tests
without failures. New buildbots or manual runs would fail and waste
a lot of time investigating what the problem is, since the error
message wasn't clear enough on all cases.

Modified:
    lnt/trunk/lnt/tests/nt.py

Modified: lnt/trunk/lnt/tests/nt.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/nt.py?rev=231484&r1=231483&r2=231484&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/nt.py (original)
+++ lnt/trunk/lnt/tests/nt.py Fri Mar  6 10:06:37 2015
@@ -1900,8 +1900,41 @@ class NTTest(builtintest.BuiltinTest):
 
         return result
 
+def _tools_check():
+    """
+    Check that the required software is installed in the system.
+
+    This check is used to make sure the tests won't fail because of a missing
+    tool (like yacc or tclsh).
+
+    As new tools end up required by the tests, add them here.
+    """
+    from subprocess import call
+
+    # Let's try only on Linux, for now
+    if platform.system() != 'Linux':
+      return;
+
+    FNULL = open(os.devnull, 'w')
+
+    status = call(["which", "yacc"], stdout=FNULL, stderr=FNULL)
+    if status > 0:
+      raise SystemExit("""error: yacc not available on your system.""")
+
+    status = call(["which", "groff"], stdout=FNULL, stderr=FNULL)
+    if status > 0:
+      raise SystemExit("""error: groff not available on your system.""")
+
+    status = call(["which", "gawk"], stdout=FNULL, stderr=FNULL)
+    if status > 0:
+      raise SystemExit("""error: gawk not available on your system.""")
+
+    status = call(["which", "tclsh"], stdout=FNULL, stderr=FNULL)
+    if status > 0:
+      raise SystemExit("""error: tclsh not available on your system.""")
 
 def create_instance():
+    _tools_check()
     return NTTest()
 
 __all__ = ['create_instance']





More information about the llvm-commits mailing list