make sure the test shows any garbage output.
[xfstests-dev.git] / 040
1 #! /bin/sh
2 # FS QA Test No. 040
3 #
4 # srcdiff test
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=nathans@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20
21 # get standard environment, filters and checks
22 . ./common.rc
23 . ./common.filter
24
25 [ -z "$KWORKAREA" ] && \
26         _notrun "Can't run srcdiff without KWORKAREA set"
27 [ -d "$KWORKAREA/fs/xfs" ] || \
28         _notrun "Can't find XFS source under \"$KWORKAREA\""
29
30 [ -z "$WORKAREA" ] && \
31         _notrun "Can't run srcdiff without WORKAREA set"
32 [ -f "$WORKAREA/xfstests/tools/srcdiff" ] || \
33         _notrun "Can't find srcdiff tool under \"$WORKAREA\""
34 [ -d "$WORKAREA/xfsprogs/include" ] || \
35         _notrun "Can't find XFS command headers under \"$WORKAREA\""
36
37 # real QA test starts here
38 cd "$WORKAREA/xfstests"
39 echo Silence is golden.
40 perl tools/srcdiff -q >$seq.full
41 if ! diff $seq.full $seq.good >/dev/null; then
42     echo "FAILED: srcdiff output $seq.full differs to $seq.good"
43     exit 1
44 fi
45
46 # success, all done
47 status=0
48 exit