summaryrefslogtreecommitdiff
path: root/test/testrunner/testrunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/testrunner/testrunner.py')
-rwxr-xr-xtest/testrunner/testrunner.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 8072631e8e..77ef25a75b 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -450,6 +450,12 @@ def run_tests(tests):
options_test += ' --instruction-set-features ' + \
env.HOST_2ND_ARCH_PREFIX_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES
+ # Use the default run-test behavior unless ANDROID_COMPILE_WITH_JACK is explicitly set.
+ if env.ANDROID_COMPILE_WITH_JACK == True:
+ options_test += ' --build-with-jack'
+ elif env.ANDROID_COMPILE_WITH_JACK == False:
+ options_test += ' --build-with-javac-dx'
+
# TODO(http://36039166): This is a temporary solution to
# fix build breakages.
options_test = (' --output-path %s') % (
@@ -491,7 +497,11 @@ def run_test(command, test, test_variant, test_name):
test_skipped = True
else:
test_skipped = False
- proc = subprocess.Popen(command.split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True)
+ if gdb:
+ proc = subprocess.Popen(command.split(), stderr=subprocess.STDOUT, universal_newlines=True)
+ else:
+ proc = subprocess.Popen(command.split(), stderr=subprocess.STDOUT, stdout = subprocess.PIPE,
+ universal_newlines=True)
script_output = proc.communicate(timeout=timeout)[0]
test_passed = not proc.wait()
@@ -740,6 +750,9 @@ def print_analysis():
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])))
+ print_text(COLOR_ERROR + '----------' + COLOR_NORMAL + '\n')
+ for failed_test in sorted([test_info[0] for test_info in failed_tests]):
+ print_text(('%s\n' % (failed_test)))
def parse_test_name(test_name):
@@ -818,7 +831,15 @@ def get_default_threads(target):
adb_command = 'adb shell cat /sys/devices/system/cpu/present'
cpu_info_proc = subprocess.Popen(adb_command.split(), stdout=subprocess.PIPE)
cpu_info = cpu_info_proc.stdout.read()
- return int(cpu_info.split('-')[1])
+ if type(cpu_info) is bytes:
+ cpu_info = cpu_info.decode('utf-8')
+ cpu_info_regex = '\d*-(\d*)'
+ match = re.match(cpu_info_regex, cpu_info)
+ if match:
+ return int(match.group(1))
+ else:
+ raise ValueError('Unable to predict the concurrency for the target. '
+ 'Is device connected?')
else:
return multiprocessing.cpu_count()