diff options
author | Jim Meyering <jim@meyering.net> | 1997-02-23 05:47:16 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-02-23 05:47:16 +0000 |
commit | 88c3a362e9eeac58bab5202d71b0e1fdf44508e2 (patch) | |
tree | e982c1fa406023a81bff0bf75406d66af2d9204f /tests/date | |
parent | a4ccff96f9c182ac0061947ecbfb07197d44037a (diff) | |
download | coreutils-88c3a362e9eeac58bab5202d71b0e1fdf44508e2.tar.xz |
.
Diffstat (limited to 'tests/date')
-rw-r--r-- | tests/date/Makefile.am | 7 | ||||
-rw-r--r-- | tests/date/Makefile.in | 7 | ||||
-rwxr-xr-x | tests/date/date-tests | 189 |
3 files changed, 198 insertions, 5 deletions
diff --git a/tests/date/Makefile.am b/tests/date/Makefile.am index c3bab5a65..5f7028ec5 100644 --- a/tests/date/Makefile.am +++ b/tests/date/Makefile.am @@ -5,12 +5,15 @@ x = date explicit = maint_gen = 1.X 2.X 3.X 4.X 5.X 6.X 7.X 8.X 9.X leap-1.X U95-1.X U95-2.X \ U95-3.X U92-1.X U92-2.X U92-3.X V92-1.X V92-2.X V92-3.X W92-1.X W92-2.X \ -W92-3.X millen-1.X +W92-3.X millen-1.X rel-0.X rel-1a.X rel-1b.X rel-2a.X rel-2b.X rel-2c.X \ +rel-2d.X rel-2e.X rel-2f.X rel-2g.X rel-3a.X run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \ 9.E leap-1.O leap-1.E U95-1.O U95-1.E U95-2.O U95-2.E U95-3.O U95-3.E U92-1.O \ U92-1.E U92-2.O U92-2.E U92-3.O U92-3.E V92-1.O V92-1.E V92-2.O V92-2.E \ V92-3.O V92-3.E W92-1.O W92-1.E W92-2.O W92-2.E W92-3.O W92-3.E millen-1.O \ -millen-1.E +millen-1.E rel-0.O rel-0.E rel-1a.O rel-1a.E rel-1b.O rel-1b.E rel-2a.O \ +rel-2a.E rel-2b.O rel-2b.E rel-2c.O rel-2c.E rel-2d.O rel-2d.E rel-2e.O \ +rel-2e.E rel-2f.O rel-2f.E rel-2g.O rel-2g.E rel-3a.O rel-3a.E ##test-files-end EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen) diff --git a/tests/date/Makefile.in b/tests/date/Makefile.in index c6362263d..f9c4cff32 100644 --- a/tests/date/Makefile.in +++ b/tests/date/Makefile.in @@ -47,12 +47,15 @@ x = date explicit = maint_gen = 1.X 2.X 3.X 4.X 5.X 6.X 7.X 8.X 9.X leap-1.X U95-1.X U95-2.X \ U95-3.X U92-1.X U92-2.X U92-3.X V92-1.X V92-2.X V92-3.X W92-1.X W92-2.X \ -W92-3.X millen-1.X +W92-3.X millen-1.X rel-0.X rel-1a.X rel-1b.X rel-2a.X rel-2b.X rel-2c.X \ +rel-2d.X rel-2e.X rel-2f.X rel-2g.X rel-3a.X run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \ 9.E leap-1.O leap-1.E U95-1.O U95-1.E U95-2.O U95-2.E U95-3.O U95-3.E U92-1.O \ U92-1.E U92-2.O U92-2.E U92-3.O U92-3.E V92-1.O V92-1.E V92-2.O V92-2.E \ V92-3.O V92-3.E W92-1.O W92-1.E W92-2.O W92-2.E W92-3.O W92-3.E millen-1.O \ -millen-1.E +millen-1.E rel-0.O rel-0.E rel-1a.O rel-1a.E rel-1b.O rel-1b.E rel-2a.O \ +rel-2a.E rel-2b.O rel-2b.E rel-2c.O rel-2c.E rel-2d.O rel-2d.E rel-2e.O \ +rel-2e.E rel-2f.O rel-2f.E rel-2g.O rel-2g.E rel-3a.O rel-3a.E EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen) noinst_SCRIPTS = $x-tests diff --git a/tests/date/date-tests b/tests/date/date-tests index bc260fc22..eafe69bd0 100755 --- a/tests/date/date-tests +++ b/tests/date/date-tests @@ -400,8 +400,195 @@ else esac fi test -s millen-1.E || rm -f millen-1.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 now' '+%Y-%m-%d %T' > rel-0.O 2> rel-0.E +code=$? +if test $code != 0 ; then + $echo "Test rel-0(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-0.O $srcdir/rel-0.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-0(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-0(LANG=C TZ=UTC) failed: files rel-0.O and $srcdir/rel-0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-0(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-0.O $srcdir/rel-0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-0.E || rm -f rel-0.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 yesterday' '+%Y-%m-%d %T' > rel-1a.O 2> rel-1a.E +code=$? +if test $code != 0 ; then + $echo "Test rel-1a(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-1a.O $srcdir/rel-1a.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-1a(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-1a(LANG=C TZ=UTC) failed: files rel-1a.O and $srcdir/rel-1a.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-1a(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-1a.O $srcdir/rel-1a.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-1a.E || rm -f rel-1a.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 tomorrow' '+%Y-%m-%d %T' > rel-1b.O 2> rel-1b.E +code=$? +if test $code != 0 ; then + $echo "Test rel-1b(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-1b.O $srcdir/rel-1b.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-1b(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-1b(LANG=C TZ=UTC) failed: files rel-1b.O and $srcdir/rel-1b.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-1b(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-1b.O $srcdir/rel-1b.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-1b.E || rm -f rel-1b.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 6 years ago' '+%Y-%m-%d %T' > rel-2a.O 2> rel-2a.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2a(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2a.O $srcdir/rel-2a.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2a(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2a(LANG=C TZ=UTC) failed: files rel-2a.O and $srcdir/rel-2a.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2a(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2a.O $srcdir/rel-2a.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2a.E || rm -f rel-2a.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 7 months ago' '+%Y-%m-%d %T' > rel-2b.O 2> rel-2b.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2b(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2b.O $srcdir/rel-2b.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2b(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2b(LANG=C TZ=UTC) failed: files rel-2b.O and $srcdir/rel-2b.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2b(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2b.O $srcdir/rel-2b.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2b.E || rm -f rel-2b.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 8 weeks ago' '+%Y-%m-%d %T' > rel-2c.O 2> rel-2c.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2c(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2c.O $srcdir/rel-2c.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2c(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2c(LANG=C TZ=UTC) failed: files rel-2c.O and $srcdir/rel-2c.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2c(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2c.O $srcdir/rel-2c.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2c.E || rm -f rel-2c.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 1 day ago' '+%Y-%m-%d %T' > rel-2d.O 2> rel-2d.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2d(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2d.O $srcdir/rel-2d.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2d(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2d(LANG=C TZ=UTC) failed: files rel-2d.O and $srcdir/rel-2d.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2d(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2d.O $srcdir/rel-2d.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2d.E || rm -f rel-2d.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 2 hours ago' '+%Y-%m-%d %T' > rel-2e.O 2> rel-2e.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2e(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2e.O $srcdir/rel-2e.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2e(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2e(LANG=C TZ=UTC) failed: files rel-2e.O and $srcdir/rel-2e.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2e(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2e.O $srcdir/rel-2e.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2e.E || rm -f rel-2e.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 3 minutes ago' '+%Y-%m-%d %T' > rel-2f.O 2> rel-2f.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2f(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2f.O $srcdir/rel-2f.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2f(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2f(LANG=C TZ=UTC) failed: files rel-2f.O and $srcdir/rel-2f.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2f(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2f.O $srcdir/rel-2f.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2f.E || rm -f rel-2f.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 4 seconds ago' '+%Y-%m-%d %T' > rel-2g.O 2> rel-2g.E +code=$? +if test $code != 0 ; then + $echo "Test rel-2g(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-2g.O $srcdir/rel-2g.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-2g(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-2g(LANG=C TZ=UTC) failed: files rel-2g.O and $srcdir/rel-2g.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-2g(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-2g.O $srcdir/rel-2g.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-2g.E || rm -f rel-2g.E +LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0 4 seconds ago' '+%Y-%m-%d %T' > rel-3a.O 2> rel-3a.E +code=$? +if test $code != 0 ; then + $echo "Test rel-3a(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp rel-3a.O $srcdir/rel-3a.X + case $? in + 0) if test "$VERBOSE" ; then $echo "passed rel-3a(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test rel-3a(LANG=C TZ=UTC) failed: files rel-3a.O and $srcdir/rel-3a.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test rel-3a(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp rel-3a.O $srcdir/rel-3a.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s rel-3a.E || rm -f rel-3a.E if test $errors = 0 ; then - $echo Passed all 23 tests. 1>&2 + $echo Passed all 34 tests. 1>&2 else $echo Failed $errors tests. 1>&2 fi |