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

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sat Nov 17 21:30:25 EST 2018


yuja added a comment.


  > +  $ 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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5270

To: durin42, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list