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 optparse | 6 import optparse |
7 import os | 7 import os |
8 import re | 8 import re |
9 import shutil | 9 import shutil |
10 import subprocess | 10 import subprocess |
(...skipping 24 matching lines...) Expand all Loading... |
35 return False | 35 return False |
36 return True | 36 return True |
37 | 37 |
38 def main(): | 38 def main(): |
39 parser = optparse.OptionParser() | 39 parser = optparse.OptionParser() |
40 parser.add_option('--build-dir', default=os.path.join('out', 'Debug'), | 40 parser.add_option('--build-dir', default=os.path.join('out', 'Debug'), |
41 help='relative path from the base source directory') | 41 help='relative path from the base source directory') |
42 options, args = parser.parse_args() | 42 options, args = parser.parse_args() |
43 finder = common.DirectoryFinder(options.build_dir) | 43 finder = common.DirectoryFinder(options.build_dir) |
44 pdfium_test_path = finder.ExecutablePath('pdfium_test') | 44 pdfium_test_path = finder.ExecutablePath('pdfium_test') |
| 45 if not os.path.exists(pdfium_test_path): |
| 46 print "FAILURE: Can't find test executable '%s'" % pdfium_test_path |
| 47 print "Use --build-dir to specify its location." |
| 48 return 1 |
45 working_dir = finder.WorkingDir(os.path.join('testing', 'corpus')) | 49 working_dir = finder.WorkingDir(os.path.join('testing', 'corpus')) |
46 if not os.path.exists(working_dir): | 50 if not os.path.exists(working_dir): |
47 os.makedirs(working_dir) | 51 os.makedirs(working_dir) |
48 | 52 |
49 test_suppressor = suppressor.Suppressor(finder) | 53 test_suppressor = suppressor.Suppressor(finder) |
50 image_differ = pngdiffer.PNGDiffer(finder) | 54 image_differ = pngdiffer.PNGDiffer(finder) |
51 | 55 |
52 # test files are under .../pdfium/testing/corpus. | 56 # test files are under .../pdfium/testing/corpus. |
53 failures = [] | 57 failures = [] |
54 walk_from_dir = finder.TestingDir('corpus'); | 58 walk_from_dir = finder.TestingDir('corpus'); |
(...skipping 13 matching lines...) Expand all Loading... |
68 print '\n\nSummary of Failures:' | 72 print '\n\nSummary of Failures:' |
69 for failure in failures: | 73 for failure in failures: |
70 print failure | 74 print failure |
71 return 1 | 75 return 1 |
72 | 76 |
73 return 0 | 77 return 0 |
74 | 78 |
75 | 79 |
76 if __name__ == '__main__': | 80 if __name__ == '__main__': |
77 sys.exit(main()) | 81 sys.exit(main()) |
OLD | NEW |