3 # It returns 1 in case of errors, and no tests should be run then!
5 # Ensure we have our mocked out AUTOENV_AUTH_FILE
8 # Treat unset variables as errors.
9 # Not handled in varstash yet.
12 export AUTOENV_AUTH_FILE="$CRAMTMP/autoenv/.autoenv_auth"
14 if [[ $AUTOENV_AUTH_FILE[0,4] != '/tmp' ]]; then
15 echo "AUTOENV_AUTH_FILE is not in /tmp. Aborting."
19 # Abort this setup script on any error.
20 _save_errexit=${options[errexit]}
23 # Defined in .zshenv, e.g. tests/ZDOTDIR/.zshenv.
26 # Reset any authentication.
27 if [[ -f $AUTOENV_AUTH_FILE ]]; then
28 echo -n >| $AUTOENV_AUTH_FILE
31 # Add file ($1), version ($2), and optional hash ($3) to authentication file.
32 test_autoenv_add_to_env() {
33 _autoenv_hash_pair $1 1 ${2:-} >>| $AUTOENV_AUTH_FILE
36 # Add enter and leave env files to authentication file.
37 test_autoenv_auth_env_files() {
39 test_autoenv_add_to_env $dir/$AUTOENV_FILE_ENTER
40 test_autoenv_add_to_env $dir/$AUTOENV_FILE_LEAVE
43 # Now keep on going on errors again.
44 options[errexit]=$_save_errexit