From: Mark Wooding Date: Sun, 23 Jun 2013 11:40:20 +0000 (+0100) Subject: sys/mdup-test.sh: Remove obsolete test script. X-Git-Tag: 2.2.1~1 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/commitdiff_plain/359c2d60f7c086e7590e3cff5254cd1d50252576?ds=sidebyside sys/mdup-test.sh: Remove obsolete test script. --- diff --git a/sys/mdup-test.sh b/sys/mdup-test.sh deleted file mode 100755 index 1b34916..0000000 --- a/sys/mdup-test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh - -set -e -: ${test=./mdup.t} -cases= - -###-------------------------------------------------------------------------- -### Set up the test cases. -### -### The mdup-test program takes a command-line representation of an mdup_fd -### array, calls mdup, and checks the result. In particular, it ensures that -### the file descriptors returned are the ones asked for, and that the -### resulting file descriptors actually correspond to the requested files. -### (It does the latter by comparing inodes before and after.) - -## Very simple tests. -cases="$cases 3:4" -cases="$cases 4:3" - -## Overlapping sources and destinations. -cases="$cases 4:3,3:5,5:6" - -## Repeated sources. -cases="$cases 3:4,3:3,3:-1" -cases="$cases 5:8,3:4,3:5,4:6" - -## Cycles. -cases="$cases 5:7,3:4,3:5,4:6,5:3" -cases="$cases 5:8,3:4,3:5,4:6,5:3" - -###-------------------------------------------------------------------------- -### Actually run the tests. - -## Initialize counters. -win=0 -lose=0 -total=0 - -## Run the tests. -for case in $cases; do - total=$(expr $total + 1) - case=$(echo "$case" | sed 'y/,/ /') - printf "%d: %-60s " $total "$case" - if $test $case >mdup.$total.out 2>mdup.$total.err; then - echo "ok" - win=$(expr $win + 1) - rm mdup.$total.out mdup.$total.err - else - echo "FAIL" - lose=$(expr $lose + 1) - fi -done - -## Announce the outcome. -if [ $win = $total ]; then - echo "All $total tests successful." - rc=0 -else - echo "FAILED $lose of $total tests." - rc=1 -fi - -## And exit. -exit $rc - -###----- That's all, folks --------------------------------------------------