test script fixes
This commit is contained in:
parent
78da577e2b
commit
d065ed3106
|
@ -44,6 +44,8 @@ def style_output(o):
|
||||||
ret = ''
|
ret = ''
|
||||||
subtle = False
|
subtle = False
|
||||||
for l in o.split('\n'):
|
for l in o.split('\n'):
|
||||||
|
l = l.replace('<', '<')
|
||||||
|
l = l.replace('>', '>')
|
||||||
if 'TEST_CHECK' in l or 'TEST_EQUAL_ERROR' in l or l.startswith('EXIT STATUS: ') or \
|
if 'TEST_CHECK' in l or 'TEST_EQUAL_ERROR' in l or l.startswith('EXIT STATUS: ') or \
|
||||||
l.endswith(' second time limit exceeded'):
|
l.endswith(' second time limit exceeded'):
|
||||||
ret += '<span class="test-error">%s</span>\n' % l
|
ret += '<span class="test-error">%s</span>\n' % l
|
||||||
|
|
|
@ -105,7 +105,7 @@ def loop():
|
||||||
|
|
||||||
open(rev_file, 'w+').write('%d' % last_rev)
|
open(rev_file, 'w+').write('%d' % last_rev)
|
||||||
|
|
||||||
time.sleep(120)
|
if revs == []: time.sleep(300)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
loop()
|
loop()
|
||||||
|
|
|
@ -82,21 +82,25 @@ def svn_info():
|
||||||
return (revision, author)
|
return (revision, author)
|
||||||
|
|
||||||
def run_tests(toolset, tests, features, options, test_dir, time_limit, incremental):
|
def run_tests(toolset, tests, features, options, test_dir, time_limit, incremental):
|
||||||
|
assert(type(features) == str)
|
||||||
|
|
||||||
xml_file = 'bjam_build.%d.xml' % random.randint(0, 100000)
|
xml_file = 'bjam_build.%d.xml' % random.randint(0, 100000)
|
||||||
try:
|
try:
|
||||||
|
|
||||||
results = {}
|
results = {}
|
||||||
toolset_found = False
|
toolset_found = False
|
||||||
|
|
||||||
|
feature_list = features.split(' ')
|
||||||
os.chdir(test_dir)
|
os.chdir(test_dir)
|
||||||
|
|
||||||
# if not incremental:
|
# if not incremental:
|
||||||
# p = subprocess.Popen(['bjam', '--abbreviate-paths', toolset, 'clean'] + options + features., stdout=subprocess.PIPE)
|
# p = subprocess.Popen(['bjam', '--abbreviate-paths', toolset, 'clean'] + options + feature_list, stdout=subprocess.PIPE)
|
||||||
# for l in p.stdout: pass
|
# for l in p.stdout: pass
|
||||||
# p.wait()
|
# p.wait()
|
||||||
|
|
||||||
|
|
||||||
for t in tests:
|
for t in tests:
|
||||||
cmdline = ['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '--abbreviate-paths', toolset, t] + options + features.split(' ')
|
cmdline = ['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '--abbreviate-paths', toolset, t] + options + feature_list
|
||||||
# print 'calling ', cmdline
|
# print 'calling ', cmdline
|
||||||
p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
|
p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
|
||||||
output = ''
|
output = ''
|
||||||
|
@ -206,7 +210,7 @@ def main(argv):
|
||||||
for d in cfg['features']:
|
for d in cfg['features']:
|
||||||
configs.append(d)
|
configs.append(d)
|
||||||
else:
|
else:
|
||||||
configs = [['']]
|
configs = ['']
|
||||||
|
|
||||||
clean_files = []
|
clean_files = []
|
||||||
if 'clean' in cfg:
|
if 'clean' in cfg:
|
||||||
|
@ -293,13 +297,16 @@ def main(argv):
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
if len(clean_files) > 0:
|
if len(clean_files) > 0:
|
||||||
|
print 'deleting ',
|
||||||
for filt in clean_files:
|
for filt in clean_files:
|
||||||
for f in glob.glob(filt):
|
for f in glob.glob(filt):
|
||||||
# a precautio to make sure a malicious repo
|
# a precautio to make sure a malicious repo
|
||||||
# won't clean things outside of the test directory
|
# won't clean things outside of the test directory
|
||||||
if not os.path.abspath(f).startswith(test_dir): continue
|
if not os.path.abspath(f).startswith(test_dir): continue
|
||||||
print 'deleting %s' %f
|
print '%s ' % f,
|
||||||
shutil.rmtree(f)
|
try: shutil.rmtree(f)
|
||||||
|
except: pass
|
||||||
|
print ''
|
||||||
finally:
|
finally:
|
||||||
# always restore current directory
|
# always restore current directory
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue