]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/usr.bin/lastcomm/regress.t
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / usr.bin / lastcomm / regress.t
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 DIR=`dirname $0`
7 ARCH=`uname -m`
8
9 check()
10 {
11         NUM=$1
12         shift
13         # Remove tty field, which varies between systems.
14         awk '{$4 = ""; print}' |
15         if diff -q - $DIR/$1
16         then
17                 echo "ok $NUM"
18         else
19                 echo "not ok $NUM"
20         fi
21 }
22
23
24 cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >$DIR/v1v2-$ARCH-acct.in
25 cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >$DIR/v1v2-$ARCH.out
26
27 echo 1..6
28
29 lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 v1-$ARCH.out
30 lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 v1-$ARCH.out
31 lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 v2-$ARCH.out
32 lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 v2-$ARCH.out
33 lastcomm -cesuS -f $DIR/v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out
34 lastcomm -cesuS -f - <$DIR/v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out
35
36 rm $DIR/v1v2-$ARCH-acct.in
37 rm $DIR/v1v2-$ARCH.out
38
39 exit 0