3 # It returns 1 in case of errors, and no tests should be run then!
5 # Ensure we have our mocked out AUTOENV_ENV_FILENAME
8 # Treat unset variables as errors.
9 # Not handled in varstash yet.
12 if [[ $AUTOENV_ENV_FILENAME[0,4] != '/tmp' ]]; then
13 echo "AUTOENV_ENV_FILENAME is not in /tmp. Aborting."
17 # Abort this setup script on any error.
18 _save_errexit=${options[errexit]}
21 export TEST_AUTOENV_PLUGIN_FILE="$TESTDIR/../autoenv.plugin.zsh"
22 source $TEST_AUTOENV_PLUGIN_FILE
24 # Reset any authentication.
25 echo -n >| $AUTOENV_ENV_FILENAME
27 # Add file $1 (with optional hash $2) to authentication file.
28 test_autoenv_add_to_env() {
29 _autoenv_hash_pair $1 ${2:-} >>| $AUTOENV_ENV_FILENAME
32 # Add enter and leave env files to authentication file.
33 test_autoenv_auth_env_files() {
34 test_autoenv_add_to_env $PWD/$AUTOENV_FILE_ENTER
35 test_autoenv_add_to_env $PWD/$AUTOENV_FILE_LEAVE
38 # Now keep on going on errors again.
39 options[errexit]=$_save_errexit