OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 27 matching lines...) Expand all Loading... | |
38 axs_testing_js, test_api, js2webui] | 38 axs_testing_js, test_api, js2webui] |
39 if opts.verbose or opts.impotent: | 39 if opts.verbose or opts.impotent: |
40 print cmd | 40 print cmd |
41 if not opts.impotent: | 41 if not opts.impotent: |
42 try: | 42 try: |
43 with open(cxxoutfile, 'w') as f: | 43 with open(cxxoutfile, 'w') as f: |
44 subprocess.check_call(cmd, stdin=subprocess.PIPE, stdout=f) | 44 subprocess.check_call(cmd, stdin=subprocess.PIPE, stdout=f) |
45 shutil.copyfile(inputfile, jsoutfile) | 45 shutil.copyfile(inputfile, jsoutfile) |
46 except Exception, ex: | 46 except Exception, ex: |
47 if os.path.exists(cxxoutfile): | 47 if os.path.exists(cxxoutfile): |
48 # The contents of the output file will include the error message. | |
49 print open(cxxoutfile).read() | |
Peter Lundblad
2014/05/22 15:24:25
Awesome!
| |
48 os.remove(cxxoutfile) | 50 os.remove(cxxoutfile) |
49 if os.path.exists(jsoutfile): | 51 if os.path.exists(jsoutfile): |
50 os.remove(jsoutfile) | 52 os.remove(jsoutfile) |
51 raise | 53 raise |
52 | 54 |
53 | 55 |
54 if __name__ == '__main__': | 56 if __name__ == '__main__': |
55 sys.exit(main()) | 57 sys.exit(main()) |
OLD | NEW |