summaryrefslogtreecommitdiff
path: root/test/testrunner/testrunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/testrunner/testrunner.py')
-rwxr-xr-xtest/testrunner/testrunner.py36
1 files changed, 23 insertions, 13 deletions
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 3203f7ad84..49dc657020 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -53,6 +53,7 @@ import os
import re
import subprocess
import sys
+import tempfile
import threading
import time
@@ -146,7 +147,7 @@ def gather_test_info():
VARIANT_TYPE_DICT['jni'] = {'jni', 'forcecopy', 'checkjni'}
VARIANT_TYPE_DICT['address_sizes'] = {'64', '32'}
VARIANT_TYPE_DICT['compiler'] = {'interp-ac', 'interpreter', 'jit', 'optimizing',
- 'regalloc_gc'}
+ 'regalloc_gc', 'speed-profile'}
for v_type in VARIANT_TYPE_DICT:
TOTAL_VARIANTS_SET = TOTAL_VARIANTS_SET.union(VARIANT_TYPE_DICT.get(v_type))
@@ -191,6 +192,8 @@ def setup_test_env():
if env.ART_TEST_OPTIMIZING:
COMPILER_TYPES.add('optimizing')
OPTIMIZING_COMPILER_TYPES.add('optimizing')
+ if env.ART_TEST_SPEED_PROFILE:
+ COMPILER_TYPES.add('speed-profile')
# By default we run all 'compiler' variants.
if not COMPILER_TYPES:
@@ -198,6 +201,7 @@ def setup_test_env():
COMPILER_TYPES.add('jit')
COMPILER_TYPES.add('interpreter')
COMPILER_TYPES.add('interp-ac')
+ COMPILER_TYPES.add('speed-profile')
OPTIMIZING_COMPILER_TYPES.add('optimizing')
if env.ART_TEST_RUN_TEST_RELOCATE:
@@ -388,6 +392,8 @@ def run_tests(tests):
options_test += ' --interpreter --verify-soft-fail'
elif compiler == 'jit':
options_test += ' --jit'
+ elif compiler == 'speed-profile':
+ options_test += ' --random-profile'
if relocate == 'relocate':
options_test += ' --relocate'
@@ -433,8 +439,10 @@ def run_tests(tests):
options_test += ' --instruction-set-features ' + \
env.HOST_2ND_ARCH_PREFIX_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES
- options_test = (' --output-path %s/run-test-output/%s') % (
- env.ART_HOST_TEST_DIR, test_name) + options_test
+ # TODO(http://36039166): This is a temporary solution to
+ # fix build breakages.
+ options_test = (' --output-path %s') % (
+ tempfile.mkdtemp(dir=env.ART_HOST_TEST_DIR)) + options_test
run_test_sh = env.ANDROID_BUILD_TOP + '/art/test/run-test'
command = run_test_sh + ' ' + options_test + ' ' + test
@@ -480,7 +488,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 +499,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 +719,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):
@@ -878,6 +886,8 @@ def parse_option():
IMAGE_TYPES.add('no-image')
if options['optimizing']:
COMPILER_TYPES.add('optimizing')
+ if options['speed_profile']:
+ COMPILER_TYPES.add('speed-profile')
if options['trace']:
TRACE_TYPES.add('trace')
if options['gcstress']: