Commit 90dfd86ebe

Andrew Kelley <andrew@ziglang.org>
2024-07-25 02:40:58
test runner: always report fuzz tests
This way they can be smoke tested.
1 parent b501adc
Changed files (1)
lib
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)];
 }