diff --git a/util/test/rdtest/logging.py b/util/test/rdtest/logging.py index 022bafd0a..4c5c6c7ca 100644 --- a/util/test/rdtest/logging.py +++ b/util/test/rdtest/logging.py @@ -82,6 +82,14 @@ class TestLogger: self.rawprint("<< Test {}".format(test_name)) self.test_name = '' + def begin_section(self, name: str): + self.rawprint(">> Section {}".format(name)) + self.indent() + + def end_section(self, name: str): + self.dedent() + self.rawprint("<< Section {}".format(name)) + def success(self, message): self.rawprint("** " + message) diff --git a/util/test/rdtest/testresults.js b/util/test/rdtest/testresults.js index 7be44d85b..6e5917cf9 100644 --- a/util/test/rdtest/testresults.js +++ b/util/test/rdtest/testresults.js @@ -169,6 +169,8 @@ document.body.onload = function() { last_test = test_name; else last_test = ''; + } else if(words[0] == 'Section') { + html += start ? '
'; } } else if(m[1] == '$$') { if(m[2] == 'FAILED') { diff --git a/util/test/tests/Iter_Test.py b/util/test/tests/Iter_Test.py index 85a7db584..0b6be9f41 100644 --- a/util/test/tests/Iter_Test.py +++ b/util/test/tests/Iter_Test.py @@ -214,19 +214,22 @@ class Iter_Test(rdtest.TestCase): else: rdtest.log.print("At event {} the target is index {}".format(lastmod.eventId, output_index)) - output = \ - [x for x in sourceVars if x.builtin == rd.ShaderBuiltin.ColorOutput and x.offset == output_index][0] + output_list = \ + [x for x in sourceVars if x.builtin == rd.ShaderBuiltin.ColorOutput and x.offset == output_index] - debugged = self.evalute_source_var(output, variables) + if len(output_list) > 0: + debugged = self.evalute_source_var(output_list[0], variables) - self.controller.FreeTrace(trace) + self.controller.FreeTrace(trace) - debuggedValue = [debugged.value.f.x, debugged.value.f.y, debugged.value.f.z, debugged.value.f.w] + debuggedValue = [debugged.value.f.x, debugged.value.f.y, debugged.value.f.z, debugged.value.f.w] - if not rdtest.value_compare(lastmod.shaderOut.col.floatValue, debuggedValue, eps=3.0E-06): - raise rdtest.TestFailureException("Debugged value {}: {} doesn't match history shader output {}".format(debugged.name, debuggedValue, lastmod.shaderOut.col.floatValue)) + if not rdtest.value_compare(lastmod.shaderOut.col.floatValue, debuggedValue, eps=3.0E-06): + rdtest.log.error("Debugged value {} at EID {} {},{}: {} doesn't match history shader output {}".format(debugged.name, lastmod.eventId, x, y, debuggedValue, lastmod.shaderOut.col.floatValue)) - rdtest.log.success('Successfully debugged pixel in {} cycles, result matches'.format(cycles)) + rdtest.log.success('Successfully debugged pixel in {} cycles, result matches'.format(cycles)) + else: + rdtest.log.error("At EID {} No output variable declared for index {}".format(lastmod.eventId, output_index)) self.controller.SetFrameEvent(draw.eventId, True) @@ -278,27 +281,32 @@ class Iter_Test(rdtest.TestCase): def run(self): dir_path = self.get_ref_path('', extra=True) - for file in os.scandir(dir_path): + for file in sorted(os.scandir(dir_path), key=lambda e: e.name.lower()): if '.rdc' not in file.name: continue # Ensure we are deterministic at least from run to run by seeding with the path random.seed(file.name) - rdtest.log.print('Iterating {}'.format(file.name)) + self.filename = file.name + + rdtest.log.print("Opening '{}'.".format(file.name)) try: self.controller = rdtest.open_capture(file.path) except RuntimeError as err: + rdtest.log.end_section(section_name) rdtest.log.print("Skipping. Can't open {}: {}".format(file.path, err)) continue + + section_name = 'Iterating {}'.format(file.name) + rdtest.log.begin_section(section_name) self.iter_test() + rdtest.log.end_section(section_name) self.controller.Shutdown() - rdtest.log.success("Iterated {}".format(file.name)) - rdtest.log.success("Iterated all files") # Useful for calling from within the UI @@ -310,4 +318,4 @@ class Iter_Test(rdtest.TestCase): def run_locally(r): test = Iter_Test() - test.run_external(r) \ No newline at end of file + test.run_external(r)