diff options
author | Steve Block <steveblock@google.com> | 2010-09-28 12:52:11 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-28 13:12:36 +0100 |
commit | 42bf092c47c4af5fbc85283bccdb97fbe4ab76a9 (patch) | |
tree | cdae6ae5b5e83a1303e36c5d5b68ba46a036d27c /tests/DumpRenderTree2 | |
parent | 5c23ebadd48c8c3190878030a9974f1ff36b0419 (diff) | |
download | frameworks_base-42bf092c47c4af5fbc85283bccdb97fbe4ab76a9.zip frameworks_base-42bf092c47c4af5fbc85283bccdb97fbe4ab76a9.tar.gz frameworks_base-42bf092c47c4af5fbc85283bccdb97fbe4ab76a9.tar.bz2 |
Update run_layout_tests.py to give a useful error if DumpRenderTree2 is not found on the device
Bug: 3006981
Change-Id: Ie789eb726bc051305371d4958c16ceca980ea1d1
Diffstat (limited to 'tests/DumpRenderTree2')
-rwxr-xr-x | tests/DumpRenderTree2/assets/run_layout_tests.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/DumpRenderTree2/assets/run_layout_tests.py b/tests/DumpRenderTree2/assets/run_layout_tests.py index fd76e4a..0c63e47 100755 --- a/tests/DumpRenderTree2/assets/run_layout_tests.py +++ b/tests/DumpRenderTree2/assets/run_layout_tests.py @@ -12,6 +12,7 @@ import logging import optparse import os +import re import sys import subprocess import tempfile @@ -47,10 +48,13 @@ def main(options, args): cmd = "adb shell am instrument " cmd += "-e class com.android.dumprendertree2.scriptsupport.Starter#startLayoutTests " cmd += "-e path \"" + path + "\" " - cmd +="-w com.android.dumprendertree2/com.android.dumprendertree2.scriptsupport.ScriptTestRunner" + cmd += "-w com.android.dumprendertree2/com.android.dumprendertree2.scriptsupport.ScriptTestRunner" logging.info("Running the tests...") - subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + (stdoutdata, stderrdata) = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + if re.search("^INSTRUMENTATION_STATUS_CODE: -1", stdoutdata, re.MULTILINE) != None: + logging.info("Failed to run the tests. Is DumpRenderTree2 installed on the device?") + return logging.info("Downloading the summaries...") @@ -58,13 +62,13 @@ def main(options, args): summary_txt_tmp_path = os.path.join(tmpdir, SUMMARY_TXT) cmd = "rm -f " + summary_txt_tmp_path + ";" cmd += "adb pull " + RESULTS_ABSOLUTE_PATH + SUMMARY_TXT + " " + summary_txt_tmp_path - subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + subprocess.Popen(cmd, shell=True).wait() # Download the html summary to tmp folder details_html_tmp_path = os.path.join(tmpdir, DETAILS_HTML) cmd = "rm -f " + details_html_tmp_path + ";" cmd += "adb pull " + RESULTS_ABSOLUTE_PATH + DETAILS_HTML + " " + details_html_tmp_path - subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + subprocess.Popen(cmd, shell=True).wait() # Print summary to console logging.info("All done.\n") |