regress.t revision 169854
1236884Smm#!/bin/sh 2236884Smm# 3236884Smm# $FreeBSD: head/tools/regression/usr.bin/lastcomm/regress.t 169854 2007-05-22 06:21:20Z dds $ 4236884Smm# 5236884Smm 6236884SmmDIR=`dirname $0` 7236884SmmARCH=`uname -m` 8236884Smm 9236884Smmcheck() 10236884Smm{ 11236884Smm NUM=$1 12236884Smm shift 13236884Smm # Remove tty field, which varies between systems. 14236884Smm awk '{$4 = ""; print}' | 15236884Smm if diff -q - $DIR/$1 16236884Smm then 17236884Smm echo "ok $NUM" 18236884Smm else 19236884Smm echo "not ok $NUM" 20236884Smm fi 21236884Smm} 22236884Smm 23236884Smm 24251646Sdelphijcat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >$DIR/v1v2-$ARCH-acct.in 25236884Smmcat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >$DIR/v1v2-$ARCH.out 26236884Smm 27236884Smmecho 1..6 28236884Smm 29236884Smmlastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 v1-$ARCH.out 30236884Smmlastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 v1-$ARCH.out 31236884Smmlastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 v2-$ARCH.out 32236884Smmlastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 v2-$ARCH.out 33236884Smmlastcomm -cesuS -f $DIR/v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out 34236884Smmlastcomm -cesuS -f - <$DIR/v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out 35236884Smm 36236884Smmrm $DIR/v1v2-$ARCH-acct.in 37236884Smmrm $DIR/v1v2-$ARCH.out 38236884Smm 39236884Smmexit 0 40236884Smm