diff options
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 |