[patch] zip tests

Paul Smith paul at mad-scientist.us
Tue May 6 22:42:32 UTC 2008


On Wed, 2008-05-07 at 00:36 +0200, Cristian Ionescu-Idbohrn wrote:
> >     xtrace=$(set -o | sed -rne 's/xtrace[[:space:]]+([^[:space:]]+)/\1/p')
> >     [ "$xtrace" = off ] || set +x
> >
> >     eval "$2" >t_actual 2>&1 || {
> >       echo "$1: FAIL (eval)"
> >     }
> >
> >     [ "$xtrace" = off ] || set -x

This seems really heavy-weight to me, especially if it's run once per
test!  Why not something simpler, like:

        case $- in
            *x*) xtrace=true ;;
            *)   xtrace=false ;;
        esac
        
        set +x
        
        eval "$2" >t_actual 2>&1 || {
              echo "$1: FAIL (eval)"
            }
        
        $xtrace && set -x

??




More information about the busybox mailing list