legacy_test.sh revision 169854
1#!/bin/sh 2# 3# $FreeBSD: head/tools/regression/usr.bin/lastcomm/regress.t 169854 2007-05-22 06:21:20Z dds $ 4# 5 6DIR=`dirname $0` 7ARCH=`uname -m` 8 9check() 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 24cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >$DIR/v1v2-$ARCH-acct.in 25cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >$DIR/v1v2-$ARCH.out 26 27echo 1..6 28 29lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 v1-$ARCH.out 30lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 v1-$ARCH.out 31lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 v2-$ARCH.out 32lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 v2-$ARCH.out 33lastcomm -cesuS -f $DIR/v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out 34lastcomm -cesuS -f - <$DIR/v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out 35 36rm $DIR/v1v2-$ARCH-acct.in 37rm $DIR/v1v2-$ARCH.out 38 39exit 0 40