add error reporting and fix bug in run_tests.py
This commit is contained in:
@@ -45,6 +45,7 @@ import yaml
|
|||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
|
import traceback
|
||||||
|
|
||||||
# the .regression.yml configuration file format looks like this (it's yaml):
|
# the .regression.yml configuration file format looks like this (it's yaml):
|
||||||
|
|
||||||
@@ -89,13 +90,14 @@ def run_tests(toolset, tests, features, options, test_dir, time_limit, increment
|
|||||||
|
|
||||||
os.chdir(test_dir)
|
os.chdir(test_dir)
|
||||||
|
|
||||||
if not incremental:
|
# if not incremental:
|
||||||
p = subprocess.Popen(['bjam', '--abbreviate-paths', toolset, 'clean'] + options + features.split(' '), stdout=subprocess.PIPE)
|
# p = subprocess.Popen(['bjam', '--abbreviate-paths', toolset, 'clean'] + options + features., 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:
|
||||||
p = subprocess.Popen(['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '-q', '--abbreviate-paths', toolset, t] + options + features.split(' '), stdout=subprocess.PIPE)
|
# print 'calling bjam %s %s %s' % (toolset, t, ' '.join(features))
|
||||||
|
p = subprocess.Popen(['bjam', '--out-xml=%s' % xml_file, '-l%d' % time_limit, '-q', '--abbreviate-paths', toolset, t] + options + features, stdout=subprocess.PIPE)
|
||||||
output = ''
|
output = ''
|
||||||
for l in p.stdout:
|
for l in p.stdout:
|
||||||
output += l.decode('latin-1')
|
output += l.decode('latin-1')
|
||||||
@@ -130,23 +132,16 @@ def run_tests(toolset, tests, features, options, test_dir, time_limit, increment
|
|||||||
r = { 'status': p.returncode, 'output': output, 'command': command }
|
r = { 'status': p.returncode, 'output': output, 'command': command }
|
||||||
results[t + '|' + features] = r
|
results[t + '|' + features] = r
|
||||||
|
|
||||||
fail_color = '\033[31;1m'
|
|
||||||
pass_color = '\033[32;1m'
|
|
||||||
end_seq = '\033[0m'
|
|
||||||
|
|
||||||
if platform.system() == 'Windows':
|
|
||||||
fail_color == ''
|
|
||||||
pass_color == ''
|
|
||||||
end_seq = ''
|
|
||||||
|
|
||||||
if p.returncode == 0: sys.stdout.write('.')
|
if p.returncode == 0: sys.stdout.write('.')
|
||||||
else: sys.stdout.write('X')
|
else: sys.stdout.write('X')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
except:
|
except Exception, e:
|
||||||
# need this to make child processes exit
|
# need this to make child processes exit
|
||||||
|
print 'exiting test process: ', traceback.format_exc()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
finally:
|
finally:
|
||||||
|
print 'done runnint tests'
|
||||||
try: os.unlink(xml_file)
|
try: os.unlink(xml_file)
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user