Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: testing/chromoting/browser_tests_launcher.py

Issue 657433002: Python wrapper to launch Chromoting browser-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/chromoting/browser_test_commands_linux.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5
6 """Utility script to launch browser-tests on the Chromoting bot."""
7 import argparse
8 import subprocess
9 import sys
10
11 PROD_DIR_ID = '$(PROD_DIR)'
12
13
14 def LaunchCommand(command, cwd):
15
16 cmd_line = [command]
17 try:
18 results = subprocess.check_output(
19 cmd_line, cwd=cwd, stderr=subprocess.STDOUT, shell=True)
20 except subprocess.CalledProcessError, e:
21 print 'Failed to run command %s; %s' % (command, e)
22 else:
23 print results
24 finally:
25 pass
26
27
28 def main():
29
30 parser = argparse.ArgumentParser()
31 parser.add_argument('-f', '--file',
32 help='path to file containing list of command to launch.')
33 parser.add_argument('-c', '--cwd',
Lei Lei 2014/10/14 01:58:37 Not sure how can you get cwd.
anandc 2014/10/14 16:53:00 Hmmm. Good point. I was using cwd just to make sur
34 help='folder from where to launch the commands.')
35 parser.add_argument('-p', '--prod_dir',
36 help='build output folder, i.e., <(PRODUCT_DIR).')
37
38 if len(sys.argv) != 7:
39 parser.print_help()
40 sys.exit(1)
41
42 # Use input json file if specified on command line.
43 args = parser.parse_args()
44 if args.file:
45 with open(args.file) as f:
46 for line in f:
47 # Replace the PROD_DIR value in the command-line with
48 # the passed in value.
49 line = line.replace(PROD_DIR_ID, args.prod_dir)
50 LaunchCommand(line, args.cwd)
51
52 if __name__ == '__main__':
53 main()
OLDNEW
« no previous file with comments | « testing/chromoting/browser_test_commands_linux.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698