mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-17 15:01:40 +02:00
Revise zmodload -u test.
This commit is contained in:
parent
b5ad8bf0de
commit
f73dc99e08
2 changed files with 33 additions and 12 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2001-05-23 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 14461: Test/V01zmodload.ztst: Change the unloading test to be
|
||||||
|
sure that modules are not unloaded until their dependencies have
|
||||||
|
been unloaded.
|
||||||
|
|
||||||
2001-05-23 Oliver Kiddle <opk@zsh.org>
|
2001-05-23 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
* unposted: Src/signals.c, Src/utils.c: add missing mod_exports
|
* unposted: Src/signals.c, Src/utils.c: add missing mod_exports
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
# the config.modules file. This differs for static vs. dynamic builds.
|
# the config.modules file. This differs for static vs. dynamic builds.
|
||||||
|
|
||||||
mods=()
|
mods=()
|
||||||
|
deps="$(zmodload -Ld)"
|
||||||
while read name modfile link auto load funcs
|
while read name modfile link auto load funcs
|
||||||
do
|
do
|
||||||
[[ $name == \#* ]] && continue
|
[[ $name == \#* ]] && continue
|
||||||
|
@ -13,6 +14,27 @@
|
||||||
mods=($mods $name)
|
mods=($mods $name)
|
||||||
done < $ZTST_testdir/../config.modules
|
done < $ZTST_testdir/../config.modules
|
||||||
|
|
||||||
|
zmodunload() {
|
||||||
|
local m n=$#
|
||||||
|
(( n == 0 )) && return 0
|
||||||
|
for m
|
||||||
|
do
|
||||||
|
if [[ -z ${(M)${(f)"$(zmodload -d)"}:#*:* $m( *|)} ]]
|
||||||
|
then
|
||||||
|
zmodload -u $m && zmodload -ud $m || return 1
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
set $@[2,-1] $m
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if (( $# < n ))
|
||||||
|
then
|
||||||
|
zmodunload $*
|
||||||
|
else
|
||||||
|
zmodload -u $*
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
%test
|
%test
|
||||||
|
|
||||||
# This first test depends on knowing that zsh is run with +Z from the
|
# This first test depends on knowing that zsh is run with +Z from the
|
||||||
|
@ -125,22 +147,15 @@
|
||||||
zmodload -e example
|
zmodload -e example
|
||||||
1:Delete the module alias again
|
1:Delete the module alias again
|
||||||
|
|
||||||
# Remove all inter-module dependencies so that we can unload in any order.
|
# Don't unload the two modules that are required by the test system!
|
||||||
# Skip the two modules that are required by the test system!
|
|
||||||
|
|
||||||
mods[(r)zsh/main]=()
|
mods[(r)zsh/main]=()
|
||||||
mods[(r)zsh/parameter]=()
|
mods[(r)zsh/parameter]=()
|
||||||
for m in $mods
|
zmodunload $mods
|
||||||
do
|
|
||||||
zmodload -ud $m
|
|
||||||
done
|
|
||||||
0d:Remove module dependecies
|
|
||||||
|
|
||||||
# Unload all the modules again (except the two we skipped, of course).
|
|
||||||
|
|
||||||
zmodload -u $mods
|
|
||||||
0d:Unload the modules loaded by this test suite
|
0d:Unload the modules loaded by this test suite
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
|
|
||||||
unset name modfile link auto load funcs mods m
|
eval "$deps"
|
||||||
|
unset deps name modfile link auto load funcs mods
|
||||||
|
unfunction zmodunload
|
||||||
|
|
Loading…
Reference in a new issue