Make source_set() detect empty setup search path; add test
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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 ]
|
||||
|
||||
Reference in New Issue
Block a user