[patch] zip tests
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Tue May 6 22:36:31 UTC 2008
On Tue, 6 May 2008, Denys Vlasenko wrote:
> local xtrace
>
> 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
>
> if $ECHO -ne "$expected" | cmp - t_actual; then
> echo "$1: PASS"
> else
> echo "$1: FAIL"
> fi
>
> I have no idea what this xtrace thing can be.
>
> Why is it needed? Can you explain it in the comment?
As 'set -x' (if used i a script calling function 'testing') writes to
stderr, that may interfere with what's written there.
> +wdir=testdir
>
> -cd testdir || { echo "cannot cd testdir!"; exit 1; }
> +cd $wdir || { echo "cannot cd $wdir!"; exit 1; }
>
> Why is this useful?
It's easier to change the directory in one place, if need be.
> -prep; check "$unpack: doesnt exist" "${bb}$unpack z t1.$ext; echo \$?; cat t1"
> +prep
> +check "$unpack: doesnt exist" "set +e;$bb_app z t1.$ext; echo \$?; cat t1"
>
> The part which splits "command; command" into several lines is ok.
> Do you want to resend it as separate patch?
>
> (If these changes were sent as a few patches instead of all-in-one,
> I would already applied that one)
I'll see what I can do.
> > Adds a new test: zcat.tests.
>
> Depends on compressfuncts.sh. Let's deal with that one first.
I'll get back with that.
Cheers,
--
Cristian
More information about the busybox
mailing list