tests/test-fuzz-targets.t
author Augie Fackler <augie@google.com>
Wed, 14 Nov 2018 10:11:37 -0500
branchstable
changeset 40726 6c01fad8de32
parent 38246 46dcb9f14900
child 40727 d9fc51f77cc5
permissions -rw-r--r--
tests: sniff for /usr/local/bin/gmake and use it in test-fuzz-targets.t This isn't as robust as it probably should be, but for now it'll get the job done on the buildbots. Differential Revision: https://phab.mercurial-scm.org/D5269

#require test-repo

  $ cd $TESTDIR/../contrib/fuzz

which(1) could exit nonzero, but that's fine because we'll still end
up without a valid executable, so we don't need to check $? here.

  $ if which gmake >/dev/null 2>&1; then
  >     MAKE=gmake
  > else
  >     MAKE=make
  > fi

#if clang-libfuzzer
  $ $MAKE -s clean all
#endif
#if no-clang-libfuzzer clang-6.0
  $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0
#endif
#if no-clang-libfuzzer no-clang-6.0
  $ exit 80
#endif

Just run the fuzzers for five seconds each to verify it works at all.
  $ ./bdiff -max_total_time 5
  $ ./mpatch -max_total_time 5
  $ ./xdiff -max_total_time 5