Fix test framework: broken --filter logic

This commit is contained in:
Andrew Bettison 2012-06-28 15:18:48 +09:30
parent 3e92eb6bb8
commit f7483c2c15

View File

@ -989,7 +989,6 @@ _tfw_find_tests() {
_tfw_tests=() _tfw_tests=()
_tfw_shopt -s extdebug _tfw_shopt -s extdebug
local name local name
local filter
for name in $(builtin declare -F | for name in $(builtin declare -F |
sed -n -e '/^declare -f test_./s/^declare -f test_//p' | sed -n -e '/^declare -f test_./s/^declare -f test_//p' |
while read name; do builtin declare -F "test_$name"; done | while read name; do builtin declare -F "test_$name"; done |
@ -999,8 +998,9 @@ _tfw_find_tests() {
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
_tfw_tests+=("$name") _tfw_tests+=("$name")
else else
local filter
for filter; do for filter; do
case "$_tfw_test_name" in case "$name" in
"$filter"*) _tfw_tests+=("$name"); break;; "$filter"*) _tfw_tests+=("$name"); break;;
esac esac
done done