OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """This script is used by chrome_tests.gypi's js2webui action to maintain the | 6 """This script is used by chrome_tests.gypi's js2webui action to maintain the |
7 argument lists and to generate inlinable tests. | 7 argument lists and to generate inlinable tests. |
8 | 8 |
9 Usage: | 9 Usage: |
10 python tools/gypv8sh.py v8_shell mock.js test_api.js js2webui.js \ | 10 python tools/gypv8sh.py v8_shell mock.js test_api.js js2webui.js \ |
(...skipping 26 matching lines...) Expand all Loading... |
37 inputfile, inputrelfile, cxxoutfile, jsoutfile) = args | 37 inputfile, inputrelfile, cxxoutfile, jsoutfile) = args |
38 arguments = [js2webui, inputfile, inputrelfile, cxxoutfile, test_type] | 38 arguments = [js2webui, inputfile, inputrelfile, cxxoutfile, test_type] |
39 cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), mock_js, | 39 cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), mock_js, |
40 test_api, js2webui] | 40 test_api, js2webui] |
41 if opts.verbose or opts.impotent: | 41 if opts.verbose or opts.impotent: |
42 print cmd | 42 print cmd |
43 if not opts.impotent: | 43 if not opts.impotent: |
44 try: | 44 try: |
45 subprocess.check_call(cmd, stdout=open(cxxoutfile, 'w')) | 45 subprocess.check_call(cmd, stdout=open(cxxoutfile, 'w')) |
46 shutil.copyfile(inputfile, jsoutfile) | 46 shutil.copyfile(inputfile, jsoutfile) |
47 except Exception, ex: | 47 except subprocess.CalledProcessException, ex: |
| 48 print "returncode", ex.returncode |
48 print ex | 49 print ex |
49 os.remove(cxxoutfile) | 50 os.remove(cxxoutfile) |
50 os.remove(jsoutfile) | 51 os.remove(jsoutfile) |
51 sys.exit(1) | 52 sys.exit(1) |
52 | 53 |
53 if __name__ == '__main__': | 54 if __name__ == '__main__': |
54 sys.exit(main()) | 55 sys.exit(main()) |
OLD | NEW |