diff --git a/tests-ng/actions-args-template.sh b/tests-ng/actions-args-template.sh index 877ef43..23cfebf 100755 --- a/tests-ng/actions-args-template.sh +++ b/tests-ng/actions-args-template.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/actions-args.sh b/tests-ng/actions-args.sh index 157a576..c244744 100755 --- a/tests-ng/actions-args.sh +++ b/tests-ng/actions-args.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/actions-default.sh b/tests-ng/actions-default.sh index 3228de3..0c00493 100755 --- a/tests-ng/actions-default.sh +++ b/tests-ng/actions-default.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/actions-empty-dir.sh b/tests-ng/actions-empty-dir.sh index 6821a1f..2d5152f 100755 --- a/tests-ng/actions-empty-dir.sh +++ b/tests-ng/actions-empty-dir.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error -set -ev - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +## start-cookie +set -e +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/actions-pre.sh b/tests-ng/actions-pre.sh index c89ee7a..fc7e51a 100755 --- a/tests-ng/actions-pre.sh +++ b/tests-ng/actions-pre.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/actions-template.sh b/tests-ng/actions-template.sh index 09369f3..987158e 100755 --- a/tests-ng/actions-template.sh +++ b/tests-ng/actions-template.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/actions.sh b/tests-ng/actions.sh index f3c40f3..513592a 100755 --- a/tests-ng/actions.sh +++ b/tests-ng/actions.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/bad-diff-cmd.sh b/tests-ng/bad-diff-cmd.sh index 134b9e9..523586c 100755 --- a/tests-ng/bad-diff-cmd.sh +++ b/tests-ng/bad-diff-cmd.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-compare.sh b/tests-ng/chmod-compare.sh index 41ed3af..1c26360 100755 --- a/tests-ng/chmod-compare.sh +++ b/tests-ng/chmod-compare.sh @@ -5,44 +5,20 @@ # test chmod on compare # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-import.sh b/tests-ng/chmod-import.sh index ebc7fee..70c1310 100755 --- a/tests-ng/chmod-import.sh +++ b/tests-ng/chmod-import.sh @@ -7,44 +7,20 @@ # with different link # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-install.sh b/tests-ng/chmod-install.sh index f22a16c..3e5ec6c 100755 --- a/tests-ng/chmod-install.sh +++ b/tests-ng/chmod-install.sh @@ -7,44 +7,20 @@ # with different link # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-more.sh b/tests-ng/chmod-more.sh index 7988b15..42412e1 100755 --- a/tests-ng/chmod-more.sh +++ b/tests-ng/chmod-more.sh @@ -7,44 +7,20 @@ # with different link # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-preserve-install.sh b/tests-ng/chmod-preserve-install.sh index 7d2064b..d59638b 100755 --- a/tests-ng/chmod-preserve-install.sh +++ b/tests-ng/chmod-preserve-install.sh @@ -5,44 +5,20 @@ # test chmod preserve on install # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-preserve-update.sh b/tests-ng/chmod-preserve-update.sh index 9d00c2d..3a91d2d 100755 --- a/tests-ng/chmod-preserve-update.sh +++ b/tests-ng/chmod-preserve-update.sh @@ -5,44 +5,20 @@ # test chmod preserve on update # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/chmod-update.sh b/tests-ng/chmod-update.sh index 54fbdae..99ca84e 100755 --- a/tests-ng/chmod-update.sh +++ b/tests-ng/chmod-update.sh @@ -5,44 +5,20 @@ # test chmod on update # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/clear-workdir.sh b/tests-ng/clear-workdir.sh index f17587e..3fc213a 100755 --- a/tests-ng/clear-workdir.sh +++ b/tests-ng/clear-workdir.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-diff-types.sh b/tests-ng/compare-diff-types.sh index a3bb4d4..8789859 100755 --- a/tests-ng/compare-diff-types.sh +++ b/tests-ng/compare-diff-types.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-ignore-missing.sh b/tests-ng/compare-ignore-missing.sh index f68a759..afd7288 100755 --- a/tests-ng/compare-ignore-missing.sh +++ b/tests-ng/compare-ignore-missing.sh @@ -6,39 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-ignore-relative.sh b/tests-ng/compare-ignore-relative.sh index 787828d..0c075d4 100755 --- a/tests-ng/compare-ignore-relative.sh +++ b/tests-ng/compare-ignore-relative.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-ignore.sh b/tests-ng/compare-ignore.sh index 4380ba1..0cf6b3e 100755 --- a/tests-ng/compare-ignore.sh +++ b/tests-ng/compare-ignore.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-include.sh b/tests-ng/compare-include.sh index e854735..abd1fd8 100755 --- a/tests-ng/compare-include.sh +++ b/tests-ng/compare-include.sh @@ -5,44 +5,20 @@ # test compare in profile which includes another # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-negative-ignore-relative.sh b/tests-ng/compare-negative-ignore-relative.sh index 4d29fde..e6a0c5e 100755 --- a/tests-ng/compare-negative-ignore-relative.sh +++ b/tests-ng/compare-negative-ignore-relative.sh @@ -5,39 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare-profile-check.sh b/tests-ng/compare-profile-check.sh index 21b957b..da0b2dd 100755 --- a/tests-ng/compare-profile-check.sh +++ b/tests-ng/compare-profile-check.sh @@ -6,39 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/compare.sh b/tests-ng/compare.sh index 410516e..7fabb7e 100755 --- a/tests-ng/compare.sh +++ b/tests-ng/compare.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/corner-case.sh b/tests-ng/corner-case.sh index d9e068b..5e8a816 100755 --- a/tests-ng/corner-case.sh +++ b/tests-ng/corner-case.sh @@ -11,44 +11,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/deprecated-link.sh b/tests-ng/deprecated-link.sh index f071699..0f002fa 100755 --- a/tests-ng/deprecated-link.sh +++ b/tests-ng/deprecated-link.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/diff-cmd.sh b/tests-ng/diff-cmd.sh index ebb6bca..de52009 100755 --- a/tests-ng/diff-cmd.sh +++ b/tests-ng/diff-cmd.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dir-import-update.sh b/tests-ng/dir-import-update.sh index 7e58dbb..dba5313 100755 --- a/tests-ng/dir-import-update.sh +++ b/tests-ng/dir-import-update.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dotdrop-variables.sh b/tests-ng/dotdrop-variables.sh index 86dc77f..960879d 100755 --- a/tests-ng/dotdrop-variables.sh +++ b/tests-ng/dotdrop-variables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dotfile-no-src.sh b/tests-ng/dotfile-no-src.sh index 73b9853..c497065 100755 --- a/tests-ng/dotfile-no-src.sh +++ b/tests-ng/dotfile-no-src.sh @@ -6,45 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dotfile-sub-variables.sh b/tests-ng/dotfile-sub-variables.sh index 5256905..a996c18 100755 --- a/tests-ng/dotfile-sub-variables.sh +++ b/tests-ng/dotfile-sub-variables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dotfile-variables.sh b/tests-ng/dotfile-variables.sh index 48a6c52..476c0e0 100755 --- a/tests-ng/dotfile-variables.sh +++ b/tests-ng/dotfile-variables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dotfiles-all.sh b/tests-ng/dotfiles-all.sh index a67f89c..694c9b4 100755 --- a/tests-ng/dotfiles-all.sh +++ b/tests-ng/dotfiles-all.sh @@ -6,45 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dotfiles-dyn-paths.sh b/tests-ng/dotfiles-dyn-paths.sh index a909540..2c6247b 100755 --- a/tests-ng/dotfiles-dyn-paths.sh +++ b/tests-ng/dotfiles-dyn-paths.sh @@ -6,45 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/double-config-import.sh b/tests-ng/double-config-import.sh index f959ac0..360c5b6 100755 --- a/tests-ng/double-config-import.sh +++ b/tests-ng/double-config-import.sh @@ -5,44 +5,20 @@ # test error report on importing the same sub-config file more than once # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dry.sh b/tests-ng/dry.sh index 18b86dd..1237b1c 100755 --- a/tests-ng/dry.sh +++ b/tests-ng/dry.sh @@ -5,44 +5,20 @@ # test dry # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/duplicate-key.sh b/tests-ng/duplicate-key.sh index 777b99f..7c4505d 100755 --- a/tests-ng/duplicate-key.sh +++ b/tests-ng/duplicate-key.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dynactions.sh b/tests-ng/dynactions.sh index 0df19ad..1da63bd 100755 --- a/tests-ng/dynactions.sh +++ b/tests-ng/dynactions.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dyndotfilepaths.sh b/tests-ng/dyndotfilepaths.sh index 4fe774b..3de3811 100755 --- a/tests-ng/dyndotfilepaths.sh +++ b/tests-ng/dyndotfilepaths.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dynextvariables.sh b/tests-ng/dynextvariables.sh index 99843ea..bf03cdd 100755 --- a/tests-ng/dynextvariables.sh +++ b/tests-ng/dynextvariables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dyninclude.sh b/tests-ng/dyninclude.sh index 52ff5c5..ad24e75 100755 --- a/tests-ng/dyninclude.sh +++ b/tests-ng/dyninclude.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/dynvariables.sh b/tests-ng/dynvariables.sh index 17b7e0e..0ab8c85 100755 --- a/tests-ng/dynvariables.sh +++ b/tests-ng/dynvariables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/env.sh b/tests-ng/env.sh index 34710b4..5b77425 100755 --- a/tests-ng/env.sh +++ b/tests-ng/env.sh @@ -5,44 +5,20 @@ # test import with env variables # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/ext-actions.sh b/tests-ng/ext-actions.sh index 8124ec6..c7d923b 100755 --- a/tests-ng/ext-actions.sh +++ b/tests-ng/ext-actions.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/extvariables.sh b/tests-ng/extvariables.sh index e0481ea..ef74c44 100755 --- a/tests-ng/extvariables.sh +++ b/tests-ng/extvariables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/filter_file.sh b/tests-ng/filter_file.sh index 68b5986..8bdcc8a 100755 --- a/tests-ng/filter_file.sh +++ b/tests-ng/filter_file.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/force-actions.sh b/tests-ng/force-actions.sh index 001dfd5..419f4ff 100755 --- a/tests-ng/force-actions.sh +++ b/tests-ng/force-actions.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/func_file.sh b/tests-ng/func_file.sh index 5467cf3..8196293 100755 --- a/tests-ng/func_file.sh +++ b/tests-ng/func_file.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/global-compare-ignore.sh b/tests-ng/global-compare-ignore.sh index 8efab50..8fcc54f 100755 --- a/tests-ng/global-compare-ignore.sh +++ b/tests-ng/global-compare-ignore.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/global-compare-negative-ignore.sh b/tests-ng/global-compare-negative-ignore.sh index 33916c5..e2c5220 100755 --- a/tests-ng/global-compare-negative-ignore.sh +++ b/tests-ng/global-compare-negative-ignore.sh @@ -5,39 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"{ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/global-update-ignore.sh b/tests-ng/global-update-ignore.sh index f3ba4d2..22985ce 100755 --- a/tests-ng/global-update-ignore.sh +++ b/tests-ng/global-update-ignore.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/global-update-negative-ignore.sh b/tests-ng/global-update-negative-ignore.sh index 4bb44cf..4d6b70b 100755 --- a/tests-ng/global-update-negative-ignore.sh +++ b/tests-ng/global-update-negative-ignore.sh @@ -5,39 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/globs.sh b/tests-ng/globs.sh index 034a650..46bf949 100755 --- a/tests-ng/globs.sh +++ b/tests-ng/globs.sh @@ -9,44 +9,20 @@ # - profile import # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/header.sh b/tests-ng/header.sh index d60c5c5..e5b2384 100755 --- a/tests-ng/header.sh +++ b/tests-ng/header.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/ignore-empty.sh b/tests-ng/ignore-empty.sh index 45b09a6..603ecff 100755 --- a/tests-ng/ignore-empty.sh +++ b/tests-ng/ignore-empty.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-as.sh b/tests-ng/import-as.sh index 308e6aa..dc34b95 100755 --- a/tests-ng/import-as.sh +++ b/tests-ng/import-as.sh @@ -5,44 +5,20 @@ # test basic import # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-configs.sh b/tests-ng/import-configs.sh index b4080e9..daec69e 100755 --- a/tests-ng/import-configs.sh +++ b/tests-ng/import-configs.sh @@ -5,44 +5,20 @@ # import config testing # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-configs2.sh b/tests-ng/import-configs2.sh index dfb8fb9..9423b4c 100755 --- a/tests-ng/import-configs2.sh +++ b/tests-ng/import-configs2.sh @@ -5,44 +5,20 @@ # import config testing # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-duplicate.sh b/tests-ng/import-duplicate.sh index 919d65a..f377632 100755 --- a/tests-ng/import-duplicate.sh +++ b/tests-ng/import-duplicate.sh @@ -5,44 +5,20 @@ # test import duplicates # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-ignore.sh b/tests-ng/import-ignore.sh index 82e68f9..1ca1b74 100755 --- a/tests-ng/import-ignore.sh +++ b/tests-ng/import-ignore.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-include.sh b/tests-ng/import-include.sh index d0015ac..b74370f 100755 --- a/tests-ng/import-include.sh +++ b/tests-ng/import-include.sh @@ -5,44 +5,20 @@ # test import in profile which includes another # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-link-children.sh b/tests-ng/import-link-children.sh index ecd40ff..1a804d7 100755 --- a/tests-ng/import-link-children.sh +++ b/tests-ng/import-link-children.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-negative-ignore.sh b/tests-ng/import-negative-ignore.sh index 2086739..df2c757 100755 --- a/tests-ng/import-negative-ignore.sh +++ b/tests-ng/import-negative-ignore.sh @@ -5,39 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-non-existing.sh b/tests-ng/import-non-existing.sh index a4d227c..0c32dc1 100755 --- a/tests-ng/import-non-existing.sh +++ b/tests-ng/import-non-existing.sh @@ -5,44 +5,20 @@ # test import not existing # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-profile-dotfiles.sh b/tests-ng/import-profile-dotfiles.sh index ceef938..9863b80 100755 --- a/tests-ng/import-profile-dotfiles.sh +++ b/tests-ng/import-profile-dotfiles.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-subfile.sh b/tests-ng/import-subfile.sh index 9b10568..fe9cf5f 100755 --- a/tests-ng/import-subfile.sh +++ b/tests-ng/import-subfile.sh @@ -6,44 +6,20 @@ # after having imported directory # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-to-no-profile.sh b/tests-ng/import-to-no-profile.sh index a959f42..d4b0af0 100755 --- a/tests-ng/import-to-no-profile.sh +++ b/tests-ng/import-to-no-profile.sh @@ -5,44 +5,20 @@ # test import to no profile (using ALL keyword) # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-variables.sh b/tests-ng/import-variables.sh index bd5f91c..1972791 100755 --- a/tests-ng/import-variables.sh +++ b/tests-ng/import-variables.sh @@ -7,44 +7,20 @@ # see issue 380 # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-with-empty.sh b/tests-ng/import-with-empty.sh index 0f33bed..5aba9bb 100755 --- a/tests-ng/import-with-empty.sh +++ b/tests-ng/import-with-empty.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import-with-trans.sh b/tests-ng/import-with-trans.sh index 387d074..ea9f5ce 100755 --- a/tests-ng/import-with-trans.sh +++ b/tests-ng/import-with-trans.sh @@ -6,45 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/import.sh b/tests-ng/import.sh index d16d32e..69e127a 100755 --- a/tests-ng/import.sh +++ b/tests-ng/import.sh @@ -5,44 +5,20 @@ # test basic import # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/imported-configs-variables.sh b/tests-ng/imported-configs-variables.sh index cf16d45..5c69d86 100755 --- a/tests-ng/imported-configs-variables.sh +++ b/tests-ng/imported-configs-variables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/imported-variables-from-config.sh b/tests-ng/imported-variables-from-config.sh index 92f334a..f5eaf89 100755 --- a/tests-ng/imported-variables-from-config.sh +++ b/tests-ng/imported-variables-from-config.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/include-actions.sh b/tests-ng/include-actions.sh index 13f683e..e02189c 100755 --- a/tests-ng/include-actions.sh +++ b/tests-ng/include-actions.sh @@ -7,44 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/include-order.sh b/tests-ng/include-order.sh index 923bda5..1f2f0c7 100755 --- a/tests-ng/include-order.sh +++ b/tests-ng/include-order.sh @@ -7,44 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/include-variables.sh b/tests-ng/include-variables.sh index 35f8aed..a575e33 100755 --- a/tests-ng/include-variables.sh +++ b/tests-ng/include-variables.sh @@ -7,44 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/include.sh b/tests-ng/include.sh index 93e6212..6aba573 100755 --- a/tests-ng/include.sh +++ b/tests-ng/include.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/inst-link-default.sh b/tests-ng/inst-link-default.sh index 63c11dc..8cca8e7 100755 --- a/tests-ng/inst-link-default.sh +++ b/tests-ng/inst-link-default.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/install-empty.sh b/tests-ng/install-empty.sh index 3fdfcde..747919a 100755 --- a/tests-ng/install-empty.sh +++ b/tests-ng/install-empty.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/install-ignore.sh b/tests-ng/install-ignore.sh index 8f876c3..fbfbf3c 100755 --- a/tests-ng/install-ignore.sh +++ b/tests-ng/install-ignore.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/install-link-children.sh b/tests-ng/install-link-children.sh index dd0c19a..9737bfd 100755 --- a/tests-ng/install-link-children.sh +++ b/tests-ng/install-link-children.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/install-negative-ignore.sh b/tests-ng/install-negative-ignore.sh index c45543d..8a213c4 100755 --- a/tests-ng/install-negative-ignore.sh +++ b/tests-ng/install-negative-ignore.sh @@ -5,39 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/install-to-temp.sh b/tests-ng/install-to-temp.sh index ba65816..dbac419 100755 --- a/tests-ng/install-to-temp.sh +++ b/tests-ng/install-to-temp.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/install.sh b/tests-ng/install.sh index 1b24cfe..71b3a3e 100755 --- a/tests-ng/install.sh +++ b/tests-ng/install.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/jhelpers.sh b/tests-ng/jhelpers.sh index e89b08c..2e20a52 100755 --- a/tests-ng/jhelpers.sh +++ b/tests-ng/jhelpers.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/key-prefix-sep.sh b/tests-ng/key-prefix-sep.sh index e92fd35..b0c549a 100755 --- a/tests-ng/key-prefix-sep.sh +++ b/tests-ng/key-prefix-sep.sh @@ -5,44 +5,20 @@ # test key_prefix and key_separator # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/link-import-default.sh b/tests-ng/link-import-default.sh index 3c33cbf..972c520 100755 --- a/tests-ng/link-import-default.sh +++ b/tests-ng/link-import-default.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/link-templates-dir-home.sh b/tests-ng/link-templates-dir-home.sh index 825079f..3da73de 100755 --- a/tests-ng/link-templates-dir-home.sh +++ b/tests-ng/link-templates-dir-home.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/link-templates-dir.sh b/tests-ng/link-templates-dir.sh index debbe82..91a66b4 100755 --- a/tests-ng/link-templates-dir.sh +++ b/tests-ng/link-templates-dir.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/link-templates.sh b/tests-ng/link-templates.sh index 29142f6..f987b81 100755 --- a/tests-ng/link-templates.sh +++ b/tests-ng/link-templates.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/link-value-tests.sh b/tests-ng/link-value-tests.sh index 6e3b9d9..17598fd 100755 --- a/tests-ng/link-value-tests.sh +++ b/tests-ng/link-value-tests.sh @@ -7,44 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/macro-with-globals.sh b/tests-ng/macro-with-globals.sh index 2a9a864..0c1a992 100755 --- a/tests-ng/macro-with-globals.sh +++ b/tests-ng/macro-with-globals.sh @@ -5,44 +5,20 @@ # import variables from file # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/minversion.sh b/tests-ng/minversion.sh index b7431cc..b6842f9 100755 --- a/tests-ng/minversion.sh +++ b/tests-ng/minversion.sh @@ -4,44 +4,20 @@ # # test minversion -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/misc.sh b/tests-ng/misc.sh index aec3622..f5afb1c 100755 --- a/tests-ng/misc.sh +++ b/tests-ng/misc.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/negative-ignore-no-match.sh b/tests-ng/negative-ignore-no-match.sh index 439341f..df9ed07 100755 --- a/tests-ng/negative-ignore-no-match.sh +++ b/tests-ng/negative-ignore-no-match.sh @@ -6,38 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/notemplate.sh b/tests-ng/notemplate.sh index dee37fb..c60cefa 100755 --- a/tests-ng/notemplate.sh +++ b/tests-ng/notemplate.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/profile-actions.sh b/tests-ng/profile-actions.sh index ee157d8..bde4c12 100755 --- a/tests-ng/profile-actions.sh +++ b/tests-ng/profile-actions.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/profile-dyninclude.sh b/tests-ng/profile-dyninclude.sh index 8f9921d..02378d3 100755 --- a/tests-ng/profile-dyninclude.sh +++ b/tests-ng/profile-dyninclude.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/profile-dynvariables.sh b/tests-ng/profile-dynvariables.sh index 845abfc..804d286 100755 --- a/tests-ng/profile-dynvariables.sh +++ b/tests-ng/profile-dynvariables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/profile-import-dotfiles.sh b/tests-ng/profile-import-dotfiles.sh index cd8677a..ac5cf1a 100755 --- a/tests-ng/profile-import-dotfiles.sh +++ b/tests-ng/profile-import-dotfiles.sh @@ -7,44 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/profile-undefined-variables.sh b/tests-ng/profile-undefined-variables.sh index a623a82..4bc8efa 100755 --- a/tests-ng/profile-undefined-variables.sh +++ b/tests-ng/profile-undefined-variables.sh @@ -7,44 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/re-import.sh b/tests-ng/re-import.sh index 4801ae6..3664072 100755 --- a/tests-ng/re-import.sh +++ b/tests-ng/re-import.sh @@ -5,44 +5,20 @@ # test re-importing file # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/recinclude.sh b/tests-ng/recinclude.sh index 9b1836a..fae98d5 100755 --- a/tests-ng/recinclude.sh +++ b/tests-ng/recinclude.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/recvariables.sh b/tests-ng/recvariables.sh index 924ded0..da99512 100755 --- a/tests-ng/recvariables.sh +++ b/tests-ng/recvariables.sh @@ -6,45 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/remove.sh b/tests-ng/remove.sh index 7f525e9..cdc1841 100755 --- a/tests-ng/remove.sh +++ b/tests-ng/remove.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/symlink-relative.sh b/tests-ng/symlink-relative.sh index 8508428..6e32dbc 100755 --- a/tests-ng/symlink-relative.sh +++ b/tests-ng/symlink-relative.sh @@ -5,44 +5,20 @@ # test relative symlink # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/symlink.sh b/tests-ng/symlink.sh index 8cd5e83..a145cd2 100755 --- a/tests-ng/symlink.sh +++ b/tests-ng/symlink.sh @@ -5,44 +5,20 @@ # test symlinking dotfiles # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/template-dotpath.sh b/tests-ng/template-dotpath.sh index da63fb6..0860add 100755 --- a/tests-ng/template-dotpath.sh +++ b/tests-ng/template-dotpath.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/template-link-value.sh b/tests-ng/template-link-value.sh index ddde131..5b31444 100755 --- a/tests-ng/template-link-value.sh +++ b/tests-ng/template-link-value.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/toml.sh b/tests-ng/toml.sh index d0c2ca5..792988d 100755 --- a/tests-ng/toml.sh +++ b/tests-ng/toml.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/transformations-template.sh b/tests-ng/transformations-template.sh index da9bea8..eb13306 100755 --- a/tests-ng/transformations-template.sh +++ b/tests-ng/transformations-template.sh @@ -5,45 +5,20 @@ # test transformations using templates # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/transformations-with-args.sh b/tests-ng/transformations-with-args.sh index 1acf1ef..2647e28 100755 --- a/tests-ng/transformations-with-args.sh +++ b/tests-ng/transformations-with-args.sh @@ -5,45 +5,20 @@ # test transformations with args and templates # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/transformations.sh b/tests-ng/transformations.sh index 6b7ef0d..fcbb549 100755 --- a/tests-ng/transformations.sh +++ b/tests-ng/transformations.sh @@ -7,45 +7,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e -#set -v - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-ignore-missing.sh b/tests-ng/update-ignore-missing.sh index 2a68426..da104eb 100755 --- a/tests-ng/update-ignore-missing.sh +++ b/tests-ng/update-ignore-missing.sh @@ -6,39 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-ignore-relative.sh b/tests-ng/update-ignore-relative.sh index 38398cb..45d7552 100755 --- a/tests-ng/update-ignore-relative.sh +++ b/tests-ng/update-ignore-relative.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-ignore.sh b/tests-ng/update-ignore.sh index 7b9fcb7..42594b1 100755 --- a/tests-ng/update-ignore.sh +++ b/tests-ng/update-ignore.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-negative-ignore-relative.sh b/tests-ng/update-negative-ignore-relative.sh index 6bf77f8..9709bca 100755 --- a/tests-ng/update-negative-ignore-relative.sh +++ b/tests-ng/update-negative-ignore-relative.sh @@ -5,39 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-negative-ignore.sh b/tests-ng/update-negative-ignore.sh index 19d92a8..1325564 100755 --- a/tests-ng/update-negative-ignore.sh +++ b/tests-ng/update-negative-ignore.sh @@ -5,44 +5,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ -n "${1}" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && exho "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-profile-check.sh b/tests-ng/update-profile-check.sh index 064fc7a..7827d67 100755 --- a/tests-ng/update-profile-check.sh +++ b/tests-ng/update-profile-check.sh @@ -6,39 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-rights.sh b/tests-ng/update-rights.sh index 5271a8a..0fbf69a 100755 --- a/tests-ng/update-rights.sh +++ b/tests-ng/update-rights.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-templates.sh b/tests-ng/update-templates.sh index 4010a08..e638569 100755 --- a/tests-ng/update-templates.sh +++ b/tests-ng/update-templates.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update-with-key.sh b/tests-ng/update-with-key.sh index 9484cb4..c5d31e3 100755 --- a/tests-ng/update-with-key.sh +++ b/tests-ng/update-with-key.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/update.sh b/tests-ng/update.sh index a8bb137..fde29a9 100755 --- a/tests-ng/update.sh +++ b/tests-ng/update.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/uservariables.sh b/tests-ng/uservariables.sh index 65db03c..55b82ba 100755 --- a/tests-ng/uservariables.sh +++ b/tests-ng/uservariables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/variables-enrich.sh b/tests-ng/variables-enrich.sh index 945460a..0b1722f 100755 --- a/tests-ng/variables-enrich.sh +++ b/tests-ng/variables-enrich.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/variables-include.sh b/tests-ng/variables-include.sh index 483fb2f..95423cd 100755 --- a/tests-ng/variables-include.sh +++ b/tests-ng/variables-include.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/variables.sh b/tests-ng/variables.sh index 5a3b808..7d982e5 100755 --- a/tests-ng/variables.sh +++ b/tests-ng/variables.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/workdir-compare.sh b/tests-ng/workdir-compare.sh index aff7d5b..84c6b05 100755 --- a/tests-ng/workdir-compare.sh +++ b/tests-ng/workdir-compare.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test diff --git a/tests-ng/workdir.sh b/tests-ng/workdir.sh index d35d49a..4c29224 100755 --- a/tests-ng/workdir.sh +++ b/tests-ng/workdir.sh @@ -6,44 +6,20 @@ # returns 1 in case of error # -# exit on first error +## start-cookie set -e - -# all this crap to get current path -rl="readlink -f" -if ! ${rl} "${0}" >/dev/null 2>&1; then - rl="realpath" - - if ! hash ${rl}; then - echo "\"${rl}\" not found !" && exit 1 - fi -fi -cur=$(dirname "$(${rl} "${0}")") - -#hash dotdrop >/dev/null 2>&1 -#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 - -#echo "called with ${1}" - -# dotdrop path can be pass as argument +cur=$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd) ddpath="${cur}/../" -[ "${1}" != "" ] && ddpath="${1}" -[ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 - export PYTHONPATH="${ddpath}:${PYTHONPATH}" -bin="python3 -m dotdrop.dotdrop" +altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then - bin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" + altbin="coverage run -p --source=dotdrop -m dotdrop.dotdrop" fi - -echo "dotdrop path: ${ddpath}" -echo "pythonpath: ${PYTHONPATH}" - -# get the helpers +bin="${DT_BIN:-${altbin}}" # shellcheck source=tests-ng/helpers source "${cur}"/helpers - echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sgr0)" +## end-cookie ################################################################ # this is the test