mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
test runner: always report fuzz tests
This way they can be smoke tested.
This commit is contained in:
parent
b501adccbe
commit
90dfd86ebe
@ -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 {
|
||||
if (crippled) return "";
|
||||
is_fuzz_test = true;
|
||||
if (options.corpus.len == 0) {
|
||||
return "";
|
||||
} else {
|
||||
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)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user