Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 2421252

Browse files
authored
Refactor fuzz_glsl/spirv_test files in gfauto (#1161)
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.
1 parent 53c4486 commit 2421252

9 files changed

Lines changed: 708 additions & 652 deletions

gfauto/gfauto/fuzz.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
binaries_util,
3535
devices_util,
3636
download_cts_gf_tests,
37-
fuzz_glsl_test,
38-
fuzz_spirv_test,
37+
fuzz_glsl_amber_test,
38+
fuzz_spirv_amber_test,
39+
fuzz_test_util,
3940
gflogging,
4041
interrupt_util,
4142
run_cts_gf_tests,
@@ -446,7 +447,7 @@ def main_helper( # pylint: disable=too-many-locals, too-many-branches, too-many
446447
fuzzing_tool_index = (fuzzing_tool_index + 1) % len(fuzzing_tool_pattern)
447448

448449
if fuzzing_tool == FuzzingTool.SPIRV_FUZZ:
449-
fuzz_spirv_test.fuzz_spirv(
450+
fuzz_spirv_amber_test.fuzz_spirv(
450451
staging_dir,
451452
reports_dir,
452453
fuzz_failures_dir,
@@ -457,7 +458,7 @@ def main_helper( # pylint: disable=too-many-locals, too-many-branches, too-many
457458
binary_manager,
458459
)
459460
elif fuzzing_tool == FuzzingTool.GLSL_FUZZ:
460-
fuzz_glsl_test.fuzz_glsl(
461+
fuzz_glsl_amber_test.fuzz_glsl(
461462
staging_dir,
462463
reports_dir,
463464
fuzz_failures_dir,
@@ -488,7 +489,7 @@ def create_summary_and_reproduce(
488489

489490
# noinspection PyTypeChecker
490491
if test_metadata.HasField("glsl") or test_metadata.HasField("spirv_fuzz"):
491-
fuzz_glsl_test.create_summary_and_reproduce(test_dir, binary_manager, settings)
492+
fuzz_test_util.create_summary_and_reproduce(test_dir, binary_manager, settings)
492493
else:
493494
raise AssertionError("Unrecognized test type")
494495

0 commit comments

Comments
 (0)