commit 90dfd86ebee1639e5455ace4e34157ff9b68ac0f (tree) parent b501adccbe7603bbd35b5babb545bbedc5de2f09 Author: Andrew Kelley <andrew@ziglang.org> Date: Wed, 24 Jul 2024 17:40:58 -0700 test runner: always report fuzz tests This way they can be smoke tested. Diffstat:
| M | lib/compiler/test_runner.zig | | | 21 | +++++++-------------- |
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/lib/compiler/test_runner.zig b/lib/compiler/test_runner.zig @@ -325,18 +325,11 @@ extern fn fuzzer_next() FuzzerSlice; pub fn fuzzInput(options: testing.FuzzInputOptions) []const u8 { @disableInstrumentation(); - if (crippled) { - return ""; - } else if (builtin.fuzz) { - return fuzzer_next().toSlice(); - } else { - is_fuzz_test = true; - if (options.corpus.len == 0) { - return ""; - } else { - var prng = std.Random.DefaultPrng.init(testing.random_seed); - const random = prng.random(); - return options.corpus[random.uintLessThan(usize, options.corpus.len)]; - } - } + if (crippled) return ""; + is_fuzz_test = true; + if (builtin.fuzz) return fuzzer_next().toSlice(); + if (options.corpus.len == 0) return ""; + var prng = std.Random.DefaultPrng.init(testing.random_seed); + const random = prng.random(); + return options.corpus[random.uintLessThan(usize, options.corpus.len)]; }