From 59693240a9feb0cc7fd667e44cf26d709ca748b6 Mon Sep 17 00:00:00 2001 From: SarahM0 Date: Thu, 27 Jun 2019 14:13:02 -0400 Subject: [PATCH 1/4] add a dawn backend flag to the script --- tests/run_tests.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index bb3f75539..327849fa1 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -55,9 +55,10 @@ } class TestCase: - def __init__(self, input_path, parse_only): + def __init__(self, input_path, parse_only, use_dawn): self.input_path = input_path self.parse_only = parse_only + self.use_dawn = use_dawn self.results = {} @@ -74,6 +75,9 @@ def IsSuppressed(self): def IsParseOnly(self): return self.parse_only + def IsUseDawn(self): + return self.use_dawn + def GetInputPath(self): return self.input_path @@ -88,6 +92,8 @@ def RunTest(self, tc): cmd = [self.options.test_prog_path, '-q'] if tc.IsParseOnly(): cmd += ['-p'] + if tc.IsUseDawn(): + cmd += ['-e'] + ['dawn'] cmd += [tc.GetInputPath()] try: @@ -117,6 +123,8 @@ def RunTests(self): elif tc.IsExpectedFail() and result: print("Expected: " + tc.GetInputPath() + " to fail but passed.") self.failures.append(tc.GetInputPath()) + else: + self.successes.append(tc.GetInputPath()) def SummarizeResults(self): if len(self.failures) > 0: @@ -126,6 +134,10 @@ def SummarizeResults(self): for failure in self.failures: print failure + print '\nSummary of Successes:' + for success in self.successes: + print success + if len(self.suppressed) > 0: self.suppressed.sort() @@ -157,6 +169,9 @@ def Run(self): parser.add_option('--parse-only', action="store_true", default=False, help='only parse test cases; do not execute') + parser.add_option('--use-dawn', + action="store_true", default=False, + help='Use dawn as the backend. Default is Vulkan.') self.options, self.args = parser.parse_args() @@ -182,7 +197,7 @@ def Run(self): print "Cannot find test file '%s'" % filename return 1 - self.test_cases.append(TestCase(input_path, self.options.parse_only)) + self.test_cases.append(TestCase(input_path, self.options.parse_only, self.options.use_dawn)) else: for file_dir, _, filename_list in os.walk(self.options.test_dir): @@ -191,8 +206,9 @@ def Run(self): input_path = os.path.join(file_dir, input_filename) if os.path.isfile(input_path): self.test_cases.append( - TestCase(input_path, self.options.parse_only)) + TestCase(input_path, self.options.parse_only, self.options.use_dawn)) + self.successes = [] self.failures = [] self.suppressed = [] From 9e09dd494dba1787e40cc600d7ef8ab261491869 Mon Sep 17 00:00:00 2001 From: SarahM0 Date: Thu, 27 Jun 2019 18:10:50 -0400 Subject: [PATCH 2/4] add dawn suppression list --- tests/run_tests.py | 86 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 327849fa1..6e359f6e2 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -52,7 +52,84 @@ # DXC not currently building on bot "draw_triangle_list_hlsl.amber" ] -} + } + +SUPPRESSIONS_DAWN = [ + "compute_accumulated_ubo_definition.amber", + "compute_accumulated_ubo_definition.vkscript", + "compute_mat2x2.amber", + "compute_mat2x2.vkscript", + "compute_mat2x2float.vkscript", + "compute_mat2x3.vkscript", + "compute_mat2x3float.vkscript", + "compute_mat3x2.vkscript", + "compute_mat3x2float.vkscript", + "compute_mat3x3.vkscript", + "compute_mat3x3float.vkscript", + "compute_mat3x4.vkscript", + "compute_mat3x4float.vkscript", + "compute_mat4x3.vkscript", + "compute_mat4x3float.vkscript", + "compute_nothing.vkscript", + "compute_nothing_with_ssbo.vkscript", + "compute_probe_mat3.vkscript", + "compute_push_const_mat2x2.vkscript", + "compute_push_const_mat2x2float.vkscript", + "compute_push_const_mat2x3.vkscript", + "compute_push_const_mat2x3float.vkscript", + "compute_push_const_mat3x2.vkscript", + "compute_push_const_mat3x2float.vkscript", + "compute_push_const_mat3x3.vkscript", + "compute_push_const_mat3x3float.vkscript", + "compute_push_const_mat3x4.vkscript", + "compute_push_const_mat3x4float.vkscript", + "compute_push_const_mat4x3.vkscript", + "compute_push_const_mat4x3float.vkscript", + "compute_push_constant_and_ssbo.amber", + "compute_push_constant_and_ssbo.vkscript", + "compute_ssbo.vkscript", + "compute_ssbo_with_entrypoint_command.vkscript", + "compute_ssbo_with_tolerance.amber", + "compute_ssbo_with_tolerance.vkscript", + "compute_ssbo_without_probe.vkscript", + "compute_ubo_and_ssbo.vkscript", + "draw_array_after_draw_rect.vkscript", + "draw_rect_after_draw_array.vkscript", + "draw_rect_and_draw_array_mixed.vkscript", + "draw_rect_and_ortho.vkscript", + "draw_rect_multiple_color_attachment.amber", + "draw_rectangles.vkscript", + "draw_rectangles_once.vkscript", + "draw_rectangles_without_probe.vkscript", + "draw_triangle_list.amber", + "draw_triangle_list.vkscript", + "draw_triangle_list_in_r16g16b16a16_snorm_color_frame.vkscript", + "draw_triangle_list_in_r16g16b16a16_uint_color_frame.vkscript", + "draw_triangle_list_in_r32g32b32a32_sfloat_color_frame.vkscript", + "draw_triangle_list_in_r8g8b8a8_snorm_color_frame.vkscript", + "draw_triangle_list_in_r8g8b8a8_srgb_color_frame.vkscript", + "draw_triangle_list_using_geom_shader.vkscript", + "draw_triangle_list_using_tessellation.vkscript", + "draw_triangle_list_with_depth.vkscript", + "draw_triangle_list_with_index_buffer.vkscript", + "draw_triangle_list_with_index_buffer_and_vertex_offset.vkscript", + "draw_triangle_list_with_probe_point.vkscript", + "entry_point.amber", + "graphics_push_constants.amber", + "graphics_push_constants.vkscript", + "multiple_ssbo_update_with_graphics_pipeline.vkscript", + "multiple_ssbo_with_sparse_descriptor_set_in_compute_pipeline.vkscript", + "multiple_ubo_update_with_graphics_pipeline.vkscript", + "position_to_ssbo.amber", + "probe_no_compute_with_multiple_ssbo_commands.vkscript", + "probe_no_compute_with_ssbo.vkscript", + "repeat.amber", + "scratch_ssbo.vkscript", + "shader_specialization.amber", + "ssbo_subdata_size.vkscript", + "ssbo_with_graphics_pipeline.vkscript" +] + class TestCase: def __init__(self, input_path, parse_only, use_dawn): @@ -69,7 +146,10 @@ def IsExpectedFail(self): def IsSuppressed(self): system = platform.system() if system in SUPPRESSIONS.keys(): - return os.path.basename(self.input_path) in SUPPRESSIONS[system] + is_system_suppressed = os.path.basename(self.input_path) in SUPPRESSIONS[system] + is_dawn_suppressed = os.path.basename(self.input_path) in SUPPRESSIONS_DAWN + return is_system_suppressed | (self.use_dawn & is_dawn_suppressed) + return False def IsParseOnly(self): @@ -171,7 +251,7 @@ def Run(self): help='only parse test cases; do not execute') parser.add_option('--use-dawn', action="store_true", default=False, - help='Use dawn as the backend. Default is Vulkan.') + help='Use dawn as the backend; Default is Vulkan') self.options, self.args = parser.parse_args() From 32f4c409e7ceee898fcb8cbd0a1227c6c950ceb0 Mon Sep 17 00:00:00 2001 From: SarahM0 Date: Thu, 27 Jun 2019 18:19:40 -0400 Subject: [PATCH 3/4] review comment --- tests/run_tests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 6e359f6e2..175d5590a 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -130,7 +130,6 @@ "ssbo_with_graphics_pipeline.vkscript" ] - class TestCase: def __init__(self, input_path, parse_only, use_dawn): self.input_path = input_path @@ -173,7 +172,7 @@ def RunTest(self, tc): if tc.IsParseOnly(): cmd += ['-p'] if tc.IsUseDawn(): - cmd += ['-e'] + ['dawn'] + cmd += ['-e', 'dawn'] cmd += [tc.GetInputPath()] try: From 58d85560408e74069b9b6cda8e9eb4d12110f333 Mon Sep 17 00:00:00 2001 From: SarahM0 Date: Fri, 28 Jun 2019 10:31:03 -0400 Subject: [PATCH 4/4] remove success summary --- tests/run_tests.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 175d5590a..77535ca65 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -55,6 +55,7 @@ } SUPPRESSIONS_DAWN = [ + # not implemented in Dawn backend "compute_accumulated_ubo_definition.amber", "compute_accumulated_ubo_definition.vkscript", "compute_mat2x2.amber", @@ -202,8 +203,6 @@ def RunTests(self): elif tc.IsExpectedFail() and result: print("Expected: " + tc.GetInputPath() + " to fail but passed.") self.failures.append(tc.GetInputPath()) - else: - self.successes.append(tc.GetInputPath()) def SummarizeResults(self): if len(self.failures) > 0: @@ -213,10 +212,6 @@ def SummarizeResults(self): for failure in self.failures: print failure - print '\nSummary of Successes:' - for success in self.successes: - print success - if len(self.suppressed) > 0: self.suppressed.sort() @@ -287,7 +282,6 @@ def Run(self): self.test_cases.append( TestCase(input_path, self.options.parse_only, self.options.use_dawn)) - self.successes = [] self.failures = [] self.suppressed = []