OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2017 The Chromium Authors. All rights reserved. | 2 # Copyright 2017 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 import contextlib | 6 import contextlib |
7 import copy | 7 import copy |
8 import difflib | 8 import difflib |
9 import glob | 9 import glob |
10 import itertools | 10 import itertools |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 env = None | 79 env = None |
80 if debug_measures: | 80 if debug_measures: |
81 env = os.environ.copy() | 81 env = os.environ.copy() |
82 env['SUPERSIZE_DISABLE_ASYNC'] = '1' | 82 env['SUPERSIZE_DISABLE_ASYNC'] = '1' |
83 env['SUPERSIZE_MEASURE_GZIP'] = '1' | 83 env['SUPERSIZE_MEASURE_GZIP'] = '1' |
84 | 84 |
85 return subprocess.check_output(argv, env=env).splitlines() | 85 return subprocess.check_output(argv, env=env).splitlines() |
86 | 86 |
87 | 87 |
88 class IntegrationTest(unittest.TestCase): | 88 class IntegrationTest(unittest.TestCase): |
89 maxDiff = None # Don't trucate diffs in errors. | |
estevenson
2017/05/11 21:02:17
unused?
agrieve
2017/05/12 01:19:16
Used by the test framework.
| |
89 cached_size_info = [None, None, None] | 90 cached_size_info = [None, None, None] |
90 | 91 |
91 def _CloneSizeInfo(self, use_output_directory=True, use_elf=True): | 92 def _CloneSizeInfo(self, use_output_directory=True, use_elf=True): |
92 assert not use_elf or use_output_directory | 93 assert not use_elf or use_output_directory |
93 i = int(use_output_directory) + int(use_elf) | 94 i = int(use_output_directory) + int(use_elf) |
94 if not IntegrationTest.cached_size_info[i]: | 95 if not IntegrationTest.cached_size_info[i]: |
95 elf_path = _TEST_ELF_PATH if use_elf else None | 96 elf_path = _TEST_ELF_PATH if use_elf else None |
96 output_directory = _TEST_OUTPUT_DIR if use_output_directory else None | 97 output_directory = _TEST_OUTPUT_DIR if use_output_directory else None |
97 IntegrationTest.cached_size_info[i] = archive.CreateSizeInfo( | 98 IntegrationTest.cached_size_info[i] = archive.CreateSizeInfo( |
98 _TEST_MAP_PATH, elf_path, _TEST_TOOL_PREFIX, output_directory) | 99 _TEST_MAP_PATH, elf_path, _TEST_TOOL_PREFIX, output_directory) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 global update_goldens | 300 global update_goldens |
300 update_goldens = True | 301 update_goldens = True |
301 for f in glob.glob(os.path.join(_TEST_DATA_DIR, '*.golden')): | 302 for f in glob.glob(os.path.join(_TEST_DATA_DIR, '*.golden')): |
302 os.unlink(f) | 303 os.unlink(f) |
303 | 304 |
304 unittest.main(argv=argv, verbosity=2) | 305 unittest.main(argv=argv, verbosity=2) |
305 | 306 |
306 | 307 |
307 if __name__ == '__main__': | 308 if __name__ == '__main__': |
308 main() | 309 main() |
OLD | NEW |