Skip to content

Commit

Permalink
configure: Use the ./configure step to find pytest
Browse files Browse the repository at this point in the history
Fixes ElementsProject#1544

Signed-off-by: Christian Decker <[email protected]>
  • Loading branch information
cdecker committed Jun 9, 2018
1 parent 135bd96 commit 3cf1581
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 13 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand All @@ -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)"

0 comments on commit 3cf1581

Please sign in to comment.