Changeset 1589 for zzuf


Ignore:
Timestamp:
Jan 6, 2007, 10:25:56 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Got testsuite to work on FreeBSD.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/test/testsuite.sh

    r1587 r1589  
    2020    ALIAS="$3"
    2121    echo -n " $(echo "$ALIAS .............." | cut -b1-18) "
    22     NEWMD5="$(eval "$ZZUF $ZZOPTS $CMD" 2>/dev/null | md5sum | cut -b1-32)"
     22    NEWMD5="$(eval "$ZZUF $ZZOPTS $CMD" 2>/dev/null | $MD5PROG | cut -b1-32)"
    2323    if [ -z "$MD5" ]; then
    2424        MD5="$NEWMD5"
     
    2626    elif [ "$NEWMD5" != "$MD5" ]; then
    2727        OK=0
    28         echo "$NEWMD5"
     28        echo "$NEWMD5 FAILED"
    2929    else
    30         echo ' ...'
     30        echo 'ok'
    3131    fi
    3232}
     
    3737        rm -f /tmp/zzuf-random-$$
    3838        rm -f /tmp/zzuf-text-$$
    39         echo "Temporary files removed."
     39        echo "*** temporary files removed ***"
    4040    else
    41         echo "Files preserved:"
    42         echo "  /tmp/zzuf-zero-$$"
    43         echo "  /tmp/zzuf-random-$$"
    44         echo "  /tmp/zzuf-text-$$"
     41        echo "*** files preserved ***"
     42        echo " /tmp/zzuf-zero-$$"
     43        echo " /tmp/zzuf-random-$$"
     44        echo " /tmp/zzuf-text-$$"
    4545    fi
    4646}
    4747
    48 trap "echo ''; echo ''; echo 'Aborted.'; cleanup; exit 0" 1 2 15
     48trap "echo ''; echo '*** ABORTED ***'; cleanup; exit 0" 1 2 15
    4949
    5050seed=$((0$1))
     
    5252FDCAT="$(dirname "$0")/fdcat"
    5353STREAMCAT="$(dirname "$0")/streamcat"
     54if md5sum --help >/dev/null 2>&1; then
     55  MD5PROG=md5sum
     56elif md5 --help >/dev/null 2>&1; then
     57  MD5PROG=md5
     58else
     59  echo "error: no md5 program found (tried: md5sum, md5)"
     60  exit 1
     61fi
     62if [ ! -f "$FDCAT" -o ! -f "$STREAMCAT" ]; then
     63  echo "error: test/fdcat or test/streamcat are missing"
     64fi
    5465FAILED=0
    5566TESTED=0
     
    5970create
    6071echo "*** using seed $seed ***"
    61 echo ""
    6272
    6373for r in 0.000000 0.00001 0.0001 0.001 0.01 0.1 1.0 10.0; do
     
    100110        fi
    101111        TESTED=$(($TESTED + 1))
    102         echo ""
    103112    done
    104113done
Note: See TracChangeset for help on using the changeset viewer.