Skip to content

Commit

Permalink
Refactor fuzz_glsl/spirv_test files in gfauto (#1161)
Browse files Browse the repository at this point in the history
Refactors the files that take care of GLSL and SPIR-V fuzzing in
gfauto to (a) make them Amber-specific (paving the way for new
ShaderTrap-related files in the future), and (b) prevent them from
depending on one another by extracting common functionality to a
utilty file.

Also fixes a minor style issue where a variable was named "match",
which was leading to a warning in PyCharm.

Related issue: #1160.
  • Loading branch information
afd authored Sep 14, 2021
1 parent 53c4486 commit 2421252
Show file tree
Hide file tree
Showing 9 changed files with 708 additions and 652 deletions.
11 changes: 6 additions & 5 deletions gfauto/gfauto/fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
binaries_util,
devices_util,
download_cts_gf_tests,
fuzz_glsl_test,
fuzz_spirv_test,
fuzz_glsl_amber_test,
fuzz_spirv_amber_test,
fuzz_test_util,
gflogging,
interrupt_util,
run_cts_gf_tests,
Expand Down Expand Up @@ -446,7 +447,7 @@ def main_helper( # pylint: disable=too-many-locals, too-many-branches, too-many
fuzzing_tool_index = (fuzzing_tool_index + 1) % len(fuzzing_tool_pattern)

if fuzzing_tool == FuzzingTool.SPIRV_FUZZ:
fuzz_spirv_test.fuzz_spirv(
fuzz_spirv_amber_test.fuzz_spirv(
staging_dir,
reports_dir,
fuzz_failures_dir,
Expand All @@ -457,7 +458,7 @@ def main_helper( # pylint: disable=too-many-locals, too-many-branches, too-many
binary_manager,
)
elif fuzzing_tool == FuzzingTool.GLSL_FUZZ:
fuzz_glsl_test.fuzz_glsl(
fuzz_glsl_amber_test.fuzz_glsl(
staging_dir,
reports_dir,
fuzz_failures_dir,
Expand Down Expand Up @@ -488,7 +489,7 @@ def create_summary_and_reproduce(

# noinspection PyTypeChecker
if test_metadata.HasField("glsl") or test_metadata.HasField("spirv_fuzz"):
fuzz_glsl_test.create_summary_and_reproduce(test_dir, binary_manager, settings)
fuzz_test_util.create_summary_and_reproduce(test_dir, binary_manager, settings)
else:
raise AssertionError("Unrecognized test type")

Expand Down
Loading

0 comments on commit 2421252

Please sign in to comment.