test: use eatmydata for bitcoind and lightningd if available.

Before:	real	17m56.862s
After:	real	13m42.868s

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-11-08 21:53:55 +10:30
parent 208beab529
commit 2f0651d105
2 changed files with 7 additions and 3 deletions

View File

@ -1,10 +1,13 @@
# Sourced by other scripts
# Suppress sync if we can, for speedup.
if which eatmydata >/dev/null; then EATMYDATA=eatmydata; fi
STYLE=bitcoin
DATADIR=/tmp/bitcoin-lightning
CLI="bitcoin-cli -datadir=$DATADIR"
REGTESTDIR=regtest
DAEMON="bitcoind -datadir=$DATADIR"
DAEMON="$EATMYDATA bitcoind -datadir=$DATADIR"
findport()
{

View File

@ -40,12 +40,13 @@ ONE_HTLCS_FEE=$(( (338 + 32) * $FEE_RATE / 2000 * 2000))
EXTRA_FEE=$(($ONE_HTLCS_FEE - $NO_HTLCS_FEE))
# Always use valgrind if available.
[ -n "$NO_VALGRIND" ] || PREFIX="valgrind -q --error-exitcode=7"
PREFIX=$EATMYDATA
[ -n "$NO_VALGRIND" ] || PREFIX="$EATMYDATA valgrind -q --error-exitcode=7"
while [ $# != 0 ]; do
case x"$1" in
x"--valgrind-vgdb")
[ -n "$NO_VALGRIND" ] || PREFIX="valgrind --vgdb-error=1"
[ -n "$NO_VALGRIND" ] || PREFIX="$EATMYDATA valgrind --vgdb-error=1"
REDIR1="/dev/tty"
REDIRERR1="/dev/tty"
REDIR2="/dev/tty"