Changeset 1625


Ignore:
Timestamp:
Jan 8, 2007, 7:15:49 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Test suite now uses the new MD5 feature.
File:
1 edited

Legend:

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

    r1616 r1625  
    2020    ALIAS="$3"
    2121    echo -n " $(echo "$ALIAS .............." | cut -b1-18) "
    22     NEWMD5="$(eval "$ZZUF $ZZOPTS $CMD" 2>/dev/null | $MD5PROG | cut -b1-32)"
    23     if [ -z "$MD5" ]; then
    24         MD5="$NEWMD5"
    25         echo "$NEWMD5"
    26     elif [ "$NEWMD5" != "$MD5" ]; then
    27         OK=0
    28         echo "$NEWMD5 FAILED"
     22    MD5="$(eval "$ZZUF -M $ZZOPTS $CMD" 2>/dev/null | cut -f2 -d' ')"
     23    if [ -z "$REFMD5" ]; then
     24        REFMD5="$MD5"
     25        echo "$MD5"
    2926    else
    30         echo 'ok'
     27        TESTED=$(($TESTED + 1))
     28        if [ "$MD5" != "$REFMD5" ]; then
     29            FAILED=$(($FAILED + 1))
     30            echo "$MD5 FAILED"
     31        else
     32            echo 'ok'
     33        fi
    3134    fi
    3235}
     
    5255FDCAT="$(dirname "$0")/fdcat"
    5356STREAMCAT="$(dirname "$0")/streamcat"
    54 if md5sum /dev/null >/dev/null 2>&1; then
    55   MD5PROG=md5sum
    56 elif md5 /dev/null >/dev/null 2>&1; then
    57   MD5PROG=md5
    58 else
    59   echo "error: no md5 program found (tried: md5sum, md5)"
    60   exit 1
    61 fi
    6257if [ ! -f "$FDCAT" -o ! -f "$STREAMCAT" ]; then
    6358  echo "error: test/fdcat or test/streamcat are missing"
     
    8580        esac
    8681        echo "*** file $file, ratio $r ***"
    87         OK=1
    88         MD5=""
     82        REFMD5=""
    8983        check "$ZZOPTS" "< $file" "zzuf"
    9084        check "$ZZOPTS" "$FDCAT $file" "fdcat"
     
    119113            ;;
    120114        esac
    121         if [ "$OK" != 1 ]; then
    122             echo "*** FAILED ***"
    123             FAILED=$(($FAILED + 1))
    124         fi
    125         TESTED=$(($TESTED + 1))
    126115    done
    127116done
Note: See TracChangeset for help on using the changeset viewer.