summaryrefslogtreecommitdiffstats
path: root/tests/DumpRenderTree2
diff options
context:
space:
mode:
authorMaksymilian Osowski <maxosowski@google.com>2010-09-17 05:04:19 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-17 05:04:19 -0700
commit44ce3242a984bc3959e43fc832966d7f0ed61159 (patch)
tree79796ef60278db9e451e429c16c39e2c6854bfbe /tests/DumpRenderTree2
parentc0847c55eaef5b91d91abfdcfee5650eb22866eb (diff)
parent78fbc54c182cfc6b21fe745213b02b7ea18775e7 (diff)
downloadframeworks_base-44ce3242a984bc3959e43fc832966d7f0ed61159.zip
frameworks_base-44ce3242a984bc3959e43fc832966d7f0ed61159.tar.gz
frameworks_base-44ce3242a984bc3959e43fc832966d7f0ed61159.tar.bz2
Merge "Changed run_layout_tests.py and run_apache2.py to accept alternative tests root dir."
Diffstat (limited to 'tests/DumpRenderTree2')
-rwxr-xr-xtests/DumpRenderTree2/assets/run_apache2.py21
-rwxr-xr-xtests/DumpRenderTree2/assets/run_layout_tests.py11
2 files changed, 25 insertions, 7 deletions
diff --git a/tests/DumpRenderTree2/assets/run_apache2.py b/tests/DumpRenderTree2/assets/run_apache2.py
index 5d1e66c..25638ba 100755
--- a/tests/DumpRenderTree2/assets/run_apache2.py
+++ b/tests/DumpRenderTree2/assets/run_apache2.py
@@ -26,12 +26,13 @@ import sys
import os
import subprocess
import logging
+import optparse
-def main():
- if len(sys.argv) < 2:
+def main(options, args):
+ if len(args) < 1:
run_cmd = ""
else:
- run_cmd = sys.argv[1]
+ run_cmd = args[0]
# Setup logging class
logging.basicConfig(level=logging.INFO, format='%(message)s')
@@ -53,9 +54,13 @@ def main():
android_tree_root = os.path.join(script_location, parent, parent, parent, parent, parent)
android_tree_root = os.path.normpath(android_tree_root)
- # Paths relative to android_tree_root
+ # If any of these is relative, then it's relative to ServerRoot (in our case android_tree_root)
webkit_path = os.path.join("external", "webkit")
- layout_tests_path = os.path.join(webkit_path, "LayoutTests")
+ if (options.tests_root_directory != None):
+ # if options.tests_root_directory is absolute, os.getcwd() is discarded!
+ layout_tests_path = os.path.normpath(os.path.join(os.getcwd(), options.tests_root_directory))
+ else:
+ layout_tests_path = os.path.join(webkit_path, "LayoutTests")
http_conf_path = os.path.join(layout_tests_path, "http", "conf")
# Prepare the command to set ${APACHE_RUN_USER} and ${APACHE_RUN_GROUP}
@@ -121,4 +126,8 @@ def main():
logging.info("OK")
if __name__ == "__main__":
- main();
+ option_parser = optparse.OptionParser(usage="Usage: %prog [options] start|stop|restart")
+ option_parser.add_option("", "--tests-root-directory",
+ help="The directory from which to take the tests, default is external/webkit/LayoutTests in this checkout of the Android tree")
+ options, args = option_parser.parse_args();
+ main(options, args);
diff --git a/tests/DumpRenderTree2/assets/run_layout_tests.py b/tests/DumpRenderTree2/assets/run_layout_tests.py
index d5bf8b3..fd76e4a 100755
--- a/tests/DumpRenderTree2/assets/run_layout_tests.py
+++ b/tests/DumpRenderTree2/assets/run_layout_tests.py
@@ -32,8 +32,15 @@ def main(options, args):
tmpdir = tempfile.gettempdir()
+ if options.tests_root_directory != None:
+ # if options.tests_root_directory is absolute, os.getcwd() is discarded!
+ tests_root_directory = os.path.normpath(os.path.join(os.getcwd(), options.tests_root_directory))
+ server_options = " --tests-root-directory=" + tests_root_directory
+ else:
+ server_options = "";
+
# Restart the server
- cmd = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "run_apache2.py") + " restart"
+ cmd = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "run_apache2.py") + server_options + " restart"
os.system(cmd);
# Run the tests in path
@@ -73,5 +80,7 @@ if __name__ == "__main__":
option_parser = optparse.OptionParser(usage="Usage: %prog [options] test-relative-path")
option_parser.add_option("", "--show-results-in-browser", default="true",
help="Show the results the host's default web browser, default=true")
+ option_parser.add_option("", "--tests-root-directory",
+ help="The directory from which to take the tests, default is external/webkit/LayoutTests in this checkout of the Android tree")
options, args = option_parser.parse_args();
main(options, args);