Hi,
i wrote:
> > Assuming variable "xfail" is be set to a non-empty string exactly if
> > argument "--xfail" is given, i'd replace:
> >
> > if [ -z "$debug" ] && [ "${RET:-1}" -eq 0 ]; then
> > rm -rf "$lukstestdir" || :
> > fi
Glenn Washburn wrote:
> RET should never be undefined because $? always has a numerical value.
> And in my change I default xfail to 0. So I change the if statement to:
>
> if [ -z "$debug" ] && [ "$RET" -eq "$xfail" ]; then
>
> This is a lot simpler, though perhaps a tad less clear. Do you see a
> reason why this is less desirable?
If indeed in a successful --xfail test RET must have the value of "$xfail"
(i guess 1), then it is concise and sufficient.
If other non-zero values of RET are acceptable as indication of an
intended failure then your proposal is too sparse.
In this case i would propose to flatly enumerate the two cases which shall
lead to removal of the test data:
if [ -z "$debug" ] && [ "$xfail" -eq 1 ] && [ "$RET" -ne 0 ]; then
rm -rf "$lukstestdir" || :
elif [ -z "$debug" ] && [ "$xfail" -eq 0 ] && [ "$RET" -eq 0 ]; then
rm -rf "$lukstestdir" || :
fi
Have a nice day :)
Thomas
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel