D5270: tests: sniff for libfuzzer actually being available in test-fuzz-targets.t

Yuya Nishihara yuya at tcha.org
Sat Nov 17 21:24:30 EST 2018


> +  $ havefuzz() {
> +  >     cat > dummy.cc <<EOF

Missing includes of stdint.h and stddef.h (or stdlib.h).

> +  > int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; }
> +  > int main(int argc, char **argv) {
> +  >     const char data[] = "asdf";
> +  >     return LLVMFuzzerTestOneInput((const uint8_t *)data, 4);
> +  > }
> +  > EOF
> +  >     cat dummy.cc
> +  >     $CXX dummy.cc -fsanitize=fuzzer-no-link,address || return 1
> +  > }
> +
>  #if clang-libfuzzer
> +  $ CXX=clang++ havefuzz || exit 80

This leaves dummy.cc in the fuzz directory. Perhaps, we should compile it
before cd.


More information about the Mercurial-devel mailing list