Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78fbc54c authored by Maksymilian Osowski's avatar Maksymilian Osowski
Browse files

Changed run_layout_tests.py and run_apache2.py to accept alternative tests root dir.

Change-Id: I6d0537b6712ca6f68ec004e5e8bf95b97b9017fc
parent 44c7197a
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -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,8 +54,12 @@ 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")
  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")

@@ -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);
+10 −1
Original line number Diff line number Diff line
@@ -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);