Show More
@@ -1,43 +1,46 | |||
|
1 | 1 | #require test-repo |
|
2 | 2 | |
|
3 | 3 | $ cd $TESTDIR/../contrib/fuzz |
|
4 | 4 | |
|
5 | 5 | which(1) could exit nonzero, but that's fine because we'll still end |
|
6 | 6 | up without a valid executable, so we don't need to check $? here. |
|
7 | 7 | |
|
8 | 8 | $ if which gmake >/dev/null 2>&1; then |
|
9 | 9 | > MAKE=gmake |
|
10 | 10 | > else |
|
11 | 11 | > MAKE=make |
|
12 | 12 | > fi |
|
13 | 13 | |
|
14 | 14 | $ havefuzz() { |
|
15 | 15 | > cat > $TESTTMP/dummy.cc <<EOF |
|
16 | 16 | > #include <stdlib.h> |
|
17 | 17 | > #include <stdint.h> |
|
18 | 18 | > int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; } |
|
19 | 19 | > int main(int argc, char **argv) { |
|
20 | 20 | > const char data[] = "asdf"; |
|
21 | 21 | > return LLVMFuzzerTestOneInput((const uint8_t *)data, 4); |
|
22 | 22 | > } |
|
23 | 23 | > EOF |
|
24 | 24 | > $CXX $TESTTMP/dummy.cc -o $TESTTMP/dummy \ |
|
25 | 25 | > -fsanitize=fuzzer-no-link,address || return 1 |
|
26 | 26 | > } |
|
27 | 27 | |
|
28 | 28 | #if clang-libfuzzer |
|
29 | 29 | $ CXX=clang++ havefuzz || exit 80 |
|
30 | 30 | $ $MAKE -s clean all |
|
31 | 31 | #endif |
|
32 | 32 | #if no-clang-libfuzzer clang-6.0 |
|
33 | 33 | $ CXX=clang++-6.0 havefuzz || exit 80 |
|
34 | 34 | $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0 |
|
35 | 35 | #endif |
|
36 | 36 | #if no-clang-libfuzzer no-clang-6.0 |
|
37 | 37 | $ exit 80 |
|
38 | 38 | #endif |
|
39 | 39 | |
|
40 | 40 | Just run the fuzzers for five seconds each to verify it works at all. |
|
41 | 41 | $ ./bdiff -max_total_time 5 |
|
42 | 42 | $ ./mpatch -max_total_time 5 |
|
43 | 43 | $ ./xdiff -max_total_time 5 |
|
44 | ||
|
45 | Clean up. | |
|
46 | $ $MAKE -s clean |
General Comments 0
You need to be logged in to leave comments.
Login now