From 9924f6674c126bfc31f5a9527380c5836d737777 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 17 Jun 2013 04:10:40 +0000 Subject: [PATCH] fix test output parser --- tools/parse_test_results.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tools/parse_test_results.py b/tools/parse_test_results.py index 785d556b0..e14eef116 100755 --- a/tools/parse_test_results.py +++ b/tools/parse_test_results.py @@ -59,6 +59,13 @@ def style_output(o): if subtle: ret += '' return ret +def modification_time(file): + mtime = 0 + try: + mtime = os.stat(file).st_mtime + except: pass + return mtime + project_name = '' @@ -74,17 +81,12 @@ if 'project' in cfg: branch_name = 'trunk' if 'branch' in cfg: - branch_name = cfg['branch'] + branch_name = cfg['branch'].strip() + +print 'branch: %s' % branch_name os.chdir('regression_tests') -def modification_time(file): - mtime = 0 - try: - mtime = os.stat(file).st_mtime - except: pass - return mtime - index_mtime = modification_time('index.html') latest_rev = 0 @@ -92,7 +94,7 @@ latest_rev = 0 for rev in os.listdir('.'): try: - if not rev.startswith('%s-', branch_name): continue + if not rev.startswith('%s-' % branch_name): continue r = int(rev[len(branch_name)+1:]) if r > latest_rev: latest_rev = r except: pass @@ -101,6 +103,8 @@ if latest_rev == 0: print 'no test files found' sys.exit(1) +print 'latest version: %d' % latest_rev + rev_dir = '%s-%d' % (branch_name, latest_rev) need_refresh = False