From 8373ad65f7a25d54f4a5df1d16dce4ce50518cba Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 21 Nov 2019 10:25:35 +0100 Subject: [PATCH] Make source_set() detect empty setup search path; add test --- travis-test.sh | 1 + travis/utils.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/travis-test.sh b/travis-test.sh index 054a283..cdbe4d1 100755 --- a/travis-test.sh +++ b/travis-test.sh @@ -50,6 +50,7 @@ fn_exists add_dependency || die "function add_dependency missing from SCRIPTDIR/ # test source_set() ###################################################################### +SETUP_DIRS= source_set test01 | grep -q "(SETUP_PATH) is empty" || die "empty search path not detected" source_set xxdoesnotexistxx | grep -q "does not exist" || die "missing setup file not detected" source_set test01 | grep -q "Loading setup file" || die "test01 setup file not found" diff --git a/travis/utils.sh b/travis/utils.sh index 0d6d6f5..ce58710 100644 --- a/travis/utils.sh +++ b/travis/utils.sh @@ -29,6 +29,11 @@ source_set() { local set_file=$1 local set_dir local found=0 + if [ -z "${SETUP_DIRS}" ] + then + echo "Search path for setup files (SETUP_PATH) is empty" + [ "$UTILS_UNITTEST" ] || exit 1 + fi for set_dir in ${SETUP_DIRS} do if [ -e $set_dir/$set_file.set ]