aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-26 10:51:45 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-26 10:51:45 -0700
commita11ff3b3abdbc2052b352a07bfad29c644f3ff2d (patch)
tree9c73f72d8e4bdce41601162b44115df6f125948d
parente5338c8d8d7fd7bc72755d4f2dd3064ff2a2cea2 (diff)
parenta7eae6979a82e1a4a8c4c96d154ec4350288929a (diff)
Merge pull request #581 from LCID-Fire/debian_clang_check
Extract check_clang_version into an own function and correct checking so...
-rwxr-xr-xtests/runner.py2
-rw-r--r--tools/shared.py15
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/runner.py b/tests/runner.py
index fa0e0c0e..a3779668 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -8880,7 +8880,7 @@ elif 'sanity' in str(sys.argv):
restore()
# Clang should report the version number we expect, and emcc should not warn
- assert ('clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION))) in Popen([CLANG, '-v'], stderr=PIPE).communicate()[1]
+ assert check_clang_version()
output = self.check_working(EMCC)
assert LLVM_WARNING not in output, output
diff --git a/tools/shared.py b/tools/shared.py
index 700849e8..2fc894d0 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -47,12 +47,19 @@ except Exception, e:
EXPECTED_LLVM_VERSION = (3,1)
+def check_clang_version():
+ expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION))
+ actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0]
+ if expected in actual:
+ return True
+
+ print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected)
+ return False
+
+
def check_llvm_version():
try:
- expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION))
- actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0][0:len(expected)]
- if expected != actual:
- print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected)
+ check_clang_version();
except Exception, e:
print >> sys.stderr, 'warning: Could not verify LLVM version: %s' % str(e)