Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 94 additions & 5 deletions tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,90 @@
# DXC not currently building on bot
"draw_triangle_list_hlsl.amber"
]
}
}

SUPPRESSIONS_DAWN = [
# not implemented in Dawn backend
"compute_accumulated_ubo_definition.amber",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment as to why things are suppressed? Grouping them is fine and a single #not implemented is also fine. Just, if there are long lived suppressions knowing why is handy.

"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):
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 = {}

Expand All @@ -68,12 +146,18 @@ 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):
return self.parse_only

def IsUseDawn(self):
return self.use_dawn

def GetInputPath(self):
return self.input_path

Expand All @@ -88,6 +172,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:
Expand Down Expand Up @@ -157,6 +243,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()

Expand All @@ -182,7 +271,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):
Expand All @@ -191,7 +280,7 @@ 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.failures = []
self.suppressed = []
Expand Down