diff --git a/.regression.yml b/.regression.yml index 342429b49..ff319d78f 100644 --- a/.regression.yml +++ b/.regression.yml @@ -4,6 +4,9 @@ test_dirs: project: libtorrent +branch: + trunk + features: - variant=release asserts=production - statistics=on logging=verbose disk-stats=on bandwidth-limit-logging=on dht=logging diff --git a/tools/parse_test_results.py b/tools/parse_test_results.py index 7ce51960b..785d556b0 100755 --- a/tools/parse_test_results.py +++ b/tools/parse_test_results.py @@ -68,9 +68,14 @@ except: print '.regression.yml not found in current directory' sys.exit(1) cfg = yaml.load(cfg.read()) + if 'project' in cfg: project_name = cfg['project'] +branch_name = 'trunk' +if 'branch' in cfg: + branch_name = cfg['branch'] + os.chdir('regression_tests') def modification_time(file): @@ -84,9 +89,11 @@ index_mtime = modification_time('index.html') latest_rev = 0 + for rev in os.listdir('.'): try: - r = int(rev) + if not rev.startswith('%s-', branch_name): continue + r = int(rev[len(branch_name)+1:]) if r > latest_rev: latest_rev = r except: pass @@ -94,7 +101,7 @@ if latest_rev == 0: print 'no test files found' sys.exit(1) -rev_dir = '%d' % latest_rev +rev_dir = '%s-%d' % (branch_name, latest_rev) need_refresh = False diff --git a/tools/run_regression_tests.py b/tools/run_regression_tests.py index 6aecb6bb0..7c77e7b76 100644 --- a/tools/run_regression_tests.py +++ b/tools/run_regression_tests.py @@ -33,12 +33,11 @@ def svn_up(revision): os.system('svn up %d' % revision) def print_usage(): - print '''usage: run_regression_tests.py remote-path [options] toolset [toolset...] + print '''usage: run_regression_tests.py [options] toolset [toolset...] toolset are bjam toolsets. For instance clang, gcc, darwin, msvc etc. -remote-path is an scp path where the results are copied. This path has -the form: user@hostname:/path -if the remote-path is set to "-", no copying will be done +The path "./regression_tests" is expected to be a shared folder +between all testsers. options: @@ -47,8 +46,6 @@ options: def loop(): - remote_path = sys.argv[1] - root_path = os.path.join(os.getcwd(), 'regression_tests') if len(sys.argv) < 3: print_usage() @@ -64,11 +61,8 @@ def loop(): print '\n\nREVISION %d ===\n' % r svn_up(r) - run_tests.main(sys.argv[2:]) + run_tests.main(sys.argv[1:]) - if remote_path != '-': - os.system('scp -r %s %s' % (os.path.join(root_path, '%d' % r), remote_path)) - time.sleep(120) if __name__ == "__main__": diff --git a/tools/run_tests.py b/tools/run_tests.py index 440e1618c..02c290c09 100755 --- a/tools/run_tests.py +++ b/tools/run_tests.py @@ -196,6 +196,10 @@ def main(argv): else: configs = [['']] + branch_name = 'trunk' + if 'branch' in cfg: + branch_name = cfg['branch'] + architecture = platform.machine() build_platform = platform.system() + '-' + platform.release() @@ -205,7 +209,7 @@ def main(argv): tester_pool = Pool(processes=num_processes) - print '%d - %s - %s' % (revision, author, timestamp) + print '%s-%d - %s - %s' % (branch_name, revision, author, timestamp) print 'toolsets: %s' % ' '.join(toolsets) # print 'configs: %s' % '|'.join(configs) @@ -216,12 +220,12 @@ def main(argv): rev_dir = os.path.join(current_dir, 'regression_tests') try: os.mkdir(rev_dir) except: pass - rev_dir = os.path.join(rev_dir, '%d' % revision) + rev_dir = os.path.join(rev_dir, '%s-%d' % (branch_name, revision)) try: os.mkdir(rev_dir) except: pass for test_dir in test_dirs: - print 'running tests from "%s"' % test_dir + print 'running tests from "%s" in %s' % (test_dir, branch_name) os.chdir(test_dir) test_dir = os.getcwd()