From 0bcd97c51e2aae9496d5d857aa53aed92e8f98f0 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 17 Jun 2013 06:54:00 +0000 Subject: [PATCH] kill tests that are hung --- .regression.yml | 8 ++++---- tools/run_regression_tests.py | 2 +- tools/run_tests.py | 12 ++++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.regression.yml b/.regression.yml index ff319d78f..2433a02a6 100644 --- a/.regression.yml +++ b/.regression.yml @@ -1,11 +1,11 @@ test_dirs: - test -project: - libtorrent +project: libtorrent -branch: - trunk +branch: trunk + +time_limit: 500 features: - variant=release asserts=production diff --git a/tools/run_regression_tests.py b/tools/run_regression_tests.py index 527eab603..4e775e7af 100644 --- a/tools/run_regression_tests.py +++ b/tools/run_regression_tests.py @@ -51,7 +51,7 @@ options: def loop(): - if len(sys.argv) < 3: + if len(sys.argv) < 2: print_usage() sys.exit(1) diff --git a/tools/run_tests.py b/tools/run_tests.py index 02c290c09..6d83fea12 100755 --- a/tools/run_tests.py +++ b/tools/run_tests.py @@ -78,7 +78,7 @@ def svn_info(): return (revision, author) -def run_tests(toolset, tests, features, options, test_dir): +def run_tests(toolset, tests, features, options, test_dir, time_limit): xml_file = 'bjam_build.%d.xml' % random.randint(0, 100000) results = {} @@ -87,7 +87,7 @@ def run_tests(toolset, tests, features, options, test_dir): os.chdir(test_dir) for t in tests: - p = subprocess.Popen(['bjam', '--out-xml=%s' % xml_file, toolset, t] + options + features.split(' '), stdout=subprocess.PIPE) + p = subprocess.Popen(['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '-q', toolset, t] + options + features.split(' '), stdout=subprocess.PIPE) output = '' for l in p.stdout: output += l @@ -182,6 +182,7 @@ def main(argv): test_dirs = [] configs = [] options = ['boost=source'] + time_limit = 1200 if 'test_dirs' in cfg: for d in cfg['test_dirs']: test_dirs.append(d) @@ -200,6 +201,9 @@ def main(argv): if 'branch' in cfg: branch_name = cfg['branch'] + if 'time_limit' in cfg: + time_limit = int(cfg['time_limit']) + architecture = platform.machine() build_platform = platform.system() + '-' + platform.release() @@ -246,14 +250,14 @@ def main(argv): futures = [] for features in configs: - futures.append(tester_pool.apply_async(run_tests, [toolset, tests, features, options, test_dir])) + futures.append(tester_pool.apply_async(run_tests, [toolset, tests, features, options, test_dir, time_limit])) for future in futures: (toolset, r) = future.get() results.update(r) # for features in configs: -# (toolset, r) = run_tests(toolset, tests, features, options, test_dir) +# (toolset, r) = run_tests(toolset, tests, features, options, test_dir, time_limit) # results.update(r) # each file contains a full set of tests for one speific toolset and platform