diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-12-17 06:09:46 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-12-17 06:09:46 +0000 |
commit | 90260dbcf4cc718418d84660e26122a2a02db64b (patch) | |
tree | 627c5cc13a58c8cceee04c7c9efd02f7787cf408 /eclass/tests | |
parent | Fixed #395029; removed "die" unneeded in EAPI 4 (diff) | |
download | historical-90260dbcf4cc718418d84660e26122a2a02db64b.tar.gz historical-90260dbcf4cc718418d84660e26122a2a02db64b.tar.bz2 historical-90260dbcf4cc718418d84660e26122a2a02db64b.zip |
extend eshopts test coverage
Diffstat (limited to 'eclass/tests')
-rwxr-xr-x | eclass/tests/eutils:eshopts.sh | 39 | ||||
-rw-r--r-- | eclass/tests/tests-common.sh | 9 |
2 files changed, 43 insertions, 5 deletions
diff --git a/eclass/tests/eutils:eshopts.sh b/eclass/tests/eutils:eshopts.sh index ff9b7d2a140f..65dc89c9f258 100755 --- a/eclass/tests/eutils:eshopts.sh +++ b/eclass/tests/eutils:eshopts.sh @@ -4,8 +4,41 @@ source tests-common.sh inherit eutils -# bug 395025 -eshopts_push -s nullglob -eshopts_pop +test-it() { + local s0 s1 s2 + + tbegin "push/pop '$*'" + s0=$(shopt -p) + t eshopts_push $* + s1=$(shopt -p) + t eshopts_pop + s2=$(shopt -p) + [[ ${s0} == "${s2}" ]] && \ + [[ ${s1} == *"shopt $*"* ]] + tend $? +} + +# should handle bug #395025 +for arg in nullglob dotglob extglob ; do + for flag in s u ; do + test-it -${flag} ${arg} + done +done + +tbegin "multi push/pop" +s0=$(shopt -p) +t eshopts_push -s dotglob +t eshopts_push -u dotglob +t eshopts_push -s extglob +t eshopts_push -u dotglob +t eshopts_push -s dotglob +t eshopts_pop +t eshopts_pop +t eshopts_pop +t eshopts_pop +t eshopts_pop +s1=$(shopt -p) +[[ ${s0} == "${s1}" ]] +tend $? texit diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh index 3b1ffab5d764..c976e29aee56 100644 --- a/eclass/tests/tests-common.sh +++ b/eclass/tests/tests-common.sh @@ -96,6 +96,11 @@ texit() { exit ${tret} } tend() { - eend "$@" - : $(( tret |= $? )) + t eend "$@" +} +t() { + "$@" + local ret=$? + : $(( tret |= ${ret} )) + return ${ret} } |