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

Side by Side Diff: tools/gypv8sh.py

Issue 7087014: Support automatic javascript test registry in gtest when creating WebUI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move the include of the generated dir to the condition for ! 'arm'. Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/webui/sample_pass.js ('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 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """This script is used by chrome_tests.gypi's js2webui action to maintain the
7 argument lists and to generate inlinable tests.
8
9 Usage:
10 python tools/gypv8sh.py v8_shell js2webui.js inputfile outputfile
11 """
12
13 try:
14 import json
15 except ImportError:
16 import simplejson as json
17 import optparse
18 import os
19 import subprocess
20 import sys
21
22 def main ():
23 parser = optparse.OptionParser()
24 parser.set_usage("%prog v8_shell js2webui.js inputfile outputfile")
25 parser.add_option('-v', '--verbose', action='store_true')
26 parser.add_option('-n', '--impotent', action='store_true',
27 help="don't execute; just print (as if verbose)")
28 (opts, args) = parser.parse_args()
29
30 if len(args) != 4:
31 parser.error('all arguments are required.')
32 v8_shell, js2webui, inputfile, outputfile = args
33 arguments = [js2webui, inputfile, os.path.basename(inputfile), outputfile]
34 cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), js2webui]
35 if opts.verbose or opts.impotent:
36 print cmd
37 if not opts.impotent:
38 try:
39 subprocess.check_call(cmd, stdout=open(outputfile,'w'))
40 except Exception, ex:
41 print ex
42 os.remove(outputfile)
43 sys.exit(1)
44
45 if __name__ == '__main__':
46 sys.exit(main())
OLDNEW
« no previous file with comments | « chrome/test/data/webui/sample_pass.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698