summaryrefslogtreecommitdiff
path: root/tests/date/date-tests
blob: 28a37ca437fc4d9214d788d7b7466d429885206e (plain)
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
#! /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

# Make sure we get English translations.
LANGUAGE=C
export LANGUAGE
LC_ALL=C
export LC_ALL
LANG=C
export LANG

LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%% %a %A %b %B'  > 1.O 2> 1.E
code=$?
if test $code != 0; then
  $echo "Test 1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 1.O $srcdir/1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 1(LANG=C TZ=UTC0) failed: files 1.O and $srcdir/1.X differ" 1>&2
       (diff -c 1.O $srcdir/1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 1.O $srcdir/1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 1.E || rm -f 1.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%d_%D_%e_%h_%H'  > 3.O 2> 3.E
code=$?
if test $code != 0; then
  $echo "Test 3(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 3.O $srcdir/3.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 3(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 3(LANG=C TZ=UTC0) failed: files 3.O and $srcdir/3.X differ" 1>&2
       (diff -c 3.O $srcdir/3.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 3(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 3.O $srcdir/3.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 3.E || rm -f 3.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%I_%j_%k_%l_%m'  > 4.O 2> 4.E
code=$?
if test $code != 0; then
  $echo "Test 4(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 4.O $srcdir/4.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 4(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 4(LANG=C TZ=UTC0) failed: files 4.O and $srcdir/4.X differ" 1>&2
       (diff -c 4.O $srcdir/4.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 4(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 4.O $srcdir/4.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 4.E || rm -f 4.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%M_%n_%p_%r'  > 5.O 2> 5.E
code=$?
if test $code != 0; then
  $echo "Test 5(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 5.O $srcdir/5.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 5(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 5(LANG=C TZ=UTC0) failed: files 5.O and $srcdir/5.X differ" 1>&2
       (diff -c 5.O $srcdir/5.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 5(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 5.O $srcdir/5.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 5.E || rm -f 5.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%s_%S_%t_%T'  > 6.O 2> 6.E
code=$?
if test $code != 0; then
  $echo "Test 6(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 6.O $srcdir/6.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 6(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 6(LANG=C TZ=UTC0) failed: files 6.O and $srcdir/6.X differ" 1>&2
       (diff -c 6.O $srcdir/6.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 6(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 6.O $srcdir/6.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 6.E || rm -f 6.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%U_%V_%w_%W'  > 7.O 2> 7.E
code=$?
if test $code != 0; then
  $echo "Test 7(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 7.O $srcdir/7.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 7(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 7(LANG=C TZ=UTC0) failed: files 7.O and $srcdir/7.X differ" 1>&2
       (diff -c 7.O $srcdir/7.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 7(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 7.O $srcdir/7.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 7.E || rm -f 7.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%x_%X_%y_%Y'  > 8.O 2> 8.E
code=$?
if test $code != 0; then
  $echo "Test 8(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 8.O $srcdir/8.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 8(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 8(LANG=C TZ=UTC0) failed: files 8.O and $srcdir/8.X differ" 1>&2
       (diff -c 8.O $srcdir/8.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 8(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 8.O $srcdir/8.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 8.E || rm -f 8.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0' +'%z'  > 9.O 2> 9.E
code=$?
if test $code != 0; then
  $echo "Test 9(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp 9.O $srcdir/9.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed 9(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test 9(LANG=C TZ=UTC0) failed: files 9.O and $srcdir/9.X differ" 1>&2
       (diff -c 9.O $srcdir/9.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test 9(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp 9.O $srcdir/9.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s 9.E || rm -f 9.E
LANG=C TZ=UTC0 $xx --date '02/29/1996 1 year' +%Y-%m-%d  > leap-1.O 2> leap-1.E
code=$?
if test $code != 0; then
  $echo "Test leap-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp leap-1.O $srcdir/leap-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed leap-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test leap-1(LANG=C TZ=UTC0) failed: files leap-1.O and $srcdir/leap-1.X differ" 1>&2
       (diff -c leap-1.O $srcdir/leap-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test leap-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp leap-1.O $srcdir/leap-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s leap-1.E || rm -f leap-1.E
LANG=C TZ=UTC0 $xx --date '1995-1-1' +%U  > U95-1.O 2> U95-1.E
code=$?
if test $code != 0; then
  $echo "Test U95-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp U95-1.O $srcdir/U95-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed U95-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test U95-1(LANG=C TZ=UTC0) failed: files U95-1.O and $srcdir/U95-1.X differ" 1>&2
       (diff -c U95-1.O $srcdir/U95-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test U95-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp U95-1.O $srcdir/U95-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s U95-1.E || rm -f U95-1.E
LANG=C TZ=UTC0 $xx --date '1995-1-7' +%U  > U95-2.O 2> U95-2.E
code=$?
if test $code != 0; then
  $echo "Test U95-2(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp U95-2.O $srcdir/U95-2.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed U95-2(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test U95-2(LANG=C TZ=UTC0) failed: files U95-2.O and $srcdir/U95-2.X differ" 1>&2
       (diff -c U95-2.O $srcdir/U95-2.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test U95-2(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp U95-2.O $srcdir/U95-2.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s U95-2.E || rm -f U95-2.E
LANG=C TZ=UTC0 $xx --date '1995-1-8' +%U  > U95-3.O 2> U95-3.E
code=$?
if test $code != 0; then
  $echo "Test U95-3(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp U95-3.O $srcdir/U95-3.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed U95-3(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test U95-3(LANG=C TZ=UTC0) failed: files U95-3.O and $srcdir/U95-3.X differ" 1>&2
       (diff -c U95-3.O $srcdir/U95-3.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test U95-3(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp U95-3.O $srcdir/U95-3.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s U95-3.E || rm -f U95-3.E
LANG=C TZ=UTC0 $xx --date '1992-1-1' +%U  > U92-1.O 2> U92-1.E
code=$?
if test $code != 0; then
  $echo "Test U92-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp U92-1.O $srcdir/U92-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed U92-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test U92-1(LANG=C TZ=UTC0) failed: files U92-1.O and $srcdir/U92-1.X differ" 1>&2
       (diff -c U92-1.O $srcdir/U92-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test U92-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp U92-1.O $srcdir/U92-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s U92-1.E || rm -f U92-1.E
LANG=C TZ=UTC0 $xx --date '1992-1-4' +%U  > U92-2.O 2> U92-2.E
code=$?
if test $code != 0; then
  $echo "Test U92-2(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp U92-2.O $srcdir/U92-2.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed U92-2(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test U92-2(LANG=C TZ=UTC0) failed: files U92-2.O and $srcdir/U92-2.X differ" 1>&2
       (diff -c U92-2.O $srcdir/U92-2.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test U92-2(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp U92-2.O $srcdir/U92-2.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s U92-2.E || rm -f U92-2.E
LANG=C TZ=UTC0 $xx --date '1992-1-5' +%U  > U92-3.O 2> U92-3.E
code=$?
if test $code != 0; then
  $echo "Test U92-3(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp U92-3.O $srcdir/U92-3.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed U92-3(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test U92-3(LANG=C TZ=UTC0) failed: files U92-3.O and $srcdir/U92-3.X differ" 1>&2
       (diff -c U92-3.O $srcdir/U92-3.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test U92-3(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp U92-3.O $srcdir/U92-3.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s U92-3.E || rm -f U92-3.E
LANG=C TZ=UTC0 $xx --date '1992-1-1' +%V  > V92-1.O 2> V92-1.E
code=$?
if test $code != 0; then
  $echo "Test V92-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp V92-1.O $srcdir/V92-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed V92-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test V92-1(LANG=C TZ=UTC0) failed: files V92-1.O and $srcdir/V92-1.X differ" 1>&2
       (diff -c V92-1.O $srcdir/V92-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test V92-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp V92-1.O $srcdir/V92-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s V92-1.E || rm -f V92-1.E
LANG=C TZ=UTC0 $xx --date '1992-1-5' +%V  > V92-2.O 2> V92-2.E
code=$?
if test $code != 0; then
  $echo "Test V92-2(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp V92-2.O $srcdir/V92-2.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed V92-2(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test V92-2(LANG=C TZ=UTC0) failed: files V92-2.O and $srcdir/V92-2.X differ" 1>&2
       (diff -c V92-2.O $srcdir/V92-2.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test V92-2(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp V92-2.O $srcdir/V92-2.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s V92-2.E || rm -f V92-2.E
LANG=C TZ=UTC0 $xx --date '1992-1-6' +%V  > V92-3.O 2> V92-3.E
code=$?
if test $code != 0; then
  $echo "Test V92-3(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp V92-3.O $srcdir/V92-3.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed V92-3(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test V92-3(LANG=C TZ=UTC0) failed: files V92-3.O and $srcdir/V92-3.X differ" 1>&2
       (diff -c V92-3.O $srcdir/V92-3.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test V92-3(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp V92-3.O $srcdir/V92-3.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s V92-3.E || rm -f V92-3.E
LANG=C TZ=UTC0 $xx --date '1992-1-1' +%W  > W92-1.O 2> W92-1.E
code=$?
if test $code != 0; then
  $echo "Test W92-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp W92-1.O $srcdir/W92-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed W92-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test W92-1(LANG=C TZ=UTC0) failed: files W92-1.O and $srcdir/W92-1.X differ" 1>&2
       (diff -c W92-1.O $srcdir/W92-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test W92-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp W92-1.O $srcdir/W92-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s W92-1.E || rm -f W92-1.E
LANG=C TZ=UTC0 $xx --date '1992-1-5' +%W  > W92-2.O 2> W92-2.E
code=$?
if test $code != 0; then
  $echo "Test W92-2(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp W92-2.O $srcdir/W92-2.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed W92-2(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test W92-2(LANG=C TZ=UTC0) failed: files W92-2.O and $srcdir/W92-2.X differ" 1>&2
       (diff -c W92-2.O $srcdir/W92-2.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test W92-2(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp W92-2.O $srcdir/W92-2.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s W92-2.E || rm -f W92-2.E
LANG=C TZ=UTC0 $xx --date '1992-1-6' +%W  > W92-3.O 2> W92-3.E
code=$?
if test $code != 0; then
  $echo "Test W92-3(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp W92-3.O $srcdir/W92-3.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed W92-3(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test W92-3(LANG=C TZ=UTC0) failed: files W92-3.O and $srcdir/W92-3.X differ" 1>&2
       (diff -c W92-3.O $srcdir/W92-3.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test W92-3(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp W92-3.O $srcdir/W92-3.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s W92-3.E || rm -f W92-3.E
LANG=C TZ=UTC0 $xx --date '1998-1-1 3 years' +%Y  > millen-1.O 2> millen-1.E
code=$?
if test $code != 0; then
  $echo "Test millen-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp millen-1.O $srcdir/millen-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed millen-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test millen-1(LANG=C TZ=UTC0) failed: files millen-1.O and $srcdir/millen-1.X differ" 1>&2
       (diff -c millen-1.O $srcdir/millen-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test millen-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp millen-1.O $srcdir/millen-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s millen-1.E || rm -f millen-1.E
LANG=C TZ=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-0(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-0(LANG=C TZ=UTC0) failed: files rel-0.O and $srcdir/rel-0.X differ" 1>&2
       (diff -c rel-0.O $srcdir/rel-0.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-0(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-1a(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-1a(LANG=C TZ=UTC0) failed: files rel-1a.O and $srcdir/rel-1a.X differ" 1>&2
       (diff -c rel-1a.O $srcdir/rel-1a.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-1a(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-1b(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-1b(LANG=C TZ=UTC0) failed: files rel-1b.O and $srcdir/rel-1b.X differ" 1>&2
       (diff -c rel-1b.O $srcdir/rel-1b.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-1b(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2a(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2a(LANG=C TZ=UTC0) failed: files rel-2a.O and $srcdir/rel-2a.X differ" 1>&2
       (diff -c rel-2a.O $srcdir/rel-2a.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2a(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2b(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2b(LANG=C TZ=UTC0) failed: files rel-2b.O and $srcdir/rel-2b.X differ" 1>&2
       (diff -c rel-2b.O $srcdir/rel-2b.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2b(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2c(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2c(LANG=C TZ=UTC0) failed: files rel-2c.O and $srcdir/rel-2c.X differ" 1>&2
       (diff -c rel-2c.O $srcdir/rel-2c.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2c(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2d(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2d(LANG=C TZ=UTC0) failed: files rel-2d.O and $srcdir/rel-2d.X differ" 1>&2
       (diff -c rel-2d.O $srcdir/rel-2d.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2d(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2e(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2e(LANG=C TZ=UTC0) failed: files rel-2e.O and $srcdir/rel-2e.X differ" 1>&2
       (diff -c rel-2e.O $srcdir/rel-2e.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2e(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2f(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2f(LANG=C TZ=UTC0) failed: files rel-2f.O and $srcdir/rel-2f.X differ" 1>&2
       (diff -c rel-2f.O $srcdir/rel-2f.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2f(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-2g(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-2g(LANG=C TZ=UTC0) failed: files rel-2g.O and $srcdir/rel-2g.X differ" 1>&2
       (diff -c rel-2g.O $srcdir/rel-2g.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-2g(LANG=C TZ=UTC0) 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=UTC0 $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=UTC0) 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 > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rel-3a(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test rel-3a(LANG=C TZ=UTC0) failed: files rel-3a.O and $srcdir/rel-3a.X differ" 1>&2
       (diff -c rel-3a.O $srcdir/rel-3a.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rel-3a(LANG=C TZ=UTC0) 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
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next second' '+%Y-%m-%d %T'  > next-s.O 2> next-s.E
code=$?
if test $code != 0; then
  $echo "Test next-s(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-s.O $srcdir/next-s.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-s(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-s(LANG=C TZ=UTC0) failed: files next-s.O and $srcdir/next-s.X differ" 1>&2
       (diff -c next-s.O $srcdir/next-s.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-s(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-s.O $srcdir/next-s.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-s.E || rm -f next-s.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next minute' '+%Y-%m-%d %T'  > next-m.O 2> next-m.E
code=$?
if test $code != 0; then
  $echo "Test next-m(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-m.O $srcdir/next-m.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-m(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-m(LANG=C TZ=UTC0) failed: files next-m.O and $srcdir/next-m.X differ" 1>&2
       (diff -c next-m.O $srcdir/next-m.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-m(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-m.O $srcdir/next-m.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-m.E || rm -f next-m.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next hour'   '+%Y-%m-%d %T'  > next-h.O 2> next-h.E
code=$?
if test $code != 0; then
  $echo "Test next-h(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-h.O $srcdir/next-h.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-h(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-h(LANG=C TZ=UTC0) failed: files next-h.O and $srcdir/next-h.X differ" 1>&2
       (diff -c next-h.O $srcdir/next-h.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-h(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-h.O $srcdir/next-h.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-h.E || rm -f next-h.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next day'    '+%Y-%m-%d %T'  > next-d.O 2> next-d.E
code=$?
if test $code != 0; then
  $echo "Test next-d(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-d.O $srcdir/next-d.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-d(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-d(LANG=C TZ=UTC0) failed: files next-d.O and $srcdir/next-d.X differ" 1>&2
       (diff -c next-d.O $srcdir/next-d.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-d(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-d.O $srcdir/next-d.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-d.E || rm -f next-d.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next week'   '+%Y-%m-%d %T'  > next-w.O 2> next-w.E
code=$?
if test $code != 0; then
  $echo "Test next-w(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-w.O $srcdir/next-w.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-w(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-w(LANG=C TZ=UTC0) failed: files next-w.O and $srcdir/next-w.X differ" 1>&2
       (diff -c next-w.O $srcdir/next-w.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-w(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-w.O $srcdir/next-w.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-w.E || rm -f next-w.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next month' '+%Y-%m-%d %T'  > next-mo.O 2> next-mo.E
code=$?
if test $code != 0; then
  $echo "Test next-mo(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-mo.O $srcdir/next-mo.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-mo(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-mo(LANG=C TZ=UTC0) failed: files next-mo.O and $srcdir/next-mo.X differ" 1>&2
       (diff -c next-mo.O $srcdir/next-mo.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-mo(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-mo.O $srcdir/next-mo.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-mo.E || rm -f next-mo.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 +0 next year'   '+%Y-%m-%d %T'  > next-y.O 2> next-y.E
code=$?
if test $code != 0; then
  $echo "Test next-y(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp next-y.O $srcdir/next-y.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed next-y(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test next-y(LANG=C TZ=UTC0) failed: files next-y.O and $srcdir/next-y.X differ" 1>&2
       (diff -c next-y.O $srcdir/next-y.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test next-y(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp next-y.O $srcdir/next-y.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s next-y.E || rm -f next-y.E
TZ=UTC+4 $xx -u -d '08/01/97 6:00' '+%D,%H:%M'  > utc-0.O 2> utc-0.E
code=$?
if test $code != 0; then
  $echo "Test utc-0(TZ=UTC+4) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp utc-0.O $srcdir/utc-0.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed utc-0(TZ=UTC+4)"; fi;;
    1) $echo "Test utc-0(TZ=UTC+4) failed: files utc-0.O and $srcdir/utc-0.X differ" 1>&2
       (diff -c utc-0.O $srcdir/utc-0.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test utc-0(TZ=UTC+4) may have failed." 1>&2
       $echo The command "cmp utc-0.O $srcdir/utc-0.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s utc-0.E || rm -f utc-0.E
LANG=C TZ=UTC0 $xx -u -d '08/01/97 6:00 UTC +4 hours' '+%D,%H:%M'  > utc-0a.O 2> utc-0a.E
code=$?
if test $code != 0; then
  $echo "Test utc-0a(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp utc-0a.O $srcdir/utc-0a.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed utc-0a(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test utc-0a(LANG=C TZ=UTC0) failed: files utc-0a.O and $srcdir/utc-0a.X differ" 1>&2
       (diff -c utc-0a.O $srcdir/utc-0a.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test utc-0a(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp utc-0a.O $srcdir/utc-0a.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s utc-0a.E || rm -f utc-0a.E
TZ=UTC+1 $xx -u --file=- '+%Y-%m-%d %T' < $srcdir/utc-1.I > utc-1.O 2> utc-1.E
code=$?
if test $code != 0; then
  $echo "Test utc-1(TZ=UTC+1) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp utc-1.O $srcdir/utc-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed utc-1(TZ=UTC+1)"; fi;;
    1) $echo "Test utc-1(TZ=UTC+1) failed: files utc-1.O and $srcdir/utc-1.X differ" 1>&2
       (diff -c utc-1.O $srcdir/utc-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test utc-1(TZ=UTC+1) may have failed." 1>&2
       $echo The command "cmp utc-1.O $srcdir/utc-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s utc-1.E || rm -f utc-1.E
LANG=C TZ=UTC0 $xx -u --file=- '+%Y-%m-%d %T' < $srcdir/utc-1a.I > utc-1a.O 2> utc-1a.E
code=$?
if test $code != 0; then
  $echo "Test utc-1a(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp utc-1a.O $srcdir/utc-1a.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed utc-1a(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test utc-1a(LANG=C TZ=UTC0) failed: files utc-1a.O and $srcdir/utc-1a.X differ" 1>&2
       (diff -c utc-1a.O $srcdir/utc-1a.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test utc-1a(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp utc-1a.O $srcdir/utc-1a.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s utc-1a.E || rm -f utc-1a.E
TZ=UTC+2 $xx -d '1970-01-01 00:00:01' +%s  > date2sec-0.O 2> date2sec-0.E
code=$?
if test $code != 0; then
  $echo "Test date2sec-0(TZ=UTC+2) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp date2sec-0.O $srcdir/date2sec-0.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed date2sec-0(TZ=UTC+2)"; fi;;
    1) $echo "Test date2sec-0(TZ=UTC+2) failed: files date2sec-0.O and $srcdir/date2sec-0.X differ" 1>&2
       (diff -c date2sec-0.O $srcdir/date2sec-0.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test date2sec-0(TZ=UTC+2) may have failed." 1>&2
       $echo The command "cmp date2sec-0.O $srcdir/date2sec-0.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s date2sec-0.E || rm -f date2sec-0.E
LANG=C TZ=UTC0 $xx -d '1970-01-01 00:00:01 UTC +2 hours' +%s  > date2sec-0a.O 2> date2sec-0a.E
code=$?
if test $code != 0; then
  $echo "Test date2sec-0a(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp date2sec-0a.O $srcdir/date2sec-0a.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed date2sec-0a(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test date2sec-0a(LANG=C TZ=UTC0) failed: files date2sec-0a.O and $srcdir/date2sec-0a.X differ" 1>&2
       (diff -c date2sec-0a.O $srcdir/date2sec-0a.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test date2sec-0a(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp date2sec-0a.O $srcdir/date2sec-0a.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s date2sec-0a.E || rm -f date2sec-0a.E
LANG=C TZ=UTC0 $xx -d 2000-01-01 +%s  > date2sec-1.O 2> date2sec-1.E
code=$?
if test $code != 0; then
  $echo "Test date2sec-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp date2sec-1.O $srcdir/date2sec-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed date2sec-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test date2sec-1(LANG=C TZ=UTC0) failed: files date2sec-1.O and $srcdir/date2sec-1.X differ" 1>&2
       (diff -c date2sec-1.O $srcdir/date2sec-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test date2sec-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp date2sec-1.O $srcdir/date2sec-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s date2sec-1.E || rm -f date2sec-1.E
LANG=C TZ=UTC0 $xx -d '1970-01-01 UTC 946684800 sec' +'%Y-%m-%d %T %z'  > sec2date-0.O 2> sec2date-0.E
code=$?
if test $code != 0; then
  $echo "Test sec2date-0(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp sec2date-0.O $srcdir/sec2date-0.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed sec2date-0(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test sec2date-0(LANG=C TZ=UTC0) failed: files sec2date-0.O and $srcdir/sec2date-0.X differ" 1>&2
       (diff -c sec2date-0.O $srcdir/sec2date-0.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test sec2date-0(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp sec2date-0.O $srcdir/sec2date-0.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s sec2date-0.E || rm -f sec2date-0.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 this minute' '+%Y-%m-%d %T'  > this-m.O 2> this-m.E
code=$?
if test $code != 0; then
  $echo "Test this-m(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp this-m.O $srcdir/this-m.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed this-m(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test this-m(LANG=C TZ=UTC0) failed: files this-m.O and $srcdir/this-m.X differ" 1>&2
       (diff -c this-m.O $srcdir/this-m.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test this-m(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp this-m.O $srcdir/this-m.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s this-m.E || rm -f this-m.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 this hour' '+%Y-%m-%d %T'  > this-h.O 2> this-h.E
code=$?
if test $code != 0; then
  $echo "Test this-h(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp this-h.O $srcdir/this-h.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed this-h(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test this-h(LANG=C TZ=UTC0) failed: files this-h.O and $srcdir/this-h.X differ" 1>&2
       (diff -c this-h.O $srcdir/this-h.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test this-h(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp this-h.O $srcdir/this-h.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s this-h.E || rm -f this-h.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 this week' '+%Y-%m-%d %T'  > this-w.O 2> this-w.E
code=$?
if test $code != 0; then
  $echo "Test this-w(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp this-w.O $srcdir/this-w.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed this-w(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test this-w(LANG=C TZ=UTC0) failed: files this-w.O and $srcdir/this-w.X differ" 1>&2
       (diff -c this-w.O $srcdir/this-w.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test this-w(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp this-w.O $srcdir/this-w.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s this-w.E || rm -f this-w.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 this month' '+%Y-%m-%d %T'  > this-mo.O 2> this-mo.E
code=$?
if test $code != 0; then
  $echo "Test this-mo(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp this-mo.O $srcdir/this-mo.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed this-mo(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test this-mo(LANG=C TZ=UTC0) failed: files this-mo.O and $srcdir/this-mo.X differ" 1>&2
       (diff -c this-mo.O $srcdir/this-mo.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test this-mo(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp this-mo.O $srcdir/this-mo.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s this-mo.E || rm -f this-mo.E
LANG=C TZ=UTC0 $xx -d '1997-01-19 08:17:48 this year' '+%Y-%m-%d %T'  > this-y.O 2> this-y.E
code=$?
if test $code != 0; then
  $echo "Test this-y(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp this-y.O $srcdir/this-y.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed this-y(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test this-y(LANG=C TZ=UTC0) failed: files this-y.O and $srcdir/this-y.X differ" 1>&2
       (diff -c this-y.O $srcdir/this-y.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test this-y(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp this-y.O $srcdir/this-y.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s this-y.E || rm -f this-y.E
LANG=C TZ=UTC0 $xx -d 'Nov 10 1996' '+%Y-%m-%d %T'  > risks-1.O 2> risks-1.E
code=$?
if test $code != 0; then
  $echo "Test risks-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp risks-1.O $srcdir/risks-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed risks-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test risks-1(LANG=C TZ=UTC0) failed: files risks-1.O and $srcdir/risks-1.X differ" 1>&2
       (diff -c risks-1.O $srcdir/risks-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test risks-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp risks-1.O $srcdir/risks-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s risks-1.E || rm -f risks-1.E
LANG=C $xx -u -d '1996-11-10 0:00:00 +0' '+%Y-%m-%d %T'  > regress-1.O 2> regress-1.E
code=$?
if test $code != 0; then
  $echo "Test regress-1(LANG=C) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp regress-1.O $srcdir/regress-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed regress-1(LANG=C)"; fi;;
    1) $echo "Test regress-1(LANG=C) failed: files regress-1.O and $srcdir/regress-1.X differ" 1>&2
       (diff -c regress-1.O $srcdir/regress-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test regress-1(LANG=C) may have failed." 1>&2
       $echo The command "cmp regress-1.O $srcdir/regress-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s regress-1.E || rm -f regress-1.E
LANG=C TZ=UTC0 $xx -d 000909 '+%Y-%m-%d %T'  > datevtime-1.O 2> datevtime-1.E
code=$?
if test $code != 0; then
  $echo "Test datevtime-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp datevtime-1.O $srcdir/datevtime-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed datevtime-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test datevtime-1(LANG=C TZ=UTC0) failed: files datevtime-1.O and $srcdir/datevtime-1.X differ" 1>&2
       (diff -c datevtime-1.O $srcdir/datevtime-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test datevtime-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp datevtime-1.O $srcdir/datevtime-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s datevtime-1.E || rm -f datevtime-1.E
LC_ALL=de_DE TZ=UTC0 $xx -R -d '1997-01-19 08:17:48 +0'  > rfc822-1.O 2> rfc822-1.E
code=$?
if test $code != 0; then
  $echo "Test rfc822-1(LC_ALL=de_DE TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp rfc822-1.O $srcdir/rfc822-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed rfc822-1(LC_ALL=de_DE TZ=UTC0)"; fi;;
    1) $echo "Test rfc822-1(LC_ALL=de_DE TZ=UTC0) failed: files rfc822-1.O and $srcdir/rfc822-1.X differ" 1>&2
       (diff -c rfc822-1.O $srcdir/rfc822-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test rfc822-1(LC_ALL=de_DE TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp rfc822-1.O $srcdir/rfc822-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s rfc822-1.E || rm -f rfc822-1.E
LANG=C TZ=UTC0 $xx --utc -d '1970-01-01 00:00:00 UTC +961062237 sec' '+%Y-%m-%d %T'  > relative-1.O 2> relative-1.E
code=$?
if test $code != 0; then
  $echo "Test relative-1(LANG=C TZ=UTC0) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp relative-1.O $srcdir/relative-1.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed relative-1(LANG=C TZ=UTC0)"; fi;;
    1) $echo "Test relative-1(LANG=C TZ=UTC0) failed: files relative-1.O and $srcdir/relative-1.X differ" 1>&2
       (diff -c relative-1.O $srcdir/relative-1.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test relative-1(LANG=C TZ=UTC0) may have failed." 1>&2
       $echo The command "cmp relative-1.O $srcdir/relative-1.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s relative-1.E || rm -f relative-1.E
TZ=UTC+1 $xx --utc -d '1970-01-01 UTC +961062237 sec' '+%Y-%m-%d %T'  > relative-2.O 2> relative-2.E
code=$?
if test $code != 0; then
  $echo "Test relative-2(TZ=UTC+1) failed: ../../src/date return code $code differs from expected value 0" 1>&2
  errors=`expr $errors + 1`
else
  cmp relative-2.O $srcdir/relative-2.X > /dev/null 2>&1
  case $? in
    0) if test "$VERBOSE"; then $echo "passed relative-2(TZ=UTC+1)"; fi;;
    1) $echo "Test relative-2(TZ=UTC+1) failed: files relative-2.O and $srcdir/relative-2.X differ" 1>&2
       (diff -c relative-2.O $srcdir/relative-2.X) 2> /dev/null
       errors=`expr $errors + 1`;;
    2) $echo "Test relative-2(TZ=UTC+1) may have failed." 1>&2
       $echo The command "cmp relative-2.O $srcdir/relative-2.X" failed. 1>&2
       errors=`expr $errors + 1`;;
  esac
fi
test -s relative-2.E || rm -f relative-2.E
if test $errors = 0; then
  $echo Passed all 59 tests. 1>&2
else
  $echo Failed $errors tests. 1>&2
fi
test $errors = 0 || errors=1
exit $errors