Making the sanity checker easier to read.

This commit is contained in:
Ian A Mason
2016-08-11 11:55:14 -07:00
parent 0701c1cb15
commit 65325c1d5b
3 changed files with 18 additions and 6 deletions
+3 -1
View File
@@ -1,2 +1,4 @@
*.pyc
.idea
.idea
key.cfg
wllvm.egg-info
+14 -4
View File
@@ -184,6 +184,7 @@ class Checker(object):
print 'Insane\n'
return False
def checkCompilers(self, cc, cxx):
"""Tests that the compilers actually exist."""
@@ -193,12 +194,12 @@ class Checker(object):
if not ccOk:
print 'The C compiler {0} was not found or not executable.\nBetter not try using wllvm!\n'.format(cc)
else:
print 'The C compiler {0} is:\n{1}\n'.format(cc, ccVersion)
print 'The C compiler {0} is:\n\n{1}\n'.format(cc, extractLine(ccVersion, 0))
if not cxxOk:
print 'The CXX compiler {0} was not found or not executable.\nBetter not try using wllvm++!\n'.format(cxx)
else:
print 'The C++ compiler {0} is:\n\n{1}\n'.format(cxx, cxxVersion)
print 'The C++ compiler {0} is:\n\n{1}\n'.format(cxx, extractLine(cxxVersion, 0))
if not ccOk or not cxxOk:
print explain_LLVM_COMPILER_PATH
@@ -253,12 +254,21 @@ class Checker(object):
print 'The bitcode linker {0} was not found or not executable.\nBetter not try using extract-bc!\n'.format(link)
print explain_LLVM_LINK_NAME
else:
print 'The bitcode linker {0} is:\n\n{1}\n'.format(link, linkVersion)
print 'The bitcode linker {0} is:\n\n{1}\n'.format(link, extractLine(linkVersion, 1))
if not arOk:
print 'The bitcode archiver {0} was not found or not executable.\nBetter not try using extract-bc!\n'.format(ar)
print explain_LLVM_AR_NAME
else:
print 'The bitcode archiver {0} is:\n\n{1}\n'.format(ar, arVersion)
print 'The bitcode archiver {0} is:\n\n{1}\n'.format(ar, extractLine(arVersion, 1))
def extractLine(version, n):
if not version:
return version
lines = version.split('\n')
if n < len(lines):
return lines[n]
else:
return lines[-1]
+1 -1
View File
@@ -8,7 +8,7 @@ Hopefully never dumping a python stack trace.
import sys
from checker import *
from checker import Checker
def main():
return Checker().check()