core-lightning/daemon/test/scripts/vars.sh
Rusty Russell 973ef3c932 test.sh: move valgrind PREFIX setting to vars.sh
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-10 23:31:35 +10:30

25 lines
696 B
Bash

# Sourced by other scripts
# Suppress sync if we can, for speedup.
if which eatmydata >/dev/null; then EATMYDATA=eatmydata; fi
DATADIR=/tmp/bitcoin-lightning$VARIANT
CLI="bitcoin-cli -datadir=$DATADIR"
REGTESTDIR=regtest
DAEMON="$EATMYDATA bitcoind -datadir=$DATADIR"
PREFIX=$EATMYDATA
# Always use valgrind if available (unless NO_VALGRIND=1 set)
if which valgrind >/dev/null; then :; else NO_VALGRIND=1; fi
[ -n "$NO_VALGRIND" ] || PREFIX="$EATMYDATA valgrind -q --error-exitcode=7"
findport()
{
PORT=$1
# Give two ports per variant.
if [ x"$2" != x ]; then PORT=$(($PORT + $2 * 2)); fi
while netstat -ntl | grep -q ":$PORT "; do PORT=$(($PORT + 1)); done
echo $PORT
}