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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/sample_pass.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gypv8sh.py
diff --git a/tools/gypv8sh.py b/tools/gypv8sh.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed47649971083f2d748bd6ea92662dd05236f02d
--- /dev/null
+++ b/tools/gypv8sh.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""This script is used by chrome_tests.gypi's js2webui action to maintain the
+argument lists and to generate inlinable tests.
+
+Usage:
+ python tools/gypv8sh.py v8_shell js2webui.js inputfile outputfile
+"""
+
+try:
+ import json
+except ImportError:
+ import simplejson as json
+import optparse
+import os
+import subprocess
+import sys
+
+def main ():
+ parser = optparse.OptionParser()
+ parser.set_usage("%prog v8_shell js2webui.js inputfile outputfile")
+ parser.add_option('-v', '--verbose', action='store_true')
+ parser.add_option('-n', '--impotent', action='store_true',
+ help="don't execute; just print (as if verbose)")
+ (opts, args) = parser.parse_args()
+
+ if len(args) != 4:
+ parser.error('all arguments are required.')
+ v8_shell, js2webui, inputfile, outputfile = args
+ arguments = [js2webui, inputfile, os.path.basename(inputfile), outputfile]
+ cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), js2webui]
+ if opts.verbose or opts.impotent:
+ print cmd
+ if not opts.impotent:
+ try:
+ subprocess.check_call(cmd, stdout=open(outputfile,'w'))
+ except Exception, ex:
+ print ex
+ os.remove(outputfile)
+ sys.exit(1)
+
+if __name__ == '__main__':
+ sys.exit(main())
« 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