fix current directory restoring and svn update parsing

This commit is contained in:
Arvid Norberg 2013-06-16 22:51:03 +00:00
parent 4a10778b88
commit f3d144b06f
2 changed files with 42 additions and 34 deletions

View File

@ -19,6 +19,8 @@ def svn_fetch():
for l in p.stdout: for l in p.stdout:
if 'At revision ' in l: if 'At revision ' in l:
revision = int(l.split('At revision')[1].strip()[0:-1]) revision = int(l.split('At revision')[1].strip()[0:-1])
if 'Updated to revision ' in l:
revision = int(l.split('Updated to revision')[1].strip()[0:-1])
output += l output += l
if revision == -1: if revision == -1:

View File

@ -210,49 +210,55 @@ def main(argv):
print 'toolsets: %s' % ' '.join(toolsets) print 'toolsets: %s' % ' '.join(toolsets)
# print 'configs: %s' % '|'.join(configs) # print 'configs: %s' % '|'.join(configs)
rev_dir = os.path.join(os.getcwd(), 'regression_tests') current_dir = os.getcwd()
try: os.mkdir(rev_dir)
except: pass
rev_dir = os.path.join(rev_dir, '%d' % revision)
try: os.mkdir(rev_dir)
except: pass
for test_dir in test_dirs: try:
print 'running tests from "%s"' % test_dir rev_dir = os.path.join(current_dir, 'regression_tests')
os.chdir(test_dir) try: os.mkdir(rev_dir)
test_dir = os.getcwd() except: pass
rev_dir = os.path.join(rev_dir, '%d' % revision)
try: os.mkdir(rev_dir)
except: pass
# figure out which tests are exported by this Jamfile for test_dir in test_dirs:
p = subprocess.Popen(['bjam', '--dump-tests', 'non-existing-target'], stdout=subprocess.PIPE) print 'running tests from "%s"' % test_dir
os.chdir(test_dir)
test_dir = os.getcwd()
tests = [] # figure out which tests are exported by this Jamfile
p = subprocess.Popen(['bjam', '--dump-tests', 'non-existing-target'], stdout=subprocess.PIPE)
for l in p.stdout: tests = []
if not 'boost-test(RUN)' in l: continue
test_name = os.path.split(l.split(' ')[1][1:-1])[1]
tests.append(test_name)
print 'found %d tests' % len(tests)
for toolset in toolsets: for l in p.stdout:
results = {} if not 'boost-test(RUN)' in l: continue
toolset_found = False test_name = os.path.split(l.split(' ')[1][1:-1])[1]
tests.append(test_name)
print 'found %d tests' % len(tests)
futures = [] for toolset in toolsets:
for features in configs: results = {}
futures.append(tester_pool.apply_async(run_tests, [toolset, tests, features, options, test_dir])) toolset_found = False
for future in futures: futures = []
(toolset, r) = future.get() for features in configs:
results.update(r) futures.append(tester_pool.apply_async(run_tests, [toolset, tests, features, options, test_dir]))
# for features in configs: for future in futures:
# (toolset, r) = run_tests(toolset, tests, features, options, test_dir) (toolset, r) = future.get()
# results.update(r) results.update(r)
# each file contains a full set of tests for one speific toolset and platform # for features in configs:
f = open(os.path.join(rev_dir, build_platform + '#' + toolset + '.json'), 'w+') # (toolset, r) = run_tests(toolset, tests, features, options, test_dir)
print >>f, json.dumps(results) # results.update(r)
f.close()
# each file contains a full set of tests for one speific toolset and platform
f = open(os.path.join(rev_dir, build_platform + '#' + toolset + '.json'), 'w+')
print >>f, json.dumps(results)
f.close()
finally:
# always restore current directory
os.chdir(current_dir)
if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv[1:]) main(sys.argv[1:])