Mercurial > hg
view tests/test-fuzz-targets.t @ 43470:32ac4d0b4102
hghave: add a check for pytype, Google's Python type checker
I'm not unbiased, but I strongly prefer pytype to mypy: it does more
inference, so we don't need as many annontations. In theory we can use
both, but since I'm doing some tinkering with pytype I figured I'd
just try setting it up.
Differential Revision: https://phab.mercurial-scm.org/D7268
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 06 Nov 2019 14:09:36 -0500 |
parents | 39cab871e880 |
children | 19da643dc10c |
line wrap: on
line source
#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 $ havefuzz() { > cat > $TESTTMP/dummy.cc <<EOF > #include <stdlib.h> > #include <stdint.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 > $CXX $TESTTMP/dummy.cc -o $TESTTMP/dummy \ > -fsanitize=fuzzer-no-link,address || return 1 > } #if clang-libfuzzer $ CXX=clang++ havefuzz || exit 80 $ $MAKE -s clean all #endif #if no-clang-libfuzzer clang-6.0 $ CXX=clang++-6.0 havefuzz || exit 80 $ $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 Clean up. $ $MAKE -s clean