OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The PDFium Authors. All rights reserved. | 2 # Copyright 2015 The PDFium 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 cStringIO | 6 import cStringIO |
7 import functools | 7 import functools |
8 import multiprocessing | 8 import multiprocessing |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 finder = common.DirectoryFinder(options.build_dir) | 95 finder = common.DirectoryFinder(options.build_dir) |
96 pdfium_test_path = finder.ExecutablePath('pdfium_test') | 96 pdfium_test_path = finder.ExecutablePath('pdfium_test') |
97 if not os.path.exists(pdfium_test_path): | 97 if not os.path.exists(pdfium_test_path): |
98 print "FAILURE: Can't find test executable '%s'" % pdfium_test_path | 98 print "FAILURE: Can't find test executable '%s'" % pdfium_test_path |
99 print "Use --build-dir to specify its location." | 99 print "Use --build-dir to specify its location." |
100 return 1 | 100 return 1 |
101 working_dir = finder.WorkingDir(os.path.join('testing', 'corpus')) | 101 working_dir = finder.WorkingDir(os.path.join('testing', 'corpus')) |
102 if not os.path.exists(working_dir): | 102 if not os.path.exists(working_dir): |
103 os.makedirs(working_dir) | 103 os.makedirs(working_dir) |
104 | 104 |
105 test_suppressor = suppressor.Suppressor(finder) | 105 feature_string = subprocess.check_output([pdfium_test_path, '--show-config']) |
| 106 test_suppressor = suppressor.Suppressor(finder, feature_string) |
106 image_differ = pngdiffer.PNGDiffer(finder) | 107 image_differ = pngdiffer.PNGDiffer(finder) |
107 | 108 |
108 # test files are under .../pdfium/testing/corpus. | 109 # test files are under .../pdfium/testing/corpus. |
109 failures = [] | 110 failures = [] |
110 surprises = [] | 111 surprises = [] |
111 walk_from_dir = finder.TestingDir('corpus'); | 112 walk_from_dir = finder.TestingDir('corpus'); |
112 input_file_re = re.compile('^[a-zA-Z0-9_.]+[.]pdf$') | 113 input_file_re = re.compile('^[a-zA-Z0-9_.]+[.]pdf$') |
113 test_cases = [] | 114 test_cases = [] |
114 | 115 |
115 if len(args): | 116 if len(args): |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 print '\n\nSummary of Failures:' | 167 print '\n\nSummary of Failures:' |
167 for failure in failures: | 168 for failure in failures: |
168 print failure | 169 print failure |
169 return 1 | 170 return 1 |
170 | 171 |
171 return 0 | 172 return 0 |
172 | 173 |
173 | 174 |
174 if __name__ == '__main__': | 175 if __name__ == '__main__': |
175 sys.exit(main()) | 176 sys.exit(main()) |
OLD | NEW |