[llvm-commits] [LNT] r166842 - in /lnt/trunk: lnt/testing/util/compilers.py tests/SharedInputs/FakeCompilers/clang-no-info tests/SharedInputs/FakeCompilers/fakecompiler.py tests/testing/Compilers.py
Daniel Dunbar
daniel at zuster.org
Fri Oct 26 17:15:07 PDT 2012
Author: ddunbar
Date: Fri Oct 26 19:15:07 2012
New Revision: 166842
URL: http://llvm.org/viewvc/llvm-project?rev=166842&view=rev
Log:
lnt.testing.util.compilers: Relax checks a bit.
Added:
lnt/trunk/tests/SharedInputs/FakeCompilers/clang-no-info (with props)
Modified:
lnt/trunk/lnt/testing/util/compilers.py
lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py
lnt/trunk/tests/testing/Compilers.py
Modified: lnt/trunk/lnt/testing/util/compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/compilers.py?rev=166842&r1=166841&r2=166842&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/compilers.py (original)
+++ lnt/trunk/lnt/testing/util/compilers.py Fri Oct 26 19:15:07 2012
@@ -76,10 +76,19 @@
error("unable to find compiler cc1 binary: %r: %r" % (
cc, cc_version))
m = re.match(r'(.*) version ([^ ]*) (\([^(]*\))(.*)', version_ln)
- if not m:
- error("unable to determine compiler version: %r: %r" % (
- cc, version_ln))
- cc_name,cc_version_num,cc_build_string,cc_extra = m.groups()
+ if m is not None:
+ cc_name,cc_version_num,cc_build_string,cc_extra = m.groups()
+ else:
+ # If that didn't match, try a more basic pattern.
+ m = re.match(r'(.*) version ([^ ]*)', version_ln)
+ if m is not None:
+ cc_name,cc_version_num = m.groups()
+ cc_build_string = cc_extra = ""
+ else:
+ error("unable to determine compiler version: %r: %r" % (
+ cc, version_ln))
+ cc_name = "unknown"
+ cc_version_num = cc_build_string = cc_extra = ""
# Compute normalized compiler name and type. We try to grab source
# revisions, branches, and tags when possible.
@@ -119,7 +128,7 @@
# These show up with git-svn.
if cc_src_branch == '$URL$':
- cc_src_branch = None
+ cc_src_branch = ""
else:
# Otherwise, see if we can match a branch and a tag name. That could
# be a git hash.
@@ -129,6 +138,7 @@
else:
error('unable to determine Clang development build info: %r' % (
(cc_name, cc_build_string, cc_extra),))
+ cc_src_branch = ""
m = re.search('clang-([0-9.]*)', cc_src_branch)
if m:
@@ -200,7 +210,7 @@
info['cc_src_tag'] = cc_src_tag
if cc_src_revision is not None:
info['cc_src_revision'] = cc_src_revision
- if cc_src_branch is not None:
+ if cc_src_branch:
info['cc_src_branch'] = cc_src_branch
if cc_alt_src_revision is not None:
info['cc_alt_src_revision'] = cc_alt_src_revision
Added: lnt/trunk/tests/SharedInputs/FakeCompilers/clang-no-info
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/FakeCompilers/clang-no-info?rev=166842&view=auto
==============================================================================
--- lnt/trunk/tests/SharedInputs/FakeCompilers/clang-no-info (added)
+++ lnt/trunk/tests/SharedInputs/FakeCompilers/clang-no-info Fri Oct 26 19:15:07 2012
@@ -0,0 +1 @@
+link fakecompiler.py
\ No newline at end of file
Propchange: lnt/trunk/tests/SharedInputs/FakeCompilers/clang-no-info
------------------------------------------------------------------------------
svn:special = *
Modified: lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py?rev=166842&r1=166841&r2=166842&view=diff
==============================================================================
--- lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py (original)
+++ lnt/trunk/tests/SharedInputs/FakeCompilers/fakecompiler.py Fri Oct 26 19:15:07 2012
@@ -125,6 +125,23 @@
if inspect.isclass(value) and \
issubclass(value, FakeCompiler))
+class ClangNoInfo(LLVMCompiler):
+ compiler_name = "clang-no-info"
+
+ def print_verbose_info(self):
+ print >>sys.stderr, """\
+clang version 3.2
+Target: x86_64-bla-bla
+Thread model: posix"""
+ print >>sys.stderr, """\
+ "%s" "-cc1" "-E" ... more boring stuff here ...""" % (
+ g_program,)
+
+fake_compilers = dict((value.compiler_name, value)
+ for key,value in locals().items()
+ if inspect.isclass(value) and \
+ issubclass(value, FakeCompiler))
+
def main():
global g_program
g_program = sys.argv[0]
Modified: lnt/trunk/tests/testing/Compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/testing/Compilers.py?rev=166842&r1=166841&r2=166842&view=diff
==============================================================================
--- lnt/trunk/tests/testing/Compilers.py (original)
+++ lnt/trunk/tests/testing/Compilers.py Fri Oct 26 19:15:07 2012
@@ -56,3 +56,9 @@
assert info['inferred_run_order'] == '%s,%s' % (
'8ab09316f63ea99ff23b2684c454b1008b8d5f10',
'7c53f795961cc2d35b85d315aadb2ac135a0fdb2')
+
+# Check a Clang that prints no info.
+info = get_info("clang-no-info")
+pprint.pprint(info)
+assert info['cc_name'] == 'clang'
+assert info['cc_version_number'] == '3.2'
More information about the llvm-commits
mailing list