diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-22 01:46:03 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-22 01:46:03 +0000 |
commit | 4ba1dbcc38a8843703a3494eef053644c00d813c (patch) | |
tree | b411df17bd40c08df07653931356459dfa1d40f3 /tools/gypv8sh.py | |
parent | 3eb8314456f9c3aa5c791db67cb71718e4dd9c66 (diff) | |
download | chromium_src-4ba1dbcc38a8843703a3494eef053644c00d813c.zip chromium_src-4ba1dbcc38a8843703a3494eef053644c00d813c.tar.gz chromium_src-4ba1dbcc38a8843703a3494eef053644c00d813c.tar.bz2 |
Allow generator javascript test files to go anywhere in the source tree
- Allow javascript files anywhere in the source tree - specifically in the same directory as the implementation files.
- Copy the files to '<(PRODUCT_DIR)/test_data/...' so that cros can copy these where they need to go for cross-platform testing using 'ebuild'
R=jhawkins@chromium.org
BUG=90907,89337
TEST=browser_tests --gtest_filter=OptionsWebUITest.*
Review URL: http://codereview.chromium.org/8333013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gypv8sh.py')
-rw-r--r-- | tools/gypv8sh.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/gypv8sh.py b/tools/gypv8sh.py index edb1402..ca9c759 100644 --- a/tools/gypv8sh.py +++ b/tools/gypv8sh.py @@ -8,7 +8,7 @@ argument lists and to generate inlinable tests. Usage: python tools/gypv8sh.py v8_shell mock.js test_api.js js2webui.js \ - inputfile outputfile + inputfile inputrelfile cxxoutfile jsoutfile """ try: @@ -19,30 +19,35 @@ import optparse import os import subprocess import sys +import shutil def main (): parser = optparse.OptionParser() parser.set_usage( - "%prog v8_shell mock.js test_api.js js2webui.js inputfile outputfile") + "%prog v8_shell mock.js test_api.js js2webui.js inputfile inputrelfile " + "cxxoutfile jsoutfile") 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) != 6: + if len(args) != 8: parser.error('all arguments are required.') - v8_shell, mock_js, test_api, js2webui, inputfile, outputfile = args - arguments = [js2webui, inputfile, os.path.basename(inputfile), outputfile] + (v8_shell, mock_js, test_api, js2webui, inputfile, inputrelfile, + cxxoutfile, jsoutfile) = args + arguments = [js2webui, inputfile, inputrelfile, cxxoutfile] cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), mock_js, test_api, js2webui] if opts.verbose or opts.impotent: print cmd if not opts.impotent: try: - subprocess.check_call(cmd, stdout=open(outputfile,'w')) + subprocess.check_call(cmd, stdout=open(cxxoutfile, 'w')) + shutil.copyfile(inputfile, jsoutfile) except Exception, ex: print ex - os.remove(outputfile) + os.remove(cxxoutfile) + os.remove(jsoutfile) sys.exit(1) if __name__ == '__main__': |