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

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

Issue 1952823002: Copy the event definition file to the testing directory along with pdf (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Suppress them again Created 4 years, 7 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 | « DEPS ('k') | no next file » | 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 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 19 matching lines...) Expand all
30 input_path = os.path.join(source_dir, input_filename) 30 input_path = os.path.join(source_dir, input_filename)
31 pdf_path = os.path.join(working_dir, input_filename) 31 pdf_path = os.path.join(working_dir, input_filename)
32 # Remove any existing generated images from previous runs. 32 # Remove any existing generated images from previous runs.
33 actual_images = image_differ.GetActualFiles( 33 actual_images = image_differ.GetActualFiles(
34 input_filename, source_dir, working_dir) 34 input_filename, source_dir, working_dir)
35 for image in actual_images: 35 for image in actual_images:
36 if os.path.exists(image): 36 if os.path.exists(image):
37 os.remove(image) 37 os.remove(image)
38 38
39 shutil.copyfile(input_path, pdf_path) 39 shutil.copyfile(input_path, pdf_path)
40 input_event_path = os.path.splitext(input_path)[0] + ".evt"
41 output_event_path = os.path.splitext(pdf_path)[0] + ".evt"
42 if os.path.exists(input_event_path):
43 shutil.copyfile(input_event_path, output_event_path)
44
40 sys.stdout.flush() 45 sys.stdout.flush()
41 # add Dr. Memory wrapper if exist 46 # add Dr. Memory wrapper if exist
42 # remove .pdf suffix 47 # remove .pdf suffix
43 cmd_to_run = common.DrMemoryWrapper(drmem_wrapper, 48 cmd_to_run = common.DrMemoryWrapper(drmem_wrapper,
44 os.path.splitext(input_filename)[0]) 49 os.path.splitext(input_filename)[0])
45 cmd_to_run.extend([pdfium_test_path, '--send-events', '--png', pdf_path]) 50 cmd_to_run.extend([pdfium_test_path, '--send-events', '--png', pdf_path])
46 error = common.RunCommand(cmd_to_run) 51 error = common.RunCommand(cmd_to_run)
47 if error: 52 if error:
48 print "FAILURE: " + input_filename + "; " + str(error) 53 print "FAILURE: " + input_filename + "; " + str(error)
49 return False 54 return False
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 print '\n\nSummary of Failures:' 162 print '\n\nSummary of Failures:'
158 for failure in failures: 163 for failure in failures:
159 print failure 164 print failure
160 return 1 165 return 1
161 166
162 return 0 167 return 0
163 168
164 169
165 if __name__ == '__main__': 170 if __name__ == '__main__':
166 sys.exit(main()) 171 sys.exit(main())
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698