##// END OF EJS Templates
bisect: avoid adding irrelevant revisions to bisect state...
bisect: avoid adding irrelevant revisions to bisect state When adding new revisions to the bisect state, it only makes sense to add information about revisions that are under consideration (i.e., those that are topologically between the known good and bad revisions). However, if the user passes in a revset (e.g., '!merge()' to exclude merge commits), hg will resolve the revset first and add all matching revisions to the bisect state (which in this case would likely be the majority of revisions in the repo). To avoid this, revisions should only be added to the bisect state if they are between the good and bad revisions (and therefore relevant to the bisection). -- Here are the results of some performance tests using the `mozilla-central` repo (since it is one of the largest freely-available hg repositories in the wild). These tests compare the performance of a locally-built `hg` before and after application of this series. Note that `--noupdate` is passed to avoid including update time (which should not vary across cases). Setup (run between each test): $ hg bisect --reset $ hg bisect --noupdate --bad 56c3ad4bde5c70714b784ccf15d099e0df0f5bde $ hg bisect --noupdate --good 57426696adaf08298af3027fa77486fee0633b13 Test using a revset that returns a very large number of revisions: $ time hg bisect --noupdate --skip '!merge()' > /dev/null Before: real 0m9.398s user 0m9.233s sys 0m0.120s After: real 0m1.513s user 0m1.425s sys 0m0.052s Test using a revset that is expensive to compute: $ time hg bisect --noupdate --skip 'desc("Bug")' > /dev/null Before: real 0m49.853s user 0m49.580s sys 0m0.243s After: real 0m4.120s user 0m4.036s sys 0m0.048s

File last commit:

r47858:1d075b85 stable
r50337:81623652 default
Show More
test-fuzz-targets.t
74 lines | 2.1 KiB | text/troff | Tads3Lexer
/ tests / test-fuzz-targets.t
Augie Fackler
fuzz: try and ensure fuzzer tests run against the right python-config...
r46883 #require test-repo py3
Yuya Nishihara
test-fuzz-targets: look for clang-6.0 binary as well...
r38238
Augie Fackler
contrib: add some basic scaffolding for some fuzz test targets...
r35688 $ cd $TESTDIR/../contrib/fuzz
Augie Fackler
tests: finally fix up test-fuzz-targets.t...
r44267 $ OUT=$TESTTMP ; export OUT
Yuya Nishihara
test-fuzz-targets: look for clang-6.0 binary as well...
r38238
Augie Fackler
tests: sniff for /usr/local/bin/gmake and use it in test-fuzz-targets.t...
r40799 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
Augie Fackler
tests: sniff for libfuzzer actually being available in test-fuzz-targets.t...
r40800 $ 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
> }
Augie Fackler
fuzz: try and ensure fuzzer tests run against the right python-config...
r46883 Try to find a python3-config that's next to our sys.executable. If
that doesn't work, fall back to looking for a global python3-config
and hope that works out for the best.
Matt Harbison
tests: ensure `$PYTHON` is quoted for Windows...
r47858 $ PYBIN=`"$PYTHON" -c 'import sys, os; print(os.path.dirname(sys.executable))'`
Augie Fackler
fuzz: try and ensure fuzzer tests run against the right python-config...
r46883 $ if [ -x "$PYBIN/python3-config" ] ; then
> PYTHON_CONFIG="$PYBIN/python3-config"
> else
> PYTHON_CONFIG="`which python3-config`"
> fi
Yuya Nishihara
test-fuzz-targets: look for clang-6.0 binary as well...
r38238 #if clang-libfuzzer
Augie Fackler
tests: sniff for libfuzzer actually being available in test-fuzz-targets.t...
r40800 $ CXX=clang++ havefuzz || exit 80
Augie Fackler
fuzz: try and ensure fuzzer tests run against the right python-config...
r46883 $ $MAKE -s clean all PYTHON_CONFIG="$PYTHON_CONFIG"
Yuya Nishihara
test-fuzz-targets: look for clang-6.0 binary as well...
r38238 #endif
#if no-clang-libfuzzer clang-6.0
Augie Fackler
tests: sniff for libfuzzer actually being available in test-fuzz-targets.t...
r40800 $ CXX=clang++-6.0 havefuzz || exit 80
Augie Fackler
fuzz: try and ensure fuzzer tests run against the right python-config...
r46883 $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0 PYTHON_CONFIG="$PYTHON_CONFIG"
Yuya Nishihara
test-fuzz-targets: look for clang-6.0 binary as well...
r38238 #endif
#if no-clang-libfuzzer no-clang-6.0
$ exit 80
#endif
Augie Fackler
tests: finally fix up test-fuzz-targets.t...
r44267 $ cd $TESTTMP
Run each fuzzer using dummy.cc as a fake input, to make sure it runs
at all. In the future we should instead unpack the corpus for each
fuzzer and use that instead.
$ for fuzzer in `ls *_fuzzer | sort` ; do
> echo run $fuzzer...
> ./$fuzzer dummy.cc > /dev/null 2>&1
> done
run bdiff_fuzzer...
run dirs_fuzzer...
run dirstate_fuzzer...
run fm1readmarkers_fuzzer...
run fncache_fuzzer...
run jsonescapeu8fast_fuzzer...
run manifest_fuzzer...
run mpatch_fuzzer...
run revlog_fuzzer...
run xdiff_fuzzer...
Augie Fackler
tests: clean up built binaries after running test-fuzz-targets.t...
r43218
Clean up.
Augie Fackler
tests: finally fix up test-fuzz-targets.t...
r44267 $ cd $TESTDIR/../contrib/fuzz
Augie Fackler
tests: clean up built binaries after running test-fuzz-targets.t...
r43218 $ $MAKE -s clean