| 155 | } |
| 156 | |
| 157 | int main(int argc, char *argv[]) |
| 158 | { |
| 159 | DIR *d; |
| 160 | struct dirent *di; |
| 161 | int verbose_flag; |
| 162 | |
| 163 | common_setup(argv[0]); |
| 164 | assert(chdir("tests/fuzz/corpora") == 0); |
| 165 | assert(chdir(path_basename(tmpctx, argv[0])) == 0); |
| 166 | |
| 167 | init(&argc, &argv); |
| 168 | verbose_flag = find_opt(argv, "-v"); |
| 169 | d = opendir("."); |
| 170 | while ((di = readdir(d)) != NULL) { |
| 171 | u8 *contents; |
| 172 | if (streq(di->d_name, ".") || streq(di->d_name, "..")) |
| 173 | continue; |
| 174 | /* If you specify options other than -v, they're test names */ |
| 175 | if (argv[verbose_flag + 1] && !find_opt(argv, di->d_name)) |
| 176 | continue; |
| 177 | if (verbose_flag) |
| 178 | printf("%s\n", di->d_name); |
| 179 | contents = grab_file_raw(tmpctx, di->d_name); |
| 180 | if (!contents) |
| 181 | err(1, "Could not read %s", di->d_name); |
| 182 | run(contents, tal_bytelen(contents)); |
| 183 | } |
| 184 | closedir(d); |
| 185 | common_shutdown(); |
| 186 | } |
| 187 | |
| 188 | /* We never call any functions which might call these */ |
| 189 | size_t LLVMFuzzerMutate(uint8_t *data, size_t size, size_t max_size); |
nothing calls this directly
no test coverage detected