1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
#! /bin/sh
# This script was generated automatically by build-script.
case $# in
0) xx='../../src/date';;
*) xx="$1";;
esac
test "$VERBOSE" && echo=echo || echo=:
$echo testing program: $xx
errors=0
test "$srcdir" || srcdir=.
test "$VERBOSE" && $xx --version 2> /dev/null
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%% %a %A %b %B' > t1.out 2> t1.err
code=$?
if test $code != 0 ; then
$echo "Test 1(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1.out $srcdir/t1.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 1(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 1(LANG=C TZ=UTC) failed: files t1.out and $srcdir/t1.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 1(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t1.err || rm -f t1.err
LANG=C TZ=GMT $xx -d '1997-01-19 08:17:48 +0' +'%c' > t2.out 2> t2.err
code=$?
if test $code != 0 ; then
$echo "Test 2(LANG=C TZ=GMT) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2.out $srcdir/t2.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 2(LANG=C TZ=GMT)"; fi ;;
1) $echo "Test 2(LANG=C TZ=GMT) failed: files t2.out and $srcdir/t2.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 2(LANG=C TZ=GMT) may have failed." 1>&2;
$echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t2.err || rm -f t2.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%d_%D_%e_%h_%H' > t3.out 2> t3.err
code=$?
if test $code != 0 ; then
$echo "Test 3(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t3.out $srcdir/t3.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 3(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 3(LANG=C TZ=UTC) failed: files t3.out and $srcdir/t3.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 3(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t3.err || rm -f t3.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%I_%j_%k_%l_%m' > t4.out 2> t4.err
code=$?
if test $code != 0 ; then
$echo "Test 4(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4.out $srcdir/t4.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 4(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 4(LANG=C TZ=UTC) failed: files t4.out and $srcdir/t4.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 4(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t4.err || rm -f t4.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%M_%n_%p_%r' > t5.out 2> t5.err
code=$?
if test $code != 0 ; then
$echo "Test 5(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5.out $srcdir/t5.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 5(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 5(LANG=C TZ=UTC) failed: files t5.out and $srcdir/t5.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 5(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t5.out $srcdir/t5.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t5.err || rm -f t5.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%s_%S_%t_%T' > t6.out 2> t6.err
code=$?
if test $code != 0 ; then
$echo "Test 6(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6.out $srcdir/t6.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 6(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 6(LANG=C TZ=UTC) failed: files t6.out and $srcdir/t6.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 6(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t6.out $srcdir/t6.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t6.err || rm -f t6.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%U_%V_%w_%W' > t7.out 2> t7.err
code=$?
if test $code != 0 ; then
$echo "Test 7(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t7.out $srcdir/t7.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 7(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 7(LANG=C TZ=UTC) failed: files t7.out and $srcdir/t7.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 7(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t7.out $srcdir/t7.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t7.err || rm -f t7.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%x_%X_%y_%Y' > t8.out 2> t8.err
code=$?
if test $code != 0 ; then
$echo "Test 8(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t8.out $srcdir/t8.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 8(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 8(LANG=C TZ=UTC) failed: files t8.out and $srcdir/t8.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 8(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t8.out $srcdir/t8.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t8.err || rm -f t8.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%z_%Z' > t9.out 2> t9.err
code=$?
if test $code != 0 ; then
$echo "Test 9(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t9.out $srcdir/t9.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 9(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 9(LANG=C TZ=UTC) failed: files t9.out and $srcdir/t9.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 9(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t9.out $srcdir/t9.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t9.err || rm -f t9.err
LANG=C TZ=UTC $xx --date '02/29/1996 - 1 year' +%Y-%m-%d > tleap-1.out 2> tleap-1.err
code=$?
if test $code != 0 ; then
$echo "Test leap-1(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tleap-1.out $srcdir/tleap-1.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed leap-1(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test leap-1(LANG=C TZ=UTC) failed: files tleap-1.out and $srcdir/tleap-1.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test leap-1(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp tleap-1.out $srcdir/tleap-1.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tleap-1.err || rm -f tleap-1.err
if test $errors = 0 ; then
$echo Passed all 10 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi
test $errors = 0 || errors=1
exit $errors
|