summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author Shubham Ajmera <shubhamajmera@google.com> 2017-03-24 16:19:48 -0700
committer Shubham Ajmera <shubhamajmera@google.com> 2017-03-27 10:26:25 -0700
commit3092c6e98af27c57d26f7c119833fe41f1f489e9 (patch)
tree15328b332f802862f1c0d09a035a059deae4ff17 /test
parent3b8adf50f6e634390a31027bdb0a22a35b7a0384 (diff)
Testrunner: Fix output parsing issue
Android build system determines failure info in the build log by looking for a line starting with "FAILED: ". The new format of the testrunner makes sure that the build system is able to parse the error from the log. Test: ./art/test.py -r -t 00 Change-Id: Iab29f254f600d4c3ee74cae2675da3a624e724ef
Diffstat (limited to 'test')
-rwxr-xr-xtest/testrunner/run_build_test_target.py6
-rwxr-xr-xtest/testrunner/testrunner.py20
2 files changed, 14 insertions, 12 deletions
diff --git a/test/testrunner/run_build_test_target.py b/test/testrunner/run_build_test_target.py
index e105da33d4..282ac484b6 100755
--- a/test/testrunner/run_build_test_target.py
+++ b/test/testrunner/run_build_test_target.py
@@ -53,7 +53,8 @@ if target.get('target'):
build_command += ' ' + target.get('target')
# Add 'dist' to avoid Jack issues b/36169180.
build_command += ' dist'
- print build_command.split()
+ sys.stdout.write(str(build_command))
+ sys.stdout.flush()
if subprocess.call(build_command.split()):
sys.exit(1)
@@ -66,7 +67,8 @@ if target.get('run-tests'):
run_test_command += ['--host']
run_test_command += ['--verbose']
- print run_test_command
+ sys.stdout.write(str(run_test_command))
+ sys.stdout.flush()
if subprocess.call(run_test_command):
sys.exit(1)
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 3203f7ad84..99e87c08b6 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -480,7 +480,7 @@ def run_test(command, test, test_variant, test_name):
if test_passed:
print_test_info(test_name, 'PASS')
else:
- failed_tests.append(test_name)
+ failed_tests.append((test_name, script_output))
if not env.ART_TEST_KEEP_GOING:
stop_testrunner = True
print_test_info(test_name, 'FAIL', ('%s\n%s') % (
@@ -491,13 +491,13 @@ def run_test(command, test, test_variant, test_name):
else:
print_test_info(test_name, '')
except subprocess.TimeoutExpired as e:
- failed_tests.append(test_name)
- print_test_info(test_name, 'TIMEOUT', 'timed out in %d\n%s' % (
+ failed_tests.append((test_name, 'Timed out in %d seconds'))
+ print_test_info(test_name, 'TIMEOUT', 'Timed out in %d seconds\n%s' % (
timeout, command))
except Exception as e:
- failed_tests.append(test_name)
- print_test_info(test_name, 'FAIL')
- print_text(('%s\n%s\n\n') % (command, str(e)))
+ failed_tests.append((test_name, str(e)))
+ print_test_info(test_name, 'FAIL',
+ ('%s\n%s\n\n') % (command, str(e)))
finally:
semaphore.release()
@@ -711,16 +711,16 @@ def print_analysis():
# Prints the list of skipped tests, if any.
if skipped_tests:
- print_text(COLOR_SKIP + 'SKIPPED TESTS' + COLOR_NORMAL + '\n')
+ print_text(COLOR_SKIP + 'SKIPPED TESTS: ' + COLOR_NORMAL + '\n')
for test in skipped_tests:
print_text(test + '\n')
print_text('\n')
# Prints the list of failed tests, if any.
if failed_tests:
- print_text(COLOR_ERROR + 'FAILED TESTS' + COLOR_NORMAL + '\n')
- for test in failed_tests:
- print_text(test + '\n')
+ print_text(COLOR_ERROR + 'FAILED: ' + COLOR_NORMAL + '\n')
+ for test_info in failed_tests:
+ print_text(('%s\n%s\n' % (test_info[0], test_info[1])))
def parse_test_name(test_name):