Changeset 1526 for zzuf/trunk/test


Ignore:
Timestamp:
Dec 29, 2006, 6:22:11 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Added the -i flag (for stdin fuzzing).
File:
1 edited

Legend:

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

    r1521 r1526  
    3535        rm -f /tmp/zzuf-random-$$
    3636        rm -f /tmp/zzuf-text-$$
     37        echo "Temporary files removed."
     38    else
     39        echo "Files preserved:"
     40        echo "  /tmp/zzuf-zero-$$"
     41        echo "  /tmp/zzuf-random-$$"
     42        echo "  /tmp/zzuf-text-$$"
    3743    fi
    3844}
    3945
    40 trap "echo ''; echo 'Aborted.'; cleanup; exit 0" 1 2 15
     46trap "echo ''; echo ''; echo 'Aborted.'; cleanup; exit 0" 1 2 15
    4147
    4248seed=$(($RANDOM * $$))
     
    5359
    5460for file in /tmp/zzuf-text-$$ /tmp/zzuf-zero-$$ /tmp/zzuf-random-$$; do
    55     for r in 0.0 0.00001 0.0001 0.001 0.01 0.1 1.0 10.0; do
     61    for r in 0.000000 0.00001 0.0001 0.001 0.01 0.1 1.0 10.0; do
    5662        echo "Testing zzuf on $file, ratio $r:"
    5763        OK=1
    5864        MD5=""
    5965        check $seed $r "cat $file" "cat"
    60 # don't do grep, it adds a newline at EOF!
    61 #        check $seed $r "grep -- -a \\'\\' $file" "grep -a"
     66        check $seed $r "cat < $file" "cat stdin"
     67        # We don't include grep in the testsuite because it puts a newline
     68        # at the end of its input if it was not there initially.
     69        #check $seed $r "grep -- -a \\'\\' $file" "grep -a"
    6270        check $seed $r "sed n $file" "sed n"
    6371        check $seed $r "dd bs=65536 if=$file" "dd(bs=65536)"
     
    7583    done
    7684done
    77 cleanup
    7885
    7986if [ "$FAILED" != 0 ]; then
    80     echo "$FAILED tests failed out of $TESTED. Files preserved:"
    81     echo "  /tmp/zzuf-zero-$$"
    82     echo "  /tmp/zzuf-random-$$"
    83     echo "  /tmp/zzuf-text-$$"
     87    echo "$FAILED tests failed out of $TESTED."
     88    cleanup
    8489    exit 1
    8590fi
    8691echo "All $TESTED tests OK."
     92
     93cleanup
    8794exit 0
    8895
Note: See TracChangeset for help on using the changeset viewer.