Delete unused image test expectations
Gets rid of unused pixel test expectations. These expectations do not
match any current output, and so tests are just falling back to a less
specific expectation anyway.
Rather than being deleted entirely, some Mac-specific expectations have
been renamed to AGG Mac-specific expectations instead. This will help
ensure Skia configurations do not try to match against them.
Since all the changes are either deletions or renames, it shouldn't be
necessary to review the content of each individual image.
This change requires adding support for "_agg" expectations to the
presubmit. This change also tries to converge the presubmit in this
repository with testing/corpus's similar presubmit.
This change rolls in similar updates to the corpus tests.
Bug: pdfium:1987
Change-Id: Iee0c979fd1efa47067650c8d352780cbd7daac80
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/103711
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index e44281b..236f896 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -424,23 +424,25 @@
return results
-def _CheckPNGFormat(input_api, output_api):
- """Checks that .png files have a format that will be considered valid by our
- test runners. If a file ends with .png, then it must be of the form
- NAME_expected(_skia)?(_(win|mac|linux))?.pdf.#.png
- The expected format used by _CheckPngNames() in testing/corpus/PRESUBMIT.py
- must be the same as this one.
+def _CheckPngNames(input_api, output_api):
+ """Checks that .png files have the right file name format, which must be in
+ the form:
+
+ NAME_expected(_(agg|skia))?(_(linux|mac|win))?.pdf.\d+.png
+
+ This must be the same format as the one in testing/corpus's PRESUBMIT.py.
"""
expected_pattern = input_api.re.compile(
- r'.+_expected(_skia)?(_(win|mac|linux))?\.pdf\.\d+.png')
+ r'.+_expected(_(agg|skia))?(_(linux|mac|win))?\.pdf\.\d+.png')
results = []
for f in input_api.AffectedFiles(include_deletes=False):
if not f.LocalPath().endswith('.png'):
continue
if expected_pattern.match(f.LocalPath()):
continue
- results.append(output_api.PresubmitError(
- 'PNG file %s does not have the correct format' % f.LocalPath()))
+ results.append(
+ output_api.PresubmitError(
+ 'PNG file %s does not have the correct format' % f.LocalPath()))
return results
@@ -526,7 +528,7 @@
results.extend(_CheckIncludeOrder(input_api, output_api))
results.extend(_CheckLibcxxRevision(input_api, output_api))
results.extend(_CheckTestDuplicates(input_api, output_api))
- results.extend(_CheckPNGFormat(input_api, output_api))
+ results.extend(_CheckPngNames(input_api, output_api))
results.extend(_CheckUselessForwardDeclarations(input_api, output_api))
author = input_api.change.author_email