diff --git a/Makefile b/Makefile index 030fb55ea9e9..63113a17be0c 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,6 @@ ifneq ($(NO_COMPAT),1) COMPAT_CFLAGS=-DCOMPAT_V052=1 endif -PYTEST := $(shell command -v pytest 2> /dev/null) PYTEST_OPTS := -v -x # This is where we add new features as bitcoin adds them. diff --git a/configure b/configure index 6e3ca43898fa..ceb89bbd2037 100755 --- a/configure +++ b/configure @@ -60,6 +60,16 @@ add_var() [ -z "$3" ] || echo "#define $1 $2" >> "$3" } +find_pytest() +{ + PYTEST_BINS="pytest-3 pytest3 pytest py.test" + for PYTEST in $PYTEST_BINS; do + if [ "$(which $PYTEST)" != "" ] ; then + break + fi + done +} + for opt in "$@"; do case "$opt" in --reconfigure) @@ -102,6 +112,8 @@ rm -f $CONFIG_VAR_FILE.$$ $CONFIGURATOR --autotools-style --var-file=$CONFIG_VAR_FILE.$$ --header-file=$CONFIG_HEADER --configurator-cc="$CONFIGURATOR_CC" "$CC" $CWARNFLAGS $CDEBUGFLAGS mv $CONFIG_VAR_FILE.$$ $CONFIG_VAR_FILE +find_pytest + add_var PREFIX "$PREFIX" add_var CC "$CC" add_var CONFIGURATOR_CC "$CONFIGURATOR_CC" @@ -110,3 +122,4 @@ add_var CDEBUGFLAGS "$CDEBUGFLAGS" add_var VALGRIND "$VALGRIND" add_var DEVELOPER "$DEVELOPER" $CONFIG_HEADER add_var COMPAT "$COMPAT" $CONFIG_HEADER +add_var PYTEST "$(which $PYTEST)"