File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,24 @@ static TypeTestOneInput* g_test_one_input{nullptr};
29
29
30
30
void initialize ()
31
31
{
32
+ bool should_abort{false };
32
33
if (std::getenv (" PRINT_ALL_FUZZ_TARGETS_AND_ABORT" )) {
33
34
for (const auto & t : FuzzTargets ()) {
34
35
if (std::get<2 >(t.second )) continue ;
35
36
std::cout << t.first << std::endl;
36
37
}
37
- Assert ( false ) ;
38
+ should_abort = true ;
38
39
}
40
+ if (const char * out_path = std::getenv (" WRITE_ALL_FUZZ_TARGETS_AND_ABORT" )) {
41
+ std::cout << " Writing all fuzz target names to '" << out_path << " '." << std::endl;
42
+ std::ofstream out_stream (out_path, std::ios::binary);
43
+ for (const auto & t : FuzzTargets ()) {
44
+ if (std::get<2 >(t.second )) continue ;
45
+ out_stream << t.first << std::endl;
46
+ }
47
+ should_abort = true ;
48
+ }
49
+ Assert (!should_abort);
39
50
std::string_view fuzz_target{Assert (std::getenv (" FUZZ" ))};
40
51
const auto it = FuzzTargets ().find (fuzz_target);
41
52
Assert (it != FuzzTargets ().end ());
You can’t perform that action at this time.
0 commit comments