Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: testing/tools/run_pixel_tests.py

Issue 1036073002: Replace linux-specific code in test scripts. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use sys.executable Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/tools/run_javascript_tests.py ('k') | testing/tools/text_diff.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 subprocess 9 import subprocess
10 import sys 10 import sys
(...skipping 14 matching lines...) Expand all
25 fixup_path, pdfium_test_path, pdfium_diff_path): 25 fixup_path, pdfium_test_path, pdfium_diff_path):
26 input_root, _ = os.path.splitext(input_filename) 26 input_root, _ = os.path.splitext(input_filename)
27 input_path = os.path.join(source_dir, input_root + '.in') 27 input_path = os.path.join(source_dir, input_root + '.in')
28 pdf_path = os.path.join(working_dir, input_root + '.pdf') 28 pdf_path = os.path.join(working_dir, input_root + '.pdf')
29 actual_path_template = os.path.join(working_dir, input_root + '.pdf.%d.png') 29 actual_path_template = os.path.join(working_dir, input_root + '.pdf.%d.png')
30 expected_path_template = os.path.join(source_dir, 30 expected_path_template = os.path.join(source_dir,
31 input_root + '_expected.pdf.%d.png') 31 input_root + '_expected.pdf.%d.png')
32 try: 32 try:
33 sys.stdout.flush() 33 sys.stdout.flush()
34 subprocess.check_call( 34 subprocess.check_call(
35 [fixup_path, '--output-dir=' + working_dir, input_path]) 35 [sys.executable, fixup_path, '--output-dir=' + working_dir, input_path])
36 subprocess.check_call([pdfium_test_path, '--png', pdf_path]) 36 subprocess.check_call([pdfium_test_path, '--png', pdf_path])
37 i = 0; 37 i = 0;
38 while True: 38 while True:
39 expected_path = expected_path_template % i; 39 expected_path = expected_path_template % i;
40 actual_path = actual_path_template % i; 40 actual_path = actual_path_template % i;
41 if not os.path.exists(expected_path): 41 if not os.path.exists(expected_path):
42 if i == 0: 42 if i == 0:
43 print "WARNING: no expected results files found for " + input_filename 43 print "WARNING: no expected results files found for " + input_filename
44 break 44 break
45 print "Checking " + actual_path 45 print "Checking " + actual_path
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 if failures: 137 if failures:
138 print '\n\nSummary of Failures:' 138 print '\n\nSummary of Failures:'
139 for failure in failures: 139 for failure in failures:
140 print failure 140 print failure
141 return 1 141 return 1
142 return 0 142 return 0
143 143
144 if __name__ == '__main__': 144 if __name__ == '__main__':
145 sys.exit(main()) 145 sys.exit(main())
OLDNEW
« no previous file with comments | « testing/tools/run_javascript_tests.py ('k') | testing/tools/text_diff.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698