From 49d07653f95e458ea3aa058119d086dee3ef34f4 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 25 Jan 2024 18:55:28 +0100 Subject: [PATCH] RenderTests: Fix Incorrect Command in Report When running the render test for EEVEE-Next the command printed on the report to update the reference images was incorrect. In stead of displaying `BLENDER_TEST_UPDATE=1 ctest -R eevee_next` it displayed `BLENDER_TEST_UPDATE=1 ctest -R eevee next`. The cause of this is that the title of the report is used to create the command. EEVEE-Next has a space in its title which generates an incorrect command. A quick fix would be to replace spaces with underscores. But it would be better to fix this more clearly by adding an attribute containing the engine name. This PR adds a `set_engine_name` method to the Report class. By default the engine name is set based on the title. Pull Request: https://projects.blender.org/blender/blender/pulls/117503 --- tests/python/eevee_next_render_tests.py | 1 + tests/python/modules/render_report.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/python/eevee_next_render_tests.py b/tests/python/eevee_next_render_tests.py index 4b47f834e2d..983a9b3d16f 100644 --- a/tests/python/eevee_next_render_tests.py +++ b/tests/python/eevee_next_render_tests.py @@ -136,6 +136,7 @@ def main(): from modules import render_report report = render_report.Report("Eevee Next", output_dir, oiiotool) report.set_pixelated(True) + report.set_engine_name('eevee_next') report.set_reference_dir("eevee_next_renders") report.set_reference_override_dir(reference_override_dir) report.set_compare_engine('cycles', 'CPU') diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index 0762627cda8..da21993076a 100755 --- a/tests/python/modules/render_report.py +++ b/tests/python/modules/render_report.py @@ -76,6 +76,7 @@ def test_get_images(output_dir, filepath, reference_dir, reference_override_dir) class Report: __slots__ = ( 'title', + 'engine_name', 'output_dir', 'global_dir', 'reference_dir', @@ -104,6 +105,7 @@ class Report: self.compare_engine = None self.fail_threshold = 0.016 self.fail_percent = 1 + self.engine_name = self.title.lower().replace(" ", "_") self.device = device self.blacklist = blacklist @@ -142,6 +144,9 @@ class Report: def set_compare_engine(self, other_engine, other_device=None): self.compare_engine = (other_engine, other_device) + def set_engine_name(self, engine_name): + self.engine_name = engine_name + def run(self, dirpath, blender, arguments_cb, batch=False): # Run tests and output report. dirname = os.path.basename(dirpath) @@ -232,7 +237,7 @@ class Report: if failed: message = """