diff --git a/Makefile b/Makefile index 2c43538e..d02763bc 100644 --- a/Makefile +++ b/Makefile @@ -38,12 +38,14 @@ list: # Set of test- targets; each runs the specified test suites for a single shell. # Note that preexisting NVM_* variables are unset to avoid interfering with tests, except when running the Travis tests (where NVM_DIR must be passed in and the env. is assumed to be pristine). +# NVM_DIR then defaults to this checkout when it is not set, since not every shell can locate a sourced nvm.sh. .PHONY: $(SHELL_TARGETS) $(SHELL_TARGETS): @shell='$@'; shell=$${shell##*-}; \ which "$$shell" >/dev/null || { printf '\033[0;31m%s\033[0m\n' "WARNING: Cannot test with shell '$$shell': not found." >&2; exit 0; } && \ printf '\n\033[0;34m%s\033[0m\n' "Running tests in $$shell"; \ [ -z "$$TRAVIS_BUILD_DIR" ] && [ -z "$$GITHUB_ACTIONS" ] && for v in $$(set | awk -F'=' '$$1 ~ "^NVM_" { print $$1 }'); do unset $$v; done && unset v; \ + [ -n "$${NVM_DIR-}" ] || export NVM_DIR="$$PWD"; \ for suite in $(TEST_SUITE); do \ echo "Running test suite: $$suite"; \ $(URCHIN) -f -s $$shell test/$$suite || exit; \