OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2012 The Swarming Authors. All rights reserved. | 2 # Copyright 2012 The Swarming Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 that | 3 # Use of this source code is governed under the Apache License, Version 2.0 that |
4 # can be found in the LICENSE file. | 4 # can be found in the LICENSE file. |
5 | 5 |
6 import cStringIO | 6 import cStringIO |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import logging | 9 import logging |
10 import os | 10 import os |
11 import re | 11 import re |
12 import stat | 12 import stat |
13 import subprocess | 13 import subprocess |
14 import sys | 14 import sys |
15 import tempfile | 15 import tempfile |
16 import unittest | 16 import unittest |
17 | 17 |
18 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 18 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
19 sys.path.insert(0, ROOT_DIR) | 19 sys.path.insert(0, ROOT_DIR) |
20 | 20 |
21 import isolate | 21 import isolate |
22 import isolated_format | 22 import isolated_format |
| 23 from depot_tools import fix_encoding |
23 from utils import file_path | 24 from utils import file_path |
24 | 25 |
25 import test_utils | 26 import test_utils |
26 | 27 |
27 | 28 |
28 ALGO = hashlib.sha1 | 29 ALGO = hashlib.sha1 |
29 HASH_NULL = ALGO().hexdigest() | 30 HASH_NULL = ALGO().hexdigest() |
30 | 31 |
31 | 32 |
32 # These are per test case, not per mode. | 33 # These are per test case, not per mode. |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 subprocess.check_call(cmd + ['-i', a_isolate], cwd=ROOT_DIR) | 1060 subprocess.check_call(cmd + ['-i', a_isolate], cwd=ROOT_DIR) |
1060 | 1061 |
1061 # Move the .isolate file aside and rerun the command with the new source but | 1062 # Move the .isolate file aside and rerun the command with the new source but |
1062 # same destination. | 1063 # same destination. |
1063 b_isolate = os.path.join(self.tempdir, 'b.isolate') | 1064 b_isolate = os.path.join(self.tempdir, 'b.isolate') |
1064 os.rename(a_isolate, b_isolate) | 1065 os.rename(a_isolate, b_isolate) |
1065 subprocess.check_call(cmd + ['-i', b_isolate], cwd=ROOT_DIR) | 1066 subprocess.check_call(cmd + ['-i', b_isolate], cwd=ROOT_DIR) |
1066 | 1067 |
1067 | 1068 |
1068 if __name__ == '__main__': | 1069 if __name__ == '__main__': |
| 1070 fix_encoding.fix_encoding() |
1069 test_utils.main() | 1071 test_utils.main() |
OLD | NEW |