From 6386808384166087a1a9405793aa110848812280 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 21 Sep 2023 14:09:16 +0200 Subject: [PATCH] tests refactoring --- bootstrap.sh | 2 +- completion/generate.sh | 2 +- dotdrop.sh | 2 +- packages/genpkg.sh | 2 +- scripts/check-doc.sh | 10 +++------- scripts/check-syntax.sh | 14 ++++++++++---- scripts/check-tests-ng.sh | 11 +++++++---- scripts/check-unittests.sh | 7 ++++--- tests-ng/actions-args-template.sh | 5 +++-- tests-ng/actions-args.sh | 5 +++-- tests-ng/actions-default.sh | 5 +++-- tests-ng/actions-empty-dir.sh | 5 +++-- tests-ng/actions-pre.sh | 5 +++-- tests-ng/actions-template.sh | 5 +++-- tests-ng/actions.sh | 5 +++-- tests-ng/bad-diff-cmd.sh | 11 +++++++---- tests-ng/chmod-compare.sh | 5 +++-- tests-ng/chmod-import.sh | 5 +++-- tests-ng/chmod-install.sh | 5 +++-- tests-ng/chmod-more.sh | 5 +++-- tests-ng/chmod-preserve-install.sh | 5 +++-- tests-ng/chmod-preserve-update.sh | 5 +++-- tests-ng/chmod-update.sh | 5 +++-- tests-ng/clear-workdir.sh | 5 +++-- tests-ng/compare-diff-types.sh | 5 +++-- tests-ng/compare-global-negative-ignore.sh | 5 +++-- tests-ng/compare-ignore-in-dotpath.sh | 5 +++-- tests-ng/compare-ignore-missing.sh | 5 +++-- tests-ng/compare-ignore-relative.sh | 5 +++-- tests-ng/compare-ignore.sh | 5 +++-- tests-ng/compare-include.sh | 5 +++-- tests-ng/compare-negative-ignore-all-but.sh | 5 +++-- tests-ng/compare-negative-ignore-relative.sh | 5 +++-- tests-ng/compare-negative-ignore.sh | 5 +++-- tests-ng/compare-profile-check.sh | 5 +++-- tests-ng/compare.sh | 5 +++-- tests-ng/corner-case.sh | 5 +++-- tests-ng/deprecated-link.sh | 5 +++-- tests-ng/diff-cmd.sh | 5 +++-- tests-ng/dir-import-update.sh | 5 +++-- tests-ng/dotdrop-variables.sh | 5 +++-- tests-ng/dotfile-no-src.sh | 5 +++-- tests-ng/dotfile-sub-variables.sh | 5 +++-- tests-ng/dotfile-variables.sh | 5 +++-- tests-ng/dotfiles-all.sh | 5 +++-- tests-ng/dotfiles-dyn-paths.sh | 5 +++-- tests-ng/double-config-import.sh | 5 +++-- tests-ng/dry.sh | 5 +++-- tests-ng/duplicate-key.sh | 5 +++-- tests-ng/dynactions.sh | 5 +++-- tests-ng/dyndotfilepaths.sh | 5 +++-- tests-ng/dynextvariables.sh | 5 +++-- tests-ng/dyninclude.sh | 5 +++-- tests-ng/dynvariables.sh | 7 ++++--- tests-ng/env.sh | 5 +++-- tests-ng/ext-actions.sh | 5 +++-- tests-ng/extvariables.sh | 5 +++-- tests-ng/filter_file.sh | 5 +++-- tests-ng/force-actions.sh | 5 +++-- tests-ng/func_file.sh | 5 +++-- tests-ng/global-compare-ignore.sh | 5 +++-- tests-ng/global-update-ignore.sh | 5 +++-- tests-ng/globs.sh | 5 +++-- tests-ng/header.sh | 5 +++-- tests-ng/helpers | 8 ++++++-- tests-ng/ignore-empty.sh | 5 +++-- tests-ng/import-as.sh | 5 +++-- tests-ng/import-configs.sh | 5 +++-- tests-ng/import-configs2.sh | 5 +++-- tests-ng/import-duplicate.sh | 5 +++-- tests-ng/import-ignore-in-dotpath.sh | 5 +++-- tests-ng/import-ignore.sh | 5 +++-- tests-ng/import-include.sh | 5 +++-- tests-ng/import-link-children.sh | 5 +++-- tests-ng/import-negative-ignore-all-but.sh | 5 +++-- tests-ng/import-negative-ignore.sh | 5 +++-- tests-ng/import-non-existing.sh | 5 +++-- tests-ng/import-profile-dotfiles.sh | 5 +++-- tests-ng/import-subfile.sh | 5 +++-- tests-ng/import-to-no-profile.sh | 5 +++-- tests-ng/import-variables.sh | 5 +++-- tests-ng/import-with-empty.sh | 5 +++-- tests-ng/import-with-trans.sh | 5 +++-- tests-ng/import.sh | 5 +++-- tests-ng/imported-configs-variables.sh | 5 +++-- tests-ng/imported-variables-from-config.sh | 5 +++-- tests-ng/include-actions.sh | 5 +++-- tests-ng/include-order.sh | 5 +++-- tests-ng/include-variables.sh | 5 +++-- tests-ng/include.sh | 5 +++-- tests-ng/inst-link-default.sh | 5 +++-- tests-ng/install-empty.sh | 5 +++-- tests-ng/install-ignore.sh | 5 +++-- tests-ng/install-link-children.sh | 5 +++-- tests-ng/install-negative-ignore-all-but.sh | 5 +++-- tests-ng/install-negative-ignore-no-match.sh | 5 +++-- tests-ng/install-negative-ignore.sh | 5 +++-- tests-ng/install-to-temp.sh | 5 +++-- tests-ng/install.sh | 5 +++-- tests-ng/jhelpers.sh | 5 +++-- tests-ng/key-prefix-sep.sh | 5 +++-- tests-ng/link-import-default.sh | 5 +++-- tests-ng/link-templates-dir-home.sh | 5 +++-- tests-ng/link-templates-dir.sh | 5 +++-- tests-ng/link-templates.sh | 5 +++-- tests-ng/link-value-tests.sh | 5 +++-- tests-ng/macro-with-globals.sh | 5 +++-- tests-ng/minversion.sh | 5 +++-- tests-ng/misc.sh | 5 +++-- tests-ng/notemplate.sh | 5 +++-- tests-ng/profile-actions.sh | 5 +++-- tests-ng/profile-dyninclude.sh | 5 +++-- tests-ng/profile-dynvariables.sh | 9 +++++---- tests-ng/profile-import-dotfiles.sh | 5 +++-- tests-ng/profile-undefined-variables.sh | 5 +++-- tests-ng/re-import.sh | 5 +++-- tests-ng/recinclude.sh | 5 +++-- tests-ng/recvariables.sh | 5 +++-- tests-ng/remove.sh | 5 +++-- tests-ng/symlink-relative.sh | 5 +++-- tests-ng/symlink.sh | 5 +++-- tests-ng/template-dotpath.sh | 5 +++-- tests-ng/template-link-value.sh | 5 +++-- tests-ng/template-link.sh | 5 +++-- tests-ng/template-vars-dict.sh | 5 +++-- tests-ng/tests_launcher.py | 2 +- tests-ng/toml.sh | 5 +++-- tests-ng/transformations-template.sh | 5 +++-- tests-ng/transformations-with-args.sh | 5 +++-- tests-ng/transformations.sh | 5 +++-- tests-ng/update-global-negative-ignore.sh | 5 +++-- tests-ng/update-ignore-in-dotpath.sh | 5 +++-- tests-ng/update-ignore-missing.sh | 5 +++-- tests-ng/update-ignore-relative.sh | 5 +++-- tests-ng/update-ignore.sh | 5 +++-- tests-ng/update-negative-ignore-all-but.sh | 5 +++-- tests-ng/update-negative-ignore-relative.sh | 5 +++-- tests-ng/update-negative-ignore.sh | 5 +++-- tests-ng/update-profile-check.sh | 5 +++-- tests-ng/update-rights.sh | 5 +++-- tests-ng/update-templates.sh | 5 +++-- tests-ng/update-with-key.sh | 5 +++-- tests-ng/update.sh | 5 +++-- tests-ng/uservariables.sh | 5 +++-- tests-ng/variables-enrich.sh | 5 +++-- tests-ng/variables-include.sh | 5 +++-- tests-ng/variables-nested.sh | 5 +++-- tests-ng/variables.sh | 5 +++-- tests-ng/workdir-compare.sh | 5 +++-- tests-ng/workdir.sh | 5 +++-- tests.sh | 14 +++++++------- 151 files changed, 469 insertions(+), 317 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 904fd91..49acd16 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2017, deadc0de6 diff --git a/completion/generate.sh b/completion/generate.sh index c49bac8..1e875a0 100755 --- a/completion/generate.sh +++ b/completion/generate.sh @@ -5,7 +5,7 @@ # pip3 install --user infi.docopt_completion # -set -e +set -euo errtrace pipefail bin="docopt-completion" if ! hash ${bin}; then diff --git a/dotdrop.sh b/dotdrop.sh index e9e5522..e48cc48 100755 --- a/dotdrop.sh +++ b/dotdrop.sh @@ -27,7 +27,7 @@ else # virtualenv pybin="${ENV_DIR}/bin/python" fi -hash "${pybin}" 2>/dev/null || (echo "python executable not found" && exit 1) +hash "${pybin}" 2>/dev/null || { echo "python executable not found" && exit 1; } # launch dotdrop PYTHONPATH=dotdrop:${PYTHONPATH} ${pybin} -m dotdrop.dotdrop "${args[@]}" diff --git a/packages/genpkg.sh b/packages/genpkg.sh index f4916a6..d917973 100755 --- a/packages/genpkg.sh +++ b/packages/genpkg.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # author: deadc0de6 # # update packages diff --git a/scripts/check-doc.sh b/scripts/check-doc.sh index 6ae1f90..fa002f9 100755 --- a/scripts/check-doc.sh +++ b/scripts/check-doc.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2022, deadc0de6 # stop on first error -set -e +set -euo errtrace pipefail ## test doc external links echo "------------------------" @@ -16,11 +16,7 @@ done ## https://github.com/remarkjs/remark-validate-links ## https://github.com/tcort/markdown-link-check ## npm install -g remark-cli remark-validate-links -set +e -which remark >/dev/null 2>&1 -r="$?" -set -e -if [ "$r" != "0" ]; then +if ! which remark >/dev/null 2>&1; then echo "[WARNING] install \"remark\" to test the doc" exit 1 fi diff --git a/scripts/check-syntax.sh b/scripts/check-syntax.sh index 63743d8..ebea7a2 100755 --- a/scripts/check-syntax.sh +++ b/scripts/check-syntax.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2022, deadc0de6 # stop on first error -set -e +set -euo errtrace pipefail # ensure binaries are here if ! which shellcheck >/dev/null 2>&1; then @@ -43,6 +43,14 @@ grep -rv 'TODO\|FIXME' tests/ >/dev/null 2>&1 grep -rv 'TODO\|FIXME' tests-ng/ >/dev/null 2>&1 grep -rv 'TODO\|FIXME' scripts/ >/dev/null 2>&1 +# checking for tests options +echo "---------------------------------" +echo "checking for bash strict mode" +find tests-ng -iname '*.sh' | while read -r script; do + #grep 'set +e' "${script}" 2>&1 >/dev/null && echo "set +e found in ${script}" && exit 1 + grep 'set \-euxo errtrace pipefailuxo errtrace pipefail' "${script}" || (echo "set -euo errtrace pipefail not set in ${script}" && exit 1 ) +done + # PEP8 tests # W503: Line break occurred before a binary operator # W504: Line break occurred after a binary operator @@ -114,11 +122,9 @@ done echo "------------------------" echo "checking for more issues" -set +e exceptions="save_uservariables_name\|@@\|diff_cmd\|original,\|modified," # f-string errors and missing f literal find dotdrop/ -iname '*.py' -exec grep --with-filename -n -v "f'" {} \; | grep -v "{'" | grep -v "${exceptions}" | grep "'.*}" && echo "bad string format (1)" && exit 1 find dotdrop/ -iname '*.py' -exec grep --with-filename -n -v 'f"' {} \; | grep -v "f'" | grep -v '{"' | grep -v "${exceptions}" | grep '".*}' && echo "bad string format (2)" && exit 1 -set -e echo "syntax OK" \ No newline at end of file diff --git a/scripts/check-tests-ng.sh b/scripts/check-tests-ng.sh index bdaaf93..9dc74df 100755 --- a/scripts/check-tests-ng.sh +++ b/scripts/check-tests-ng.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2023, deadc0de6 # stop on first error -set -e +set -euo errtrace pipefail tmpworkdir="/tmp/dotdrop-tests-workdir" export DOTDROP_WORKDIR="${tmpworkdir}" @@ -13,7 +13,8 @@ workdir_tmp_exists="no" [ -d "${HOME}/.config/dotdrop/tmp" ] && workdir_tmp_exists="yes" # run bash tests -if [ -z "${GITHUB_WORKFLOW}" ]; then +GH_WORKFLOW=${GITHUB_WORKFLOW:-} +if [ -z "${GH_WORKFLOW}" ]; then ## local tests-ng/tests_launcher.py -s else @@ -26,4 +27,6 @@ fi # clear workdir [ "${workdir_tmp_exists}" = "no" ] && rm -rf ~/.config/dotdrop/tmp # clear temp workdir -rm -rf "${tmpworkdir}" \ No newline at end of file +rm -rf "${tmpworkdir}" + +echo "tests-ng done" \ No newline at end of file diff --git a/scripts/check-unittests.sh b/scripts/check-unittests.sh index 451b38b..d301d5d 100755 --- a/scripts/check-unittests.sh +++ b/scripts/check-unittests.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/usr/bin/env bash # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2023, deadc0de6 # stop on first error -set -e +set -euo errtrace pipefail -if [ -n "${DOTDROP_WORKERS}" ]; then +WORKERS=${DOTDROP_WORKERS:-} +if [ -n "${WORKERS}" ]; then unset DOTDROP_WORKERS echo "DISABLE workers for unittests" fi diff --git a/tests-ng/actions-args-template.sh b/tests-ng/actions-args-template.sh index 1e6319f..180b275 100755 --- a/tests-ng/actions-args-template.sh +++ b/tests-ng/actions-args-template.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/actions-args.sh b/tests-ng/actions-args.sh index 79be03b..7ea324c 100755 --- a/tests-ng/actions-args.sh +++ b/tests-ng/actions-args.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/actions-default.sh b/tests-ng/actions-default.sh index db7753b..be3c81a 100755 --- a/tests-ng/actions-default.sh +++ b/tests-ng/actions-default.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/actions-empty-dir.sh b/tests-ng/actions-empty-dir.sh index ed7af56..90cede4 100755 --- a/tests-ng/actions-empty-dir.sh +++ b/tests-ng/actions-empty-dir.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/actions-pre.sh b/tests-ng/actions-pre.sh index 8a3cf1a..8a859ac 100755 --- a/tests-ng/actions-pre.sh +++ b/tests-ng/actions-pre.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/actions-template.sh b/tests-ng/actions-template.sh index b29eea1..6974883 100755 --- a/tests-ng/actions-template.sh +++ b/tests-ng/actions-template.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/actions.sh b/tests-ng/actions.sh index 57f7c15..4b64d7e 100755 --- a/tests-ng/actions.sh +++ b/tests-ng/actions.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/bad-diff-cmd.sh b/tests-ng/bad-diff-cmd.sh index 0a0ed90..5b6974f 100755 --- a/tests-ng/bad-diff-cmd.sh +++ b/tests-ng/bad-diff-cmd.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ @@ -42,12 +43,13 @@ dotfiles: profiles: _EOF +# check diff command is reported as error set +e cd "${ddpath}" | ${bin} compare -c "${cfg}" [ "$?" = "0" ] && exit 1 - out=$(cd "${ddpath}" | ${bin} compare -c "${cfg}") echo "${out}" | grep -i 'traceback' && exit 1 +set -e cat > "${cfg}" << _EOF config: @@ -59,12 +61,13 @@ dotfiles: profiles: _EOF +# should fail set +e cd "${ddpath}" | ${bin} compare -c "${cfg}" [ "$?" = "0" ] && exit 1 - out=$(cd "${ddpath}" | ${bin} compare -c "${cfg}") echo "${out}" | grep -i 'traceback' && exit 1 +set -e echo "OK" exit 0 diff --git a/tests-ng/chmod-compare.sh b/tests-ng/chmod-compare.sh index 2db8015..e463abf 100755 --- a/tests-ng/chmod-compare.sh +++ b/tests-ng/chmod-compare.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/chmod-import.sh b/tests-ng/chmod-import.sh index dad0cd2..6dd1560 100755 --- a/tests-ng/chmod-import.sh +++ b/tests-ng/chmod-import.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/chmod-install.sh b/tests-ng/chmod-install.sh index 8769cb5..e5a8afc 100755 --- a/tests-ng/chmod-install.sh +++ b/tests-ng/chmod-install.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/chmod-more.sh b/tests-ng/chmod-more.sh index 3a626f1..b4183cc 100755 --- a/tests-ng/chmod-more.sh +++ b/tests-ng/chmod-more.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/chmod-preserve-install.sh b/tests-ng/chmod-preserve-install.sh index debf27d..e9a9b89 100755 --- a/tests-ng/chmod-preserve-install.sh +++ b/tests-ng/chmod-preserve-install.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/chmod-preserve-update.sh b/tests-ng/chmod-preserve-update.sh index 4fb9275..8a36bba 100755 --- a/tests-ng/chmod-preserve-update.sh +++ b/tests-ng/chmod-preserve-update.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/chmod-update.sh b/tests-ng/chmod-update.sh index c57f63c..2e6bc53 100755 --- a/tests-ng/chmod-update.sh +++ b/tests-ng/chmod-update.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/clear-workdir.sh b/tests-ng/clear-workdir.sh index 9d5bd92..2f0edf3 100755 --- a/tests-ng/clear-workdir.sh +++ b/tests-ng/clear-workdir.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-diff-types.sh b/tests-ng/compare-diff-types.sh index 5ce6647..ffc68ae 100755 --- a/tests-ng/compare-diff-types.sh +++ b/tests-ng/compare-diff-types.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-global-negative-ignore.sh b/tests-ng/compare-global-negative-ignore.sh index d0d24d8..d23a0de 100755 --- a/tests-ng/compare-global-negative-ignore.sh +++ b/tests-ng/compare-global-negative-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-ignore-in-dotpath.sh b/tests-ng/compare-ignore-in-dotpath.sh index 5e9a965..554abe2 100755 --- a/tests-ng/compare-ignore-in-dotpath.sh +++ b/tests-ng/compare-ignore-in-dotpath.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-ignore-missing.sh b/tests-ng/compare-ignore-missing.sh index 7132725..28210b1 100755 --- a/tests-ng/compare-ignore-missing.sh +++ b/tests-ng/compare-ignore-missing.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-ignore-relative.sh b/tests-ng/compare-ignore-relative.sh index da80def..9fe4d96 100755 --- a/tests-ng/compare-ignore-relative.sh +++ b/tests-ng/compare-ignore-relative.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-ignore.sh b/tests-ng/compare-ignore.sh index b1e2217..dd8b89c 100755 --- a/tests-ng/compare-ignore.sh +++ b/tests-ng/compare-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-include.sh b/tests-ng/compare-include.sh index 927063c..3793b0a 100755 --- a/tests-ng/compare-include.sh +++ b/tests-ng/compare-include.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-negative-ignore-all-but.sh b/tests-ng/compare-negative-ignore-all-but.sh index 35cec5d..23db920 100755 --- a/tests-ng/compare-negative-ignore-all-but.sh +++ b/tests-ng/compare-negative-ignore-all-but.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-negative-ignore-relative.sh b/tests-ng/compare-negative-ignore-relative.sh index e9e40c7..009bc07 100755 --- a/tests-ng/compare-negative-ignore-relative.sh +++ b/tests-ng/compare-negative-ignore-relative.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare-negative-ignore.sh b/tests-ng/compare-negative-ignore.sh index f980395..18fe19e 100755 --- a/tests-ng/compare-negative-ignore.sh +++ b/tests-ng/compare-negative-ignore.sh @@ -7,7 +7,7 @@ # # exit on first error -#set -e +#set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) @@ -16,7 +16,8 @@ ddpath="${cur}/../" [ -n "${1}" ] && ddpath="${1}" [ ! -d "${ddpath}" ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" bin="python3 -m dotdrop.dotdrop" echo "dotdrop path: ${ddpath}" diff --git a/tests-ng/compare-profile-check.sh b/tests-ng/compare-profile-check.sh index f61ef0a..3a934c1 100755 --- a/tests-ng/compare-profile-check.sh +++ b/tests-ng/compare-profile-check.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/compare.sh b/tests-ng/compare.sh index 359f0e3..00936f3 100755 --- a/tests-ng/compare.sh +++ b/tests-ng/compare.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/corner-case.sh b/tests-ng/corner-case.sh index f2a0cc0..c615639 100755 --- a/tests-ng/corner-case.sh +++ b/tests-ng/corner-case.sh @@ -12,10 +12,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/deprecated-link.sh b/tests-ng/deprecated-link.sh index 2d81e3d..6f66c58 100755 --- a/tests-ng/deprecated-link.sh +++ b/tests-ng/deprecated-link.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/diff-cmd.sh b/tests-ng/diff-cmd.sh index c8eb974..0efdc8f 100755 --- a/tests-ng/diff-cmd.sh +++ b/tests-ng/diff-cmd.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dir-import-update.sh b/tests-ng/dir-import-update.sh index a3ab53b..9c16a4e 100755 --- a/tests-ng/dir-import-update.sh +++ b/tests-ng/dir-import-update.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dotdrop-variables.sh b/tests-ng/dotdrop-variables.sh index c3ce000..45ecd8d 100755 --- a/tests-ng/dotdrop-variables.sh +++ b/tests-ng/dotdrop-variables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dotfile-no-src.sh b/tests-ng/dotfile-no-src.sh index 97074e8..484e8da 100755 --- a/tests-ng/dotfile-no-src.sh +++ b/tests-ng/dotfile-no-src.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dotfile-sub-variables.sh b/tests-ng/dotfile-sub-variables.sh index 2ce8101..b1ed783 100755 --- a/tests-ng/dotfile-sub-variables.sh +++ b/tests-ng/dotfile-sub-variables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dotfile-variables.sh b/tests-ng/dotfile-variables.sh index 2e4c4fc..f1ef3e2 100755 --- a/tests-ng/dotfile-variables.sh +++ b/tests-ng/dotfile-variables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dotfiles-all.sh b/tests-ng/dotfiles-all.sh index 90ebbfe..3860f9f 100755 --- a/tests-ng/dotfiles-all.sh +++ b/tests-ng/dotfiles-all.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dotfiles-dyn-paths.sh b/tests-ng/dotfiles-dyn-paths.sh index e03fd24..1313ced 100755 --- a/tests-ng/dotfiles-dyn-paths.sh +++ b/tests-ng/dotfiles-dyn-paths.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/double-config-import.sh b/tests-ng/double-config-import.sh index f89dd2b..42a6c42 100755 --- a/tests-ng/double-config-import.sh +++ b/tests-ng/double-config-import.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dry.sh b/tests-ng/dry.sh index 6ce24a0..331bde6 100755 --- a/tests-ng/dry.sh +++ b/tests-ng/dry.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/duplicate-key.sh b/tests-ng/duplicate-key.sh index b4a13ef..36c55cf 100755 --- a/tests-ng/duplicate-key.sh +++ b/tests-ng/duplicate-key.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dynactions.sh b/tests-ng/dynactions.sh index 16c6a3a..493546a 100755 --- a/tests-ng/dynactions.sh +++ b/tests-ng/dynactions.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dyndotfilepaths.sh b/tests-ng/dyndotfilepaths.sh index 5f72f46..00eb58f 100755 --- a/tests-ng/dyndotfilepaths.sh +++ b/tests-ng/dyndotfilepaths.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dynextvariables.sh b/tests-ng/dynextvariables.sh index 25045b6..945f9b2 100755 --- a/tests-ng/dynextvariables.sh +++ b/tests-ng/dynextvariables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dyninclude.sh b/tests-ng/dyninclude.sh index 68fb122..f90da67 100755 --- a/tests-ng/dyninclude.sh +++ b/tests-ng/dyninclude.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/dynvariables.sh b/tests-ng/dynvariables.sh index 9eb59d8..7976244 100755 --- a/tests-ng/dynvariables.sh +++ b/tests-ng/dynvariables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ @@ -40,7 +41,7 @@ clear_on_exit "${tmpd}" export TESTENV="this is my testenv" scr=$(mktemp --suffix='-dotdrop-tests' || mktemp -d) chmod +x "${scr}" -echo -e "#!/bin/bash\necho $TESTENV\n" >> "${scr}" +echo -e "#!/usr/bin/env bash\necho $TESTENV\n" >> "${scr}" clear_on_exit "${scr}" # create the config file diff --git a/tests-ng/env.sh b/tests-ng/env.sh index cdff81a..0448054 100755 --- a/tests-ng/env.sh +++ b/tests-ng/env.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/ext-actions.sh b/tests-ng/ext-actions.sh index a95538e..f211782 100755 --- a/tests-ng/ext-actions.sh +++ b/tests-ng/ext-actions.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/extvariables.sh b/tests-ng/extvariables.sh index 692235a..a426c9a 100755 --- a/tests-ng/extvariables.sh +++ b/tests-ng/extvariables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/filter_file.sh b/tests-ng/filter_file.sh index 52ae3cf..e6939ad 100755 --- a/tests-ng/filter_file.sh +++ b/tests-ng/filter_file.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/force-actions.sh b/tests-ng/force-actions.sh index ca92c61..55aadd7 100755 --- a/tests-ng/force-actions.sh +++ b/tests-ng/force-actions.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/func_file.sh b/tests-ng/func_file.sh index ad7d9bb..48a66f3 100755 --- a/tests-ng/func_file.sh +++ b/tests-ng/func_file.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/global-compare-ignore.sh b/tests-ng/global-compare-ignore.sh index e2aec69..93723a0 100755 --- a/tests-ng/global-compare-ignore.sh +++ b/tests-ng/global-compare-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/global-update-ignore.sh b/tests-ng/global-update-ignore.sh index 74502cc..06cd0e6 100755 --- a/tests-ng/global-update-ignore.sh +++ b/tests-ng/global-update-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/globs.sh b/tests-ng/globs.sh index a2673ee..f6b068c 100755 --- a/tests-ng/globs.sh +++ b/tests-ng/globs.sh @@ -10,10 +10,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/header.sh b/tests-ng/header.sh index f1bdd6f..db8f809 100755 --- a/tests-ng/header.sh +++ b/tests-ng/header.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/helpers b/tests-ng/helpers index c7180da..de35ca0 100644 --- a/tests-ng/helpers +++ b/tests-ng/helpers @@ -6,7 +6,10 @@ # # for i in *.sh; do ./$i >/dev/null 2>&1; find /tmp/ -maxdepth 1 -type f -iname 'tmp*' >> /tmp/$i.log; find /tmp/ -maxdepth 1 -type d -iname 'tmp.*-dotdrop-tests' >> /tmp/$i.log; find /tmp/ -maxdepth 1 -type d -iname 'dotdrop-*' >> /tmp/$i.log; wc -l /tmp/$i.log; [ "`wc -l /tmp/$i.log | awk '{print $1}'`" -gt "0" ] && break; done -declare -a to_be_cleared +set -euo errtrace pipefail + +#declare -a to_be_cleared +to_be_cleared=() # add a file/directory to be cleared # on exit @@ -109,7 +112,8 @@ fi # workdir tricks # when tests are called without using the # top level tests.sh script which sets the workdir -if [ -z "${DOTDROP_WORKDIR}" ]; then +DD_WORKDIR=${DOTDROP_WORKDIR:-} +if [ -z "${DD_WORKDIR}" ]; then _workdir="/tmp/dotdrop-test-workdir" export DOTDROP_WORKDIR="${_workdir}" clear_on_exit "${_workdir}" diff --git a/tests-ng/ignore-empty.sh b/tests-ng/ignore-empty.sh index bf9bbb1..a047d11 100755 --- a/tests-ng/ignore-empty.sh +++ b/tests-ng/ignore-empty.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-as.sh b/tests-ng/import-as.sh index 90fbdad..8b99500 100755 --- a/tests-ng/import-as.sh +++ b/tests-ng/import-as.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-configs.sh b/tests-ng/import-configs.sh index 63510a8..e437743 100755 --- a/tests-ng/import-configs.sh +++ b/tests-ng/import-configs.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-configs2.sh b/tests-ng/import-configs2.sh index 05ffda0..d6fcf79 100755 --- a/tests-ng/import-configs2.sh +++ b/tests-ng/import-configs2.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-duplicate.sh b/tests-ng/import-duplicate.sh index 2480c65..42deb8d 100755 --- a/tests-ng/import-duplicate.sh +++ b/tests-ng/import-duplicate.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-ignore-in-dotpath.sh b/tests-ng/import-ignore-in-dotpath.sh index f29386b..d8005c1 100755 --- a/tests-ng/import-ignore-in-dotpath.sh +++ b/tests-ng/import-ignore-in-dotpath.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-ignore.sh b/tests-ng/import-ignore.sh index 419aa8e..3f7a463 100755 --- a/tests-ng/import-ignore.sh +++ b/tests-ng/import-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-include.sh b/tests-ng/import-include.sh index c9d1b6e..67d2230 100755 --- a/tests-ng/import-include.sh +++ b/tests-ng/import-include.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-link-children.sh b/tests-ng/import-link-children.sh index c928716..abcdb55 100755 --- a/tests-ng/import-link-children.sh +++ b/tests-ng/import-link-children.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-negative-ignore-all-but.sh b/tests-ng/import-negative-ignore-all-but.sh index cb12a72..6408510 100755 --- a/tests-ng/import-negative-ignore-all-but.sh +++ b/tests-ng/import-negative-ignore-all-but.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-negative-ignore.sh b/tests-ng/import-negative-ignore.sh index 9c244be..629b85e 100755 --- a/tests-ng/import-negative-ignore.sh +++ b/tests-ng/import-negative-ignore.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-non-existing.sh b/tests-ng/import-non-existing.sh index 5cf3353..bd5ab3b 100755 --- a/tests-ng/import-non-existing.sh +++ b/tests-ng/import-non-existing.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-profile-dotfiles.sh b/tests-ng/import-profile-dotfiles.sh index c82c03b..46f2bad 100755 --- a/tests-ng/import-profile-dotfiles.sh +++ b/tests-ng/import-profile-dotfiles.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-subfile.sh b/tests-ng/import-subfile.sh index de8c712..71879a7 100755 --- a/tests-ng/import-subfile.sh +++ b/tests-ng/import-subfile.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-to-no-profile.sh b/tests-ng/import-to-no-profile.sh index d474570..309baa3 100755 --- a/tests-ng/import-to-no-profile.sh +++ b/tests-ng/import-to-no-profile.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-variables.sh b/tests-ng/import-variables.sh index 82c2a8d..89f3f3a 100755 --- a/tests-ng/import-variables.sh +++ b/tests-ng/import-variables.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-with-empty.sh b/tests-ng/import-with-empty.sh index fd1467d..aed9a4a 100755 --- a/tests-ng/import-with-empty.sh +++ b/tests-ng/import-with-empty.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import-with-trans.sh b/tests-ng/import-with-trans.sh index df02188..2ff6a0b 100755 --- a/tests-ng/import-with-trans.sh +++ b/tests-ng/import-with-trans.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/import.sh b/tests-ng/import.sh index 902f38f..f480bab 100755 --- a/tests-ng/import.sh +++ b/tests-ng/import.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/imported-configs-variables.sh b/tests-ng/imported-configs-variables.sh index 5b521cd..b28c226 100755 --- a/tests-ng/imported-configs-variables.sh +++ b/tests-ng/imported-configs-variables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/imported-variables-from-config.sh b/tests-ng/imported-variables-from-config.sh index 8d0fe0e..04539e7 100755 --- a/tests-ng/imported-variables-from-config.sh +++ b/tests-ng/imported-variables-from-config.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/include-actions.sh b/tests-ng/include-actions.sh index 610dab1..d9edcfa 100755 --- a/tests-ng/include-actions.sh +++ b/tests-ng/include-actions.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/include-order.sh b/tests-ng/include-order.sh index 6376e8d..490d578 100755 --- a/tests-ng/include-order.sh +++ b/tests-ng/include-order.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/include-variables.sh b/tests-ng/include-variables.sh index a1b63c5..303c011 100755 --- a/tests-ng/include-variables.sh +++ b/tests-ng/include-variables.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/include.sh b/tests-ng/include.sh index c7a0026..dfcc093 100755 --- a/tests-ng/include.sh +++ b/tests-ng/include.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/inst-link-default.sh b/tests-ng/inst-link-default.sh index 853e984..8f7a9f5 100755 --- a/tests-ng/inst-link-default.sh +++ b/tests-ng/inst-link-default.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-empty.sh b/tests-ng/install-empty.sh index eed41a5..c58b263 100755 --- a/tests-ng/install-empty.sh +++ b/tests-ng/install-empty.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-ignore.sh b/tests-ng/install-ignore.sh index 96fb03f..e10777f 100755 --- a/tests-ng/install-ignore.sh +++ b/tests-ng/install-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-link-children.sh b/tests-ng/install-link-children.sh index 6c59475..5b9aedd 100755 --- a/tests-ng/install-link-children.sh +++ b/tests-ng/install-link-children.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-negative-ignore-all-but.sh b/tests-ng/install-negative-ignore-all-but.sh index dd224f6..8498303 100755 --- a/tests-ng/install-negative-ignore-all-but.sh +++ b/tests-ng/install-negative-ignore-all-but.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-negative-ignore-no-match.sh b/tests-ng/install-negative-ignore-no-match.sh index ac99c22..add5683 100755 --- a/tests-ng/install-negative-ignore-no-match.sh +++ b/tests-ng/install-negative-ignore-no-match.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-negative-ignore.sh b/tests-ng/install-negative-ignore.sh index e6b0d70..91e1b66 100755 --- a/tests-ng/install-negative-ignore.sh +++ b/tests-ng/install-negative-ignore.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install-to-temp.sh b/tests-ng/install-to-temp.sh index 61b106c..542d1a9 100755 --- a/tests-ng/install-to-temp.sh +++ b/tests-ng/install-to-temp.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/install.sh b/tests-ng/install.sh index 9a39185..f367cb6 100755 --- a/tests-ng/install.sh +++ b/tests-ng/install.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/jhelpers.sh b/tests-ng/jhelpers.sh index e5b2097..d2ced8a 100755 --- a/tests-ng/jhelpers.sh +++ b/tests-ng/jhelpers.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/key-prefix-sep.sh b/tests-ng/key-prefix-sep.sh index 2bd288a..bbbcd9d 100755 --- a/tests-ng/key-prefix-sep.sh +++ b/tests-ng/key-prefix-sep.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/link-import-default.sh b/tests-ng/link-import-default.sh index 19981c4..8c57bc0 100755 --- a/tests-ng/link-import-default.sh +++ b/tests-ng/link-import-default.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/link-templates-dir-home.sh b/tests-ng/link-templates-dir-home.sh index d6ea82f..87743fe 100755 --- a/tests-ng/link-templates-dir-home.sh +++ b/tests-ng/link-templates-dir-home.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/link-templates-dir.sh b/tests-ng/link-templates-dir.sh index a879a13..7adc5d1 100755 --- a/tests-ng/link-templates-dir.sh +++ b/tests-ng/link-templates-dir.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/link-templates.sh b/tests-ng/link-templates.sh index 9f12361..6107138 100755 --- a/tests-ng/link-templates.sh +++ b/tests-ng/link-templates.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/link-value-tests.sh b/tests-ng/link-value-tests.sh index 3f748e5..5b6a5fc 100755 --- a/tests-ng/link-value-tests.sh +++ b/tests-ng/link-value-tests.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/macro-with-globals.sh b/tests-ng/macro-with-globals.sh index 496bfc0..e301a78 100755 --- a/tests-ng/macro-with-globals.sh +++ b/tests-ng/macro-with-globals.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/minversion.sh b/tests-ng/minversion.sh index 0be1fd3..ae4f939 100755 --- a/tests-ng/minversion.sh +++ b/tests-ng/minversion.sh @@ -5,10 +5,11 @@ # test minversion ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/misc.sh b/tests-ng/misc.sh index abcee95..e1017ab 100755 --- a/tests-ng/misc.sh +++ b/tests-ng/misc.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/notemplate.sh b/tests-ng/notemplate.sh index 6490064..2f055d8 100755 --- a/tests-ng/notemplate.sh +++ b/tests-ng/notemplate.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/profile-actions.sh b/tests-ng/profile-actions.sh index bb4e737..0151fc3 100755 --- a/tests-ng/profile-actions.sh +++ b/tests-ng/profile-actions.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/profile-dyninclude.sh b/tests-ng/profile-dyninclude.sh index a9f11d3..b3a13cc 100755 --- a/tests-ng/profile-dyninclude.sh +++ b/tests-ng/profile-dyninclude.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/profile-dynvariables.sh b/tests-ng/profile-dynvariables.sh index 7ba59b4..06fbe00 100755 --- a/tests-ng/profile-dynvariables.sh +++ b/tests-ng/profile-dynvariables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ @@ -40,12 +41,12 @@ clear_on_exit "${tmpd}" export TESTENV="this is my global testenv" scr=$(mktemp --suffix='-dotdrop-tests' || mktemp -d) chmod +x "${scr}" -echo -e "#!/bin/bash\necho $TESTENV\n" >> "${scr}" +echo -e "#!/usr/bin/env bash\necho $TESTENV\n" >> "${scr}" export TESTENV2="this is my profile testenv" scr2=$(mktemp --suffix='-dotdrop-tests' || mktemp -d) chmod +x "${scr2}" -echo -e "#!/bin/bash\necho $TESTENV2\n" >> "${scr2}" +echo -e "#!/usr/bin/env bash\necho $TESTENV2\n" >> "${scr2}" clear_on_exit "${scr}" clear_on_exit "${scr2}" diff --git a/tests-ng/profile-import-dotfiles.sh b/tests-ng/profile-import-dotfiles.sh index fececb5..00d0ea9 100755 --- a/tests-ng/profile-import-dotfiles.sh +++ b/tests-ng/profile-import-dotfiles.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/profile-undefined-variables.sh b/tests-ng/profile-undefined-variables.sh index 7aac93e..f233bd3 100755 --- a/tests-ng/profile-undefined-variables.sh +++ b/tests-ng/profile-undefined-variables.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/re-import.sh b/tests-ng/re-import.sh index e452acf..d6cd27c 100755 --- a/tests-ng/re-import.sh +++ b/tests-ng/re-import.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/recinclude.sh b/tests-ng/recinclude.sh index b49772d..56cbde9 100755 --- a/tests-ng/recinclude.sh +++ b/tests-ng/recinclude.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/recvariables.sh b/tests-ng/recvariables.sh index dc50165..86ed3d0 100755 --- a/tests-ng/recvariables.sh +++ b/tests-ng/recvariables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/remove.sh b/tests-ng/remove.sh index cd18ffd..de49065 100755 --- a/tests-ng/remove.sh +++ b/tests-ng/remove.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/symlink-relative.sh b/tests-ng/symlink-relative.sh index 3c9e282..c7ec5f7 100755 --- a/tests-ng/symlink-relative.sh +++ b/tests-ng/symlink-relative.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/symlink.sh b/tests-ng/symlink.sh index 7ebd22b..90f2159 100755 --- a/tests-ng/symlink.sh +++ b/tests-ng/symlink.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/template-dotpath.sh b/tests-ng/template-dotpath.sh index 67691db..c1fd25b 100755 --- a/tests-ng/template-dotpath.sh +++ b/tests-ng/template-dotpath.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/template-link-value.sh b/tests-ng/template-link-value.sh index 06e10ff..8acffe1 100755 --- a/tests-ng/template-link-value.sh +++ b/tests-ng/template-link-value.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/template-link.sh b/tests-ng/template-link.sh index ac724ad..67dfa5d 100755 --- a/tests-ng/template-link.sh +++ b/tests-ng/template-link.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/template-vars-dict.sh b/tests-ng/template-vars-dict.sh index 09360ba..5d41f7e 100755 --- a/tests-ng/template-vars-dict.sh +++ b/tests-ng/template-vars-dict.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/tests_launcher.py b/tests-ng/tests_launcher.py index 6db2b55..8d75d6b 100755 --- a/tests-ng/tests_launcher.py +++ b/tests-ng/tests_launcher.py @@ -72,7 +72,7 @@ def run_tests(max_jobs=None, stop_on_first_err=True, with_spinner=True): print(f'stop on first error: {stop_on_first_err}') print(f'use spinner: {with_spinner}') tests = get_tests() - print(f'running {len(tests)} test(s)\n') + print(f'running {len(tests)} test script(s)\n') print() failed = 0 diff --git a/tests-ng/toml.sh b/tests-ng/toml.sh index 952017b..f7e3146 100755 --- a/tests-ng/toml.sh +++ b/tests-ng/toml.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/transformations-template.sh b/tests-ng/transformations-template.sh index d670773..6fcada6 100755 --- a/tests-ng/transformations-template.sh +++ b/tests-ng/transformations-template.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/transformations-with-args.sh b/tests-ng/transformations-with-args.sh index 55ee368..694ba85 100755 --- a/tests-ng/transformations-with-args.sh +++ b/tests-ng/transformations-with-args.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/transformations.sh b/tests-ng/transformations.sh index 1f9c5a8..0d9009c 100755 --- a/tests-ng/transformations.sh +++ b/tests-ng/transformations.sh @@ -8,10 +8,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-global-negative-ignore.sh b/tests-ng/update-global-negative-ignore.sh index 83cdb7c..e8281cc 100755 --- a/tests-ng/update-global-negative-ignore.sh +++ b/tests-ng/update-global-negative-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-ignore-in-dotpath.sh b/tests-ng/update-ignore-in-dotpath.sh index 8c4f56f..d647570 100755 --- a/tests-ng/update-ignore-in-dotpath.sh +++ b/tests-ng/update-ignore-in-dotpath.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-ignore-missing.sh b/tests-ng/update-ignore-missing.sh index 4d346a2..151ba78 100755 --- a/tests-ng/update-ignore-missing.sh +++ b/tests-ng/update-ignore-missing.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-ignore-relative.sh b/tests-ng/update-ignore-relative.sh index 1aa0489..91bfbaf 100755 --- a/tests-ng/update-ignore-relative.sh +++ b/tests-ng/update-ignore-relative.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-ignore.sh b/tests-ng/update-ignore.sh index d5ba2cd..0241eff 100755 --- a/tests-ng/update-ignore.sh +++ b/tests-ng/update-ignore.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-negative-ignore-all-but.sh b/tests-ng/update-negative-ignore-all-but.sh index dc0e3fe..d378bef 100755 --- a/tests-ng/update-negative-ignore-all-but.sh +++ b/tests-ng/update-negative-ignore-all-but.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-negative-ignore-relative.sh b/tests-ng/update-negative-ignore-relative.sh index 85ab90e..5df554e 100755 --- a/tests-ng/update-negative-ignore-relative.sh +++ b/tests-ng/update-negative-ignore-relative.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-negative-ignore.sh b/tests-ng/update-negative-ignore.sh index d581716..462de55 100755 --- a/tests-ng/update-negative-ignore.sh +++ b/tests-ng/update-negative-ignore.sh @@ -6,10 +6,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-profile-check.sh b/tests-ng/update-profile-check.sh index 01f6f44..1e6f03c 100755 --- a/tests-ng/update-profile-check.sh +++ b/tests-ng/update-profile-check.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-rights.sh b/tests-ng/update-rights.sh index ca7bad7..3cb1858 100755 --- a/tests-ng/update-rights.sh +++ b/tests-ng/update-rights.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-templates.sh b/tests-ng/update-templates.sh index 7c21936..6730f05 100755 --- a/tests-ng/update-templates.sh +++ b/tests-ng/update-templates.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update-with-key.sh b/tests-ng/update-with-key.sh index 7d92890..e290015 100755 --- a/tests-ng/update-with-key.sh +++ b/tests-ng/update-with-key.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/update.sh b/tests-ng/update.sh index 29cc8db..07cc9d7 100755 --- a/tests-ng/update.sh +++ b/tests-ng/update.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/uservariables.sh b/tests-ng/uservariables.sh index 4f33564..6c8abfa 100755 --- a/tests-ng/uservariables.sh +++ b/tests-ng/uservariables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/variables-enrich.sh b/tests-ng/variables-enrich.sh index 3d9edbe..dd023fa 100755 --- a/tests-ng/variables-enrich.sh +++ b/tests-ng/variables-enrich.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/variables-include.sh b/tests-ng/variables-include.sh index ab34c04..4860ad2 100755 --- a/tests-ng/variables-include.sh +++ b/tests-ng/variables-include.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/variables-nested.sh b/tests-ng/variables-nested.sh index cbf78ba..3768e66 100755 --- a/tests-ng/variables-nested.sh +++ b/tests-ng/variables-nested.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/variables.sh b/tests-ng/variables.sh index 1000be7..39b51b7 100755 --- a/tests-ng/variables.sh +++ b/tests-ng/variables.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/workdir-compare.sh b/tests-ng/workdir-compare.sh index e6605e1..be2b578 100755 --- a/tests-ng/workdir-compare.sh +++ b/tests-ng/workdir-compare.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests-ng/workdir.sh b/tests-ng/workdir.sh index 70af235..ac4dc1b 100755 --- a/tests-ng/workdir.sh +++ b/tests-ng/workdir.sh @@ -7,10 +7,11 @@ # ## start-cookie -set -e +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) ddpath="${cur}/../" -export PYTHONPATH="${ddpath}:${PYTHONPATH}" +PPATH="{PYTHONPATH:-}" +export PYTHONPATH="${ddpath}:${PPATH}" altbin="python3 -m dotdrop.dotdrop" if hash coverage 2>/dev/null; then mkdir -p coverages/ diff --git a/tests.sh b/tests.sh index 532ec65..69144de 100755 --- a/tests.sh +++ b/tests.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/usr/bin/env bash # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2017, deadc0de6 # stop on first error -#set -ev -set -e +#set -euo errtrace pipefailv +set -euo errtrace pipefail cur=$(cd "$(dirname "${0}")" && pwd) @@ -24,10 +24,6 @@ python3 --version echo "checking syntax..." "${cur}"/scripts/check-syntax.sh -# test doc -echo "checking documentation..." -"${cur}"/scripts/check-doc.sh - # unittest echo "unittest..." "${cur}"/scripts/check-unittests.sh @@ -39,5 +35,9 @@ echo "tests-ng..." # merge coverage coverage combine coverages/* +# test doc +echo "checking documentation..." +"${cur}"/scripts/check-doc.sh + ## done echo "All tests finished successfully"