aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2013-03-15 14:44:13 -0700
committerChromeBot <chrome-bot@google.com>2013-03-15 15:51:37 -0700
commitf81680c018729fd4499e1e200d04b48c4b90127c (patch)
tree940608da8374604b82edfdb2d7df55d065f05d4c /run_tests.py
parent2296ee0b914aba5bba07becab4ff68884ce9b8a5 (diff)
downloadtoolchain-utils-f81680c018729fd4499e1e200d04b48c4b90127c.tar.gz
Cleaned up directory after copy of tools from perforce directory
Got rid of stale copies of some tools like "crosperf" and moved all files under v14 directory (that came from perforce) into the top directory. BUG=None TEST=None Change-Id: I408d17a36ceb00e74db71403d2351fd466a14f8e Reviewed-on: https://gerrit-int.chromium.org/33887 Tested-by: Luis Lozano <llozano@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@google.com> Commit-Queue: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py75
1 files changed, 75 insertions, 0 deletions
diff --git a/run_tests.py b/run_tests.py
new file mode 100755
index 00000000..075f29b1
--- /dev/null
+++ b/run_tests.py
@@ -0,0 +1,75 @@
+#!/usr/bin/python2.6
+#
+# Copyright 2010 Google Inc. All Rights Reserved.
+
+"""Script to wrap run_remote_tests.sh script.
+
+This script calls run_remote_tests.sh with standard tests.
+"""
+
+__author__ = "asharif@google.com (Ahmad Sharif)"
+
+import optparse
+import os
+import re
+import sys
+
+from utils import command_executer
+from utils import logger
+import build_chromeos
+
+
+def Main(argv):
+ """The main function."""
+ parser = optparse.OptionParser()
+ parser.add_option("-c", "--chromeos_root", dest="chromeos_root",
+ help="ChromeOS root checkout directory.")
+ parser.add_option("-r", "--remote", dest="remote",
+ help="The IP address of the remote ChromeOS machine.")
+ parser.add_option("-b", "--board", dest="board",
+ help="The board of the target.")
+
+ (options, args) = parser.parse_args(argv)
+
+ tests = ""
+
+ if options.board is None or options.remote is None:
+ parser.print_help()
+ return -1
+
+ if options.chromeos_root is None:
+ m = "--chromeos_root not given. Setting ../../ as chromeos_root"
+ logger.GetLogger().LogWarning(m)
+ options.chromeos_root = "../.."
+
+ rrt_file = "%s/src/scripts/run_remote_tests.sh" % options.chromeos_root
+ if not os.path.isfile(rrt_file):
+ m = "File %s not found" % rrt_file
+ logger.GetLogger().LogError(m)
+ return -1
+
+ if args:
+ tests = " " + " ".join(args[1:])
+
+ case_insensitive_page = re.compile("page", re.IGNORECASE)
+ tests = case_insensitive_page.sub("Page", tests)
+
+ return RunRemoteTests(options.chromeos_root, options.remote,
+ options.board, tests)
+
+
+def RunRemoteTests(chromeos_root, remote, board, tests):
+ """Run the remote tests."""
+ ce = command_executer.GetCommandExecuter()
+ command = ("./run_remote_tests.sh"
+ " --remote=%s"
+ " --board=%s"
+ " %s" %
+ (remote,
+ board,
+ tests))
+ retval = ce.ChrootRunCommand(chromeos_root, command)
+ return retval
+
+if __name__ == "__main__":
+ sys.exit(Main(sys.argv))