mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +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 {
|
pub fn fuzzInput(options: testing.FuzzInputOptions) []const u8 {
|
||||||
@disableInstrumentation();
|
@disableInstrumentation();
|
||||||
if (crippled) {
|
if (crippled) return "";
|
||||||
return "";
|
is_fuzz_test = true;
|
||||||
} else if (builtin.fuzz) {
|
if (builtin.fuzz) return fuzzer_next().toSlice();
|
||||||
return fuzzer_next().toSlice();
|
if (options.corpus.len == 0) return "";
|
||||||
} else {
|
var prng = std.Random.DefaultPrng.init(testing.random_seed);
|
||||||
is_fuzz_test = true;
|
const random = prng.random();
|
||||||
if (options.corpus.len == 0) {
|
return options.corpus[random.uintLessThan(usize, options.corpus.len)];
|
||||||
return "";
|
|
||||||
} else {
|
|
||||||
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