diff --git a/tools/parse_test_results.py b/tools/parse_test_results.py index e14eef116..200d28348 100755 --- a/tools/parse_test_results.py +++ b/tools/parse_test_results.py @@ -67,6 +67,7 @@ def modification_time(file): return mtime +# TODO: remove this dependency project_name = '' try: @@ -87,26 +88,29 @@ print 'branch: %s' % branch_name os.chdir('regression_tests') -index_mtime = modification_time('index.html') +if len(sys.argv) > 1: + latest_rev = int(sys.argv[1]) +else: + latest_rev = 0 -latest_rev = 0 + for rev in os.listdir('.'): + try: + if not rev.startswith('%s-' % branch_name): continue + r = int(rev[len(branch_name)+1:]) + if r > latest_rev: latest_rev = r + except: pass - -for rev in os.listdir('.'): - try: - if not rev.startswith('%s-' % branch_name): continue - r = int(rev[len(branch_name)+1:]) - if r > latest_rev: latest_rev = r - except: pass - -if latest_rev == 0: - print 'no test files found' - sys.exit(1) + 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) +html_file = '%s.html' % rev_dir +index_mtime = modification_time(html_file) + need_refresh = False for f in glob.glob(os.path.join(rev_dir, '*.json')): @@ -177,14 +181,14 @@ for f in glob.glob(os.path.join(rev_dir, '*.json')): platforms[platform][toolset][features][test_name] = j[cfg] -html = open('index.html', 'w') +html = open(html_file, 'w+') print >>html, '''