test: check for notmuch binary in test-lib.sh

Move notmuch executable check into common code. Redundant for
notmuch-test runs, but works also for individual tests.
This commit is contained in:
Jani Nikula 2017-09-25 23:38:21 +03:00 committed by David Bremner
parent fd36ae9f51
commit e1bd4f2363
2 changed files with 7 additions and 10 deletions

View file

@ -4,16 +4,6 @@
# #
test_description='the test framework itself.' test_description='the test framework itself.'
################################################################
# It appears that people try to run tests without building...
if ! test -x ../notmuch
then
echo >&2 'You do not seem to have built notmuch yet.'
exit 1
fi
. $(dirname "$0")/test-lib.sh || exit 1 . $(dirname "$0")/test-lib.sh || exit 1
################################################################ ################################################################

View file

@ -26,6 +26,13 @@ fi
# Make sure echo builtin does not expand backslash-escape sequences by default. # Make sure echo builtin does not expand backslash-escape sequences by default.
shopt -u xpg_echo shopt -u xpg_echo
# It appears that people try to run tests without building...
if ! test -x ../notmuch
then
echo >&2 'You do not seem to have built notmuch yet.'
exit 1
fi
this_test=${0##*/} this_test=${0##*/}
this_test=${this_test%.sh} this_test=${this_test%.sh}
this_test_bare=${this_test#T[0-9][0-9][0-9]-} this_test_bare=${this_test#T[0-9][0-9][0-9]-}