diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-10-26 11:22:52 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-26 15:36:06 +0000 |
commit | 352e251c6af1f2a3c2eca24468f98eae30099185 (patch) | |
tree | a529bc3eccb5f678311c4f007e3377aa6a9af785 /testing/tools/pngdiffer.py | |
parent | 53d443f042b590ae2d920def16bc9daf66f8427d (diff) | |
download | pdfium-352e251c6af1f2a3c2eca24468f98eae30099185.tar.xz |
Add option to regenerate only platform-specific expected pngs.
Change-Id: Id4798fe9a4d297678a76d0511cde7fecbf130e3e
Reviewed-on: https://pdfium-review.googlesource.com/16613
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'testing/tools/pngdiffer.py')
-rwxr-xr-x | testing/tools/pngdiffer.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/testing/tools/pngdiffer.py b/testing/tools/pngdiffer.py index 95acb198a6..a9bc9d6529 100755 --- a/testing/tools/pngdiffer.py +++ b/testing/tools/pngdiffer.py @@ -66,7 +66,7 @@ class PNGDiffer(): i += 1 return False - def Regenerate(self, input_filename, source_dir, working_dir): + def Regenerate(self, input_filename, source_dir, working_dir, platform_only): path_templates = PathTemplates(input_filename, source_dir, working_dir) page = 0 @@ -81,13 +81,16 @@ class PNGDiffer(): self.os_name, page) # If there is a platform expected png, we will overwrite it. Otherwise, - # overwrite the generic png. + # overwrite the generic png in "all" mode, or do nothing in "platform" + # mode. if os.path.exists(platform_expected_path): expected_path = platform_expected_path - else: + elif not platform_only: expected_path = path_templates.GetExpectedPath(page) + else: + expected_path = None - if os.path.exists(expected_path): + if expected_path is not None and os.path.exists(expected_path): shutil.copyfile(actual_path, expected_path) page += 1 |