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

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: Raise exception if executing command fails. 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
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
10 PROD_DIR_ID = '$(PROD_DIR)'
11
12
13 def LaunchCommand(command):
14
15 cmd_line = [command]
16 try:
17 results = subprocess.check_output(
18 cmd_line, stderr=subprocess.STDOUT, shell=True)
19 except subprocess.CalledProcessError, e:
20 raise Exception('Exception %s running command %s' % (e, command))
21 else:
22 print results
23 finally:
24 pass
25
26
27 def main():
28
29 parser = argparse.ArgumentParser()
30 parser.add_argument('-f', '--file',
31 help='path to file containing list of command to launch.')
weitao 2014/10/17 16:56:49 s/command/commands
32 parser.add_argument('-p', '--prod_dir',
33 help='build output folder, i.e., <(PRODUCT_DIR).')
weitao 2014/10/17 16:56:49 It doesn't have to be the build output folder. Sug
34
35 args = parser.parse_args()
36
37 with open(args.file) as f:
38 for line in f:
39 # Replace the PROD_DIR value in the command-line with
40 # the passed in value.
41 line = line.replace(PROD_DIR_ID, args.prod_dir)
42 LaunchCommand(line)
43
44 if __name__ == '__main__':
45 main()
OLDNEW
« no previous file with comments | « testing/chromoting/browser_test_commands_linux.txt ('k') | testing/chromoting/chromoting_integration_tests.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698