OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2013 Google Inc. All rights reserved. | 3 # Copyright (c) 2013 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies things related to bundle resources. | 8 Verifies things related to bundle resources. |
9 """ | 9 """ |
10 | 10 |
| 11 from __future__ import print_function |
| 12 |
11 import TestGyp | 13 import TestGyp |
12 | 14 |
13 import os | 15 import os |
14 import stat | 16 import stat |
15 import sys | 17 import sys |
16 | 18 |
17 if sys.platform in ('darwin'): | 19 if sys.platform in ('darwin'): |
18 print "This test is currently disabled: https://crbug.com/483696." | 20 print("This test is currently disabled: https://crbug.com/483696.") |
19 sys.exit(0) | 21 sys.exit(0) |
20 | 22 |
21 | 23 |
22 def check_attribs(path, expected_exec_bit): | 24 def check_attribs(path, expected_exec_bit): |
23 out_path = test.built_file_path( | 25 out_path = test.built_file_path( |
24 os.path.join('resource.app/Contents/Resources', path), chdir=CHDIR) | 26 os.path.join('resource.app/Contents/Resources', path), chdir=CHDIR) |
25 | 27 |
26 in_stat = os.stat(os.path.join(CHDIR, path)) | 28 in_stat = os.stat(os.path.join(CHDIR, path)) |
27 out_stat = os.stat(out_path) | 29 out_stat = os.stat(out_path) |
28 if in_stat.st_mtime == out_stat.st_mtime: | 30 if in_stat.st_mtime == out_stat.st_mtime: |
(...skipping 24 matching lines...) Expand all Loading... |
53 | 55 |
54 check_attribs('executable-file.sh', expected_exec_bit=stat.S_IXUSR) | 56 check_attribs('executable-file.sh', expected_exec_bit=stat.S_IXUSR) |
55 check_attribs('secret.txt', expected_exec_bit=0) | 57 check_attribs('secret.txt', expected_exec_bit=0) |
56 | 58 |
57 # TODO(thakis): This currently fails with make. | 59 # TODO(thakis): This currently fails with make. |
58 if test.format != 'make': | 60 if test.format != 'make': |
59 test.built_file_must_match( | 61 test.built_file_must_match( |
60 'resource_rule.app/Contents/Resources/secret.txt', 'ABC\n', chdir=CHDIR) | 62 'resource_rule.app/Contents/Resources/secret.txt', 'ABC\n', chdir=CHDIR) |
61 | 63 |
62 test.pass_test() | 64 test.pass_test() |
OLD | NEW |