1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-21 15:00:59 +02:00

tests: simplify ZDOTDIR setup, remove base

This makes it easier to run tests without providing ZDOTDIR.
This commit is contained in:
Daniel Hahler 2017-12-15 23:15:00 +01:00 committed by Daniel Hahler
parent 016426207c
commit b92462ff2d
8 changed files with 8 additions and 21 deletions

View File

@ -1,12 +1,12 @@
language: generic
sudo: false
env:
- ZSH=4 ZDOTDIR=tests/ZDOTDIR
- ZSH=4
- ZSH=4 ZDOTDIR=tests/ZDOTDIR.clobber
- ZSH=4 ZDOTDIR=tests/ZDOTDIR.invalid-module_path
- ZSH=4 ZDOTDIR=tests/ZDOTDIR.loadviafunction
- ZSH=5 ZDOTDIR=tests/ZDOTDIR
- ZSH=5
- ZSH=5 ZDOTDIR=tests/ZDOTDIR.clobber
- ZSH=5 ZDOTDIR=tests/ZDOTDIR.invalid-module_path
- ZSH=5 ZDOTDIR=tests/ZDOTDIR.loadviafunction

View File

@ -1,5 +1,5 @@
# Default, can be overridden using "make test ZDOTDIR=...".
ZDOTDIR:=${CURDIR}/tests/ZDOTDIR
# Empty by default, can be overridden using "make test ZDOTDIR=…".
ZDOTDIR:=
# Make it absolute.
override ZDOTDIR:=$(abspath $(ZDOTDIR))

View File

@ -1,4 +1 @@
# Source base setup.
source ${ZDOTDIR}/../ZDOTDIR/.zshenv
setopt noclobber

View File

@ -9,6 +9,3 @@ module_path=(/dev/null)
zstat() {
echo "Should not get called."
}
# Source base setup.
source ${ZDOTDIR}/../ZDOTDIR/.zshenv

View File

@ -1,6 +1,3 @@
# Source base setup.
source ${ZDOTDIR}/../ZDOTDIR/.zshenv
antigen-like-loader-function() {
source "$TESTDIR/../autoenv.plugin.zsh"
}

View File

@ -1,4 +0,0 @@
# Source base setup.
source ${ZDOTDIR}/../ZDOTDIR/.zshenv
setopt shwordsplit

View File

@ -1,3 +0,0 @@
# Base setup/config.
TEST_SOURCE_AUTOENV=(source $TESTDIR/../autoenv.plugin.zsh)

View File

@ -15,7 +15,10 @@ export AUTOENV_AUTH_FILE="$CRAMTMP/autoenv/.autoenv_auth"
_save_errexit=${options[errexit]}
set -e
# Defined in .zshenv, e.g. tests/ZDOTDIR/.zshenv.
# Can be defined in .zshenv, e.g. tests/ZDOTDIR.loadviafunction/.zshenv.
if [[ -z $TEST_SOURCE_AUTOENV ]]; then
TEST_SOURCE_AUTOENV=(source $TESTDIR/../autoenv.plugin.zsh)
fi
$TEST_SOURCE_AUTOENV
# Reset any authentication.