Update the presubmit check of PNG file names for corpus tests.
To be able to add Skia/SkiaPaths specifc expected results for corpus
tests, this CL updates the presubmit check of PNG file namess to accept
the following formats:
[filename]_expected_skia_[os_name].pdf.[page_number].png
[filename]_expected_skiapaths_[os_name].pdf.[page_number].png
Bug: pdfium:1727
Change-Id: Ic131a45aa31dd298303a2553b5c7bb22b2f70dc7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium_tests/+/85572
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 9e6999c..8308f14 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -21,8 +21,14 @@
return results
def _CheckPngNames(input_api, output_api):
- """Checks that .png files have the right file name pattern"""
- png_regex = input_api.re.compile('.+_expected(_(win|mac|linux))?\.pdf\.\d+.png')
+ """Checks that .png files have the right file name format, which must be in
+ the form of
+ NAME_expected(_(skia|skiapaths))?(_(win|mac|linux))?.pdf.#.png. This format
+ must be the same as the one used in PDFium's PRESUBMIT.py's
+ _CheckPNGFormat().
+ """
+ png_regex = input_api.re.compile(
+ r'.+_expected(_(skia|skiapaths))?(_(win|mac|linux))?\.pdf\.\d+.png')
warnings = []
for f in input_api.AffectedFiles(include_deletes=False):
local_path = f.LocalPath()