mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2024-11-22 07:20:59 +02:00
tests: cleanup test_full (#86)
Changes tests/varstash_export.t to use `$TESTSHELL` provided by cram.
This commit is contained in:
parent
76e387c766
commit
f9112d7459
9
Makefile
9
Makefile
@ -13,15 +13,12 @@ itest:
|
|||||||
|
|
||||||
# Run tests with all ZDOTDIRs.
|
# Run tests with all ZDOTDIRs.
|
||||||
test_full:
|
test_full:
|
||||||
for zsh in zsh /opt/zsh-4.3.9/bin/zsh; do \
|
@ret=0; \
|
||||||
command -v $$zsh || { echo "Skipping non-existing shell: $$zsh"; continue; }; \
|
|
||||||
ret=0; \
|
|
||||||
for i in $(wildcard tests/ZDOTDIR*); do \
|
for i in $(wildcard tests/ZDOTDIR*); do \
|
||||||
echo "zsh=$zsh ZDOTDIR=$$i"; \
|
echo "TEST_SHELL=$(TEST_SHELL) ZDOTDIR=$$i"; \
|
||||||
SHELL=$$zsh ZDOTDIR=${CURDIR}/$$i cram --shell=$$zsh -v tests || ret=$$?; \
|
ZDOTDIR=${CURDIR}/$$i cram --shell=$(TEST_SHELL) -v tests || ret=$$?; \
|
||||||
echo; \
|
echo; \
|
||||||
done; \
|
done; \
|
||||||
done; \
|
|
||||||
exit $$ret
|
exit $$ret
|
||||||
|
|
||||||
# Define targets for test files, with relative and abolute path.
|
# Define targets for test files, with relative and abolute path.
|
||||||
|
@ -29,20 +29,20 @@ Activating the env stashes it and applies a new value.
|
|||||||
|
|
||||||
The variable is not available in a subshell, only the exported one.
|
The variable is not available in a subshell, only the exported one.
|
||||||
|
|
||||||
$ $SHELL -c 'echo ${MYVAR:-empty}; echo $MYEXPORT'
|
$ $TESTSHELL -c 'echo ${MYVAR:-empty}; echo $MYEXPORT'
|
||||||
empty
|
empty
|
||||||
changed_export
|
changed_export
|
||||||
|
|
||||||
Activate autoenv in the subshell.
|
Activate autoenv in the subshell.
|
||||||
|
|
||||||
$ $SHELL -c "$TEST_SOURCE_AUTOENV; echo \${MYVAR}; echo \$MYEXPORT"
|
$ $TESTSHELL -c "$TEST_SOURCE_AUTOENV; echo \${MYVAR}; echo \$MYEXPORT"
|
||||||
ENTER
|
ENTER
|
||||||
changed
|
changed
|
||||||
changed_export
|
changed_export
|
||||||
|
|
||||||
"autounstash" should handle the exported variables.
|
"autounstash" should handle the exported variables.
|
||||||
|
|
||||||
$ $SHELL -c "$TEST_SOURCE_AUTOENV; cd ..; echo \${MYVAR:-empty}; echo \$MYEXPORT"
|
$ $TESTSHELL -c "$TEST_SOURCE_AUTOENV; cd ..; echo \${MYVAR:-empty}; echo \$MYEXPORT"
|
||||||
ENTER
|
ENTER
|
||||||
LEAVE
|
LEAVE
|
||||||
empty
|
empty
|
||||||
|
Loading…
Reference in New Issue
Block a user