[llvm-commits] [LNT] r154720 - in /lnt/trunk: lnt/testing/__init__.py lnt/testing/util/compilers.py tests/testing/Compilers.py
Daniel Dunbar
daniel at zuster.org
Fri Apr 13 16:36:31 PDT 2012
Author: ddunbar
Date: Fri Apr 13 18:36:31 2012
New Revision: 154720
URL: http://llvm.org/viewvc/llvm-project?rev=154720&view=rev
Log:
lnt.testing: Update new reports to include all parts of production build version numbers, and not space pad the result.
Modified:
lnt/trunk/lnt/testing/__init__.py
lnt/trunk/lnt/testing/util/compilers.py
lnt/trunk/tests/testing/Compilers.py
Modified: lnt/trunk/lnt/testing/__init__.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/__init__.py?rev=154720&r1=154719&r2=154720&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/__init__.py (original)
+++ lnt/trunk/lnt/testing/__init__.py Fri Apr 13 18:36:31 2012
@@ -37,6 +37,7 @@
self.machine = machine
self.run = run
self.tests = list(tests)
+ self.report_version = current_version
assert isinstance(self.machine, Machine)
assert isinstance(self.run, Run)
@@ -94,6 +95,9 @@
self.end_time = normalize_time(end_time)
self.info = dict((str(key),str(value))
for key,value in info.items())
+ if '__report_version__' in self.info:
+ raise ValueError("'__report_version__' key is reserved")
+ self.info['__report_version__'] = str(current_version)
def render(self):
return { 'Start Time' : self.start_time,
Modified: lnt/trunk/lnt/testing/util/compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/compilers.py?rev=154720&r1=154719&r2=154720&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/compilers.py (original)
+++ lnt/trunk/lnt/testing/util/compilers.py Fri Apr 13 18:36:31 2012
@@ -123,7 +123,7 @@
error('unable to determine Clang development build info: %r' % (
(cc_name, cc_build_string, cc_extra),))
- m = re.search('clang-([0-9]*)', cc_src_branch)
+ m = re.search('clang-([0-9.]*)', cc_src_branch)
if m:
cc_build = 'PROD'
cc_src_tag, = m.groups()
@@ -201,38 +201,39 @@
info['cc_alt_src_branch'] = cc_alt_src_branch
# Infer the run order from the other things we have computed.
- info['inferred_run_order'] = '%7d' % (get_inferred_run_order(info),)
+ info['inferred_run_order'] = get_inferred_run_order(info)
return info
def get_inferred_run_order(info):
- # If the CC has a src revision, use that.
- if info.get('cc_src_revision','').isdigit():
+ # If the CC has an integral src revision, use that.
+ if info.get('cc_src_revision', '').isdigit():
order = int(info['cc_src_revision'])
# If the CC has an alt src revision, use that if it is greater:
if info.get('cc_alt_src_revision','').isdigit():
order = max(order, int(info.get('cc_alt_src_revision')))
- return order
+ return str(order)
# If this is a production compiler, look for a source tag. We don't accept 0
# or 9999 as valid source tag, since that is what llvm-gcc builds use when
# no build number is given.
- if (info.get('cc_build') == 'PROD' and
- info.get('cc_src_tag') != '0' and
- info.get('cc_src_tag') != '00' and
- info.get('cc_src_tag') != '9999' and
- info.get('cc_src_tag','').split('.',1)[0].isdigit()):
- return int(info['cc_src_tag'].split('.',1)[0])
+ if info.get('cc_build') == 'PROD':
+ m = re.match(r'^[0-9]+(.[0-9]+)*$', info.get('cc_src_tag',''))
+ if m:
+ return m.group(0)
- # If that failed, infer from the LLVM revision.
+ # If that failed, infer from the LLVM revision (if specified on input).
+ #
+ # FIXME: This is only used when using llvm source builds with 'lnt runtest
+ # nt', which itself is deprecated. We should remove this eventually.
if info.get('llvm_revision','').isdigit():
- return int(info['llvm_revision'])
+ return info['llvm_revision']
- # Otherwise, force at least some value for run_order, as it is now
- # generally required by parts of the "simple" schema.
- return 0
+ # Otherwise, force at least some value for run_order, as it is now generally
+ # required by parts of the "simple" schema.
+ return '0'
def infer_cxx_compiler(cc_path):
# If this is obviously a compiler name, then try replacing with the '++'
Modified: lnt/trunk/tests/testing/Compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/testing/Compilers.py?rev=154720&r1=154719&r2=154720&view=diff
==============================================================================
--- lnt/trunk/tests/testing/Compilers.py (original)
+++ lnt/trunk/tests/testing/Compilers.py Fri Apr 13 18:36:31 2012
@@ -24,18 +24,18 @@
assert info['cc_name'] == 'icc'
assert info['cc_build'] == 'PROD'
assert info['cc_target'] == 'i686-apple-darwin11'
-assert info['inferred_run_order'] == ' 12'
+assert info['inferred_run_order'] == '12.1.3'
# Check a random Clang from SVN.
info = get_info("clang-r154331")
pprint.pprint(info)
assert info['cc_name'] == 'clang'
assert info['cc_build'] == 'DEV'
-assert info['inferred_run_order'] == ' 154331'
+assert info['inferred_run_order'] == '154331'
# Check an Apple Clang.
info = get_info("apple-clang-138.1")
pprint.pprint(info)
assert info['cc_name'] == 'apple_clang'
assert info['cc_build'] == 'PROD'
-assert info['inferred_run_order'] == ' 138'
+assert info['inferred_run_order'] == '138.1'
More information about the llvm-commits
mailing list