Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Commit

Permalink
When running marionette tests, mw_test now captures all MWorks messag…
Browse files Browse the repository at this point in the history
…es on stderr and prints them if a test fails
  • Loading branch information
cstawarz committed Mar 18, 2011
1 parent 24f568f commit 1b660e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions UnitTests/mw_test
Expand Up @@ -84,6 +84,9 @@ def run_marionette_tests(arch_name, test_names=None):
for t in iter_marionette_tests(test):
yield t

env = os.environ.copy()
env['MWORKS_WRITE_MESSAGES_TO_STDERR'] = '1'

failed_tests = []

for test_file in test_file_iter():
Expand Down Expand Up @@ -112,12 +115,15 @@ def run_marionette_tests(arch_name, test_names=None):

print test_name,
sys.stdout.flush()
status = call(args)
cmd = Popen(args, stderr=PIPE, env=env)
output = cmd.communicate()[1]
print ':',
if status == 0:
if cmd.returncode == 0:
print 'OK'
else:
print 'error'
for line in output.strip().split('\n'):
print ' >', line
failed_tests.append(test_name)

return failed_tests
Expand Down

0 comments on commit 1b660e3

Please sign in to comment.