summaryrefslogtreecommitdiff
path: root/testing/tools/test_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tools/test_runner.py')
-rw-r--r--testing/tools/test_runner.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/testing/tools/test_runner.py b/testing/tools/test_runner.py
index 90202f8e55..5acda86f54 100644
--- a/testing/tools/test_runner.py
+++ b/testing/tools/test_runner.py
@@ -80,21 +80,27 @@ class TestRunner:
if actual_images:
if self.image_differ.HasDifferences(input_filename, source_dir,
self.working_dir):
- if (self.options.regenerate_expected
- and not self.test_suppressor.IsResultSuppressed(input_filename)
- and not self.test_suppressor.IsImageDiffSuppressed(input_filename)):
- platform_only = (self.options.regenerate_expected == 'platform')
- self.image_differ.Regenerate(input_filename, source_dir,
- self.working_dir, platform_only)
+ self.RegenerateIfNeeded_(input_filename, source_dir)
return False, results
else:
if (self.enforce_expected_images
and not self.test_suppressor.IsImageDiffSuppressed(input_filename)):
+ self.RegenerateIfNeeded_(input_filename, source_dir)
print 'FAILURE: %s; Missing expected images' % input_filename
return False, results
return True, results
+ def RegenerateIfNeeded_(self, input_filename, source_dir):
+ if (not self.options.regenerate_expected
+ or self.test_suppressor.IsResultSuppressed(input_filename)
+ or self.test_suppressor.IsImageDiffSuppressed(input_filename)):
+ return
+
+ platform_only = (self.options.regenerate_expected == 'platform')
+ self.image_differ.Regenerate(input_filename, source_dir,
+ self.working_dir, platform_only)
+
def Generate(self, source_dir, input_filename, input_root, pdf_path):
original_path = os.path.join(source_dir, input_filename)
input_path = os.path.join(source_dir, input_root + '.in')