mirror of
https://github.com/mirror/wget.git
synced 2026-08-19 09:23:27 +08:00
Exclude fuzz corpora from tarball
* fuzz/Makefile.am: Do not include corpora in tarball * fuzz/main.c: SKIP if corpora directory isn't found (make check) The fuzz corpora are thousands of files, not needed for a standard build from a distribution tarball. The reproducers of former issues are being included for regression testing.
This commit is contained in:
@@ -58,7 +58,7 @@ wget_url_fuzzer_LDADD = ../src/libunittest.a $(LDADD)
|
||||
dist-hook:
|
||||
find $(srcdir) -name '*.options' -exec cp -v '{}' $(distdir) ';'
|
||||
find $(srcdir) -name '*.dict' -exec cp -v '{}' $(distdir) ';'
|
||||
find $(srcdir) -name '*.in' -exec cp -vr '{}' $(distdir) ';'
|
||||
# find $(srcdir) -name '*.in' -exec cp -vr '{}' $(distdir) ';'
|
||||
find $(srcdir) -name '*.repro' -exec cp -vr '{}' $(distdir) ';'
|
||||
|
||||
clean-local:
|
||||
|
||||
26
fuzz/main.c
26
fuzz/main.c
@@ -69,6 +69,8 @@ int main(int argc, char **argv)
|
||||
{
|
||||
// if VALGRIND testing is enabled, we have to call ourselves with valgrind checking
|
||||
const char *valgrind = getenv("VALGRIND_TESTS");
|
||||
const char *target;
|
||||
size_t target_len;
|
||||
|
||||
if (!valgrind || !*valgrind || !strcmp(valgrind, "0")) {
|
||||
// fallthrough
|
||||
@@ -85,13 +87,11 @@ int main(int argc, char **argv)
|
||||
return system(cmd) != 0;
|
||||
}
|
||||
|
||||
const char *target = strrchr(argv[0], SLASH);
|
||||
if (target)
|
||||
if ((target = strrchr(argv[0], SLASH)))
|
||||
target = strrchr(target, '/');
|
||||
else
|
||||
target = strrchr(argv[0], '/');
|
||||
target = target ? target + 1 : argv[0];
|
||||
size_t target_len;
|
||||
|
||||
if (strncmp(target, "lt-", 3) == 0)
|
||||
target += 3;
|
||||
@@ -102,18 +102,20 @@ int main(int argc, char **argv)
|
||||
target_len -= 4; // ignore .exe
|
||||
#endif
|
||||
|
||||
char corporadir[sizeof(SRCDIR) + 1 + target_len + 8];
|
||||
snprintf(corporadir, sizeof(corporadir), SRCDIR "/%.*s.in", (int) target_len, target);
|
||||
{
|
||||
int rc;
|
||||
char corporadir[sizeof(SRCDIR) + 1 + target_len + 8];
|
||||
snprintf(corporadir, sizeof(corporadir), SRCDIR "/%.*s.in", (int) target_len, target);
|
||||
|
||||
if (test_all_from(corporadir)) {
|
||||
fprintf(stderr, "Failed to find %s\n", corporadir);
|
||||
exit(EXIT_FAILURE);
|
||||
rc = test_all_from(corporadir);
|
||||
if (rc)
|
||||
fprintf(stderr, "Failed to find %s\n", corporadir);
|
||||
|
||||
snprintf(corporadir, sizeof(corporadir), SRCDIR "/%.*s.repro", (int) target_len, target);
|
||||
if (test_all_from(corporadir) && rc)
|
||||
return 77; // SKIP
|
||||
}
|
||||
|
||||
snprintf(corporadir, sizeof(corporadir), SRCDIR "/%.*s.repro", (int) target_len, target);
|
||||
|
||||
test_all_from(corporadir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user