summaryrefslogtreecommitdiff
path: root/test/Makefile.am
blob: 9b4137de95d702451ca8859c375e6b861b23346c (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
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
#
# test/Makefile.am --- automake input file for gawk
#
# Copyright (C) 1988-2006 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
#
# GAWK is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GAWK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
#

## process this file with automake to produce Makefile.in

EXTRA_DIST = \
	reg \
	lib \
	Gentests \
	Maketests \
	README \
	addcomma.awk \
	addcomma.in \
	addcomma.ok \
	anchgsub.awk \
	anchgsub.in \
	anchgsub.ok \
	argarray.awk \
	argarray.in \
	argarray.ok \
	argtest.awk \
	argtest.ok \
	arrayparm.awk \
	arrayparm.ok \
	arrayprm2.awk \
	arrayprm2.ok \
	arrayprm3.awk \
	arrayprm3.ok \
	arrayref.awk \
	arrayref.ok \
	arrymem1.awk \
	arrymem1.ok \
	arryref2.awk \
	arryref2.ok \
	arryref3.awk \
	arryref3.ok \
	arryref4.awk \
	arryref4.ok \
	arryref5.awk \
	arryref5.ok \
	arynasty.awk \
	arynasty.ok \
	arynocls.awk \
	arynocls.in \
	arynocls.ok \
	aryprm1.awk \
	aryprm1.ok \
	aryprm2.awk \
	aryprm2.ok \
	aryprm3.awk \
	aryprm3.ok \
	aryprm4.awk \
	aryprm4.ok \
	aryprm5.awk \
	aryprm5.ok \
	aryprm6.awk \
	aryprm6.ok \
	aryprm7.awk \
	aryprm7.ok \
	aryprm8.awk \
	aryprm8.ok \
	arysubnm.awk \
	arysubnm.ok \
	asgext.awk \
	asgext.in \
	asgext.ok \
	asort.awk \
	asort.ok \
	asorti.awk \
	asorti.ok \
	awkpath.ok \
	back89.awk \
	back89.in \
	back89.ok \
	backgsub.awk \
	backgsub.in \
	backgsub.ok \
	backw.awk \
	backw.in \
	backw.ok \
	badargs.ok \
	binmode1.ok \
	childin.awk \
	childin.in \
	childin.ok \
	clobber.awk \
	clobber.ok \
	clos1way.awk \
	clos1way.ok \
	clsflnam.awk \
	clsflnam.in \
	clsflnam.ok \
	compare.awk \
	compare.in \
	compare.ok \
	compare2.awk \
	compare2.ok \
	concat1.awk \
	concat1.in \
	concat1.ok \
	concat2.awk \
	concat2.ok \
	concat3.awk \
	concat3.ok \
	concat4.awk \
	concat4.in \
	concat4.ok \
	convfmt.awk \
	convfmt.ok \
	datanonl.awk \
	datanonl.in \
	datanonl.ok \
	defref.awk \
	defref.ok \
	delarprm.awk \
	delarprm.ok \
	delarpm2.awk \
	delarpm2.ok \
	delfunc.awk \
	delfunc.ok \
	devfd.in1 \
	devfd.in2 \
	devfd.in4 \
	devfd.in5 \
	devfd.ok \
	devfd1.awk \
	devfd1.ok \
	devfd2.ok \
	double1.awk \
	double1.ok \
	double2.awk \
	double2.ok \
	dynlj.awk \
	dynlj.ok \
	eofsplit.awk \
	eofsplit.ok \
	exitval1.awk \
	exitval1.ok \
	exitval2.awk \
	exitval2.ok \
	exitval2.w32 \
	fflush.ok \
	fflush.sh \
	fieldwdth.awk \
	fieldwdth.in \
	fieldwdth.ok \
	fldchg.awk \
	fldchg.in \
	fldchg.ok \
	fldchgnf.awk \
	fldchgnf.in \
	fldchgnf.ok \
	fmtspcl.awk \
	fmtspcl.tok \
	fmttest.awk \
	fmttest.ok \
	fnamedat.awk \
	fnamedat.in \
	fnamedat.ok \
	fnarray.awk \
	fnarray.ok \
	fnarray2.awk \
	fnarray2.ok \
	fnarydel.awk \
	fnarydel.ok \
	fnaryscl.awk \
	fnaryscl.ok \
	fnasgnm.awk \
	fnasgnm.in \
	fnasgnm.ok \
	fnmisc.awk \
	fnmisc.ok \
	fnparydl.awk \
	fnparydl.ok \
	fordel.awk \
	fordel.ok \
	forsimp.awk \
	forsimp.ok \
	fsbs.awk \
	fsbs.in \
	fsbs.ok \
	fsfwfs.awk \
	fsfwfs.in \
	fsfwfs.ok \
	fsrs.awk \
	fsrs.in \
	fsrs.ok \
	fsspcoln.awk \
	fsspcoln.in \
	fsspcoln.ok \
	fstabplus.awk \
	fstabplus.in \
	fstabplus.ok \
	funsemnl.awk \
	funsemnl.ok \
	funsmnam.awk \
	funsmnam.ok \
	funstack.awk \
	funstack.in \
	funstack.ok \
	fwtest.awk \
	fwtest.in \
	fwtest.ok \
	fwtest2.awk \
	fwtest2.in \
	fwtest2.ok \
	gensub.awk \
	gensub.in \
	gensub.ok \
	gensub2.awk \
	gensub2.ok \
	getline.awk \
	getline.in \
	getline.ok \
	getline2.awk \
	getline2.ok \
	getline3.awk \
	getline3.ok \
	getlnbuf.awk \
	getlnbuf.in \
	getlnbuf.ok \
	getlnhd.awk \
	getlnhd.ok \
	getnr2tb.awk \
	getnr2tb.in \
	getnr2tb.ok \
	getnr2tm.awk \
	getnr2tm.in \
	getnr2tm.ok \
	gnuops2.awk \
	gnuops2.ok \
	gnuops3.awk \
	gnuops3.ok \
	gnureops.awk \
	gnureops.ok \
	gsubasgn.awk \
	gsubasgn.ok \
	gsubtest.awk \
	gsubtest.ok \
	gsubtst2.awk \
	gsubtst2.ok \
	gsubtst3.awk \
	gsubtst3.in \
	gsubtst3.ok \
	gsubtst4.awk \
	gsubtst4.ok \
	gsubtst5.awk \
	gsubtst5.in \
	gsubtst5.ok \
	gtlnbufv.awk \
	hex.awk \
	hex.ok \
	hsprint.awk \
	hsprint.ok \
	icasefs.awk \
	icasefs.ok \
	icasers.awk \
	icasers.in \
	icasers.ok \
	igncdym.awk \
	igncdym.in \
	igncdym.ok \
	igncfs.awk \
	igncfs.in \
	igncfs.ok \
	ignrcase.awk \
	ignrcase.in \
	ignrcase.ok \
	ignrcas2.awk \
	ignrcas2.ok \
	inftest.awk \
	inftest.ok \
	inputred.awk \
	inputred.ok \
	intest.awk \
	intest.ok \
	intformat.awk \
	intformat.ok \
	intprec.awk \
	intprec.ok \
	iobug1.awk \
	iobug1.ok \
	leaddig.awk \
	leaddig.ok \
	leadnl.awk \
	leadnl.in \
	leadnl.ok \
	lint.awk \
	lint.ok \
	lintold.awk \
	lintold.in \
	lintold.ok \
	litoct.awk \
	litoct.ok \
	localenl.ok \
	localenl.sh \
	longdbl.awk \
	longdbl.in \
	longdbl.ok \
	longsub.awk \
	longsub.in \
	longsub.ok \
	longwrds.awk \
	longwrds.ok \
	longwrds.in \
	manglprm.awk \
	manglprm.in \
	manglprm.ok \
	manyfiles.awk \
	manyfiles.ok \
	match1.awk \
	match1.ok \
	match2.awk \
	match2.ok \
	math.awk \
	math.ok \
	membug1.awk \
	membug1.in \
	membug1.ok \
	messages.awk \
	minusstr.awk \
	minusstr.ok \
	mixed1.ok \
	mmap8k.in \
	mtchi18n.awk \
	mtchi18n.in \
	mtchi18n.ok \
	nasty.awk \
	nasty.ok \
	nasty2.awk \
	nasty2.ok \
	negexp.awk \
	negexp.ok \
	nested.awk \
	nested.in \
	nested.ok \
	nfldstr.awk \
	nfldstr.in \
	nfldstr.ok \
	nfneg.awk \
	nfneg.ok \
	nfset.awk \
	nfset.in \
	nfset.ok \
	nlfldsep.awk \
	nlfldsep.in \
	nlfldsep.ok \
	nlinstr.awk \
	nlinstr.in \
	nlinstr.ok \
	nlstrina.awk \
	nlstrina.ok \
	noeffect.awk \
	noeffect.ok \
	nofile.ok \
	nofmtch.awk \
	nofmtch.ok \
	noloop1.awk \
	noloop1.in \
	noloop1.ok \
	noloop2.awk \
	noloop2.in \
	noloop2.ok \
	nondec.awk \
	nondec.ok \
	nondec2.awk \
	nondec2.ok \
	nonl.awk \
	nonl.ok \
	noparms.awk \
	noparms.ok \
	nors.in \
	nors.ok \
	nulrsend.awk \
	nulrsend.in \
	nulrsend.ok \
	numindex.awk \
	numindex.in \
	numindex.ok \
	numsubstr.awk \
	numsubstr.in \
	numsubstr.ok \
	octsub.awk \
	octsub.ok \
	ofmt.awk \
	ofmt.in \
	ofmt.ok \
	ofmtbig.awk \
	ofmtbig.in \
	ofmtbig.ok \
	ofmtfidl.awk \
	ofmtfidl.in \
	ofmtfidl.ok \
	ofmts.awk \
	ofmts.in \
	ofmts.ok \
	onlynl.awk \
	onlynl.in \
	onlynl.ok \
	opasnidx.awk \
	opasnidx.ok \
	opasnslf.awk \
	opasnslf.ok \
	out1.ok \
	out2.ok \
	out3.ok \
	ovrflow1.awk \
	ovrflow1.ok \
	paramdup.awk \
	paramdup.ok \
	paramtyp.awk \
	paramtyp.ok \
	parse1.awk \
	parse1.in \
	parse1.ok \
	parsefld.awk \
	parsefld.in \
	parsefld.ok \
	parseme.awk \
	parseme.ok \
	pcntplus.awk \
	pcntplus.ok \
	pid.awk \
	pid.ok \
	pid.sh \
	pipeio1.awk \
	pipeio1.ok \
	pipeio2.awk \
	pipeio2.in \
	pipeio2.ok \
	posix.awk \
	posix.in \
	posix.ok \
	poundbang.awk \
	prdupval.awk \
	prdupval.in \
	prdupval.ok \
	prec.awk \
	prec.ok \
	printf0.awk \
	printf0.ok \
	printf1.awk \
	printf1.ok \
	printfbad1.awk \
	printfbad1.ok \
	printfloat.awk \
	printlang.awk \
	prmarscl.awk \
	prmarscl.ok \
	prmreuse.awk \
	prmreuse.ok \
	procinfs.awk \
	procinfs.ok \
	prt1eval.awk \
	prt1eval.ok \
	prtoeval.awk \
	prtoeval.ok \
	psx96sub.awk \
	psx96sub.ok \
	rand.awk \
	rand.ok \
	rebt8b1.awk \
	rebt8b1.ok \
	rebt8b2.awk \
	rebt8b2.ok \
	redfilnm.awk \
	redfilnm.in \
	redfilnm.ok \
	regeq.awk \
	regeq.in \
	regeq.ok \
	regtest.sh \
	regx8bit.awk \
	regx8bit.ok \
	rebuf.awk \
	rebuf.in \
	rebuf.ok \
	reindops.awk \
	reindops.in \
	reindops.ok \
	reint.awk \
	reint.in \
	reint.ok \
	reint2.awk \
	reint2.in \
	reint2.ok \
	reparse.awk \
	reparse.in \
	reparse.ok \
	resplit.awk \
	resplit.in \
	resplit.ok \
	rs.awk \
	rs.in \
	rs.ok \
	rsnul1nl.awk \
	rsnul1nl.in \
	rsnul1nl.ok \
	rsnulbig.ok \
	rsnulbig2.ok \
	rsstart1.awk \
	rsstart1.in \
	rsstart1.ok \
	rsstart2.awk \
	rsstart2.ok \
	rsstart3.ok \
	rstest1.awk \
	rstest1.ok \
	rstest2.awk \
	rstest2.ok \
	rstest3.awk \
	rstest3.ok \
	rstest4.awk \
	rstest4.ok \
	rstest5.awk \
	rstest5.ok \
	rstest6.awk \
	rstest6.in \
	rstest6.ok \
	rswhite.awk \
	rswhite.in \
	rswhite.ok \
	scalar.awk \
	scalar.ok \
	sclforin.awk \
	sclforin.ok \
	sclifin.awk \
	sclifin.ok \
	shadow.awk \
	shadow.ok \
	sort1.awk \
	sort1.ok \
	sortempty.awk \
	sortempty.ok \
	space.ok \
	splitargv.awk \
	splitargv.in \
	splitargv.ok \
	splitarr.awk \
	splitarr.ok \
	splitdef.awk \
	splitdef.ok \
	splitvar.awk \
	splitvar.in \
	splitvar.ok \
	splitwht.awk \
	splitwht.ok \
	sprintfc.awk \
	sprintfc.in \
	sprintfc.ok \
	strcat1.awk \
	strcat1.ok \
	strtod.awk \
	strtod.in \
	strtod.ok \
	strnum1.awk \
	strnum1.ok \
	strtonum.awk \
	strtonum.ok \
	strftime.awk \
	strftlng.awk \
	strftlng.ok \
	subamp.awk \
	subamp.in \
	subamp.ok \
	subi18n.awk \
	subi18n.ok \
	subsepnm.awk \
	subsepnm.ok \
	subslash.awk \
	subslash.ok \
	substr.awk \
	substr.ok \
	swaplns.awk \
	swaplns.in \
	swaplns.ok \
	switch2.awk \
	synerr1.awk \
	synerr1.ok \
	synerr2.awk \
	synerr2.ok \
	tradanch.awk \
	tradanch.in \
	tradanch.ok \
	tweakfld.awk \
	tweakfld.in \
	tweakfld.ok \
	uninit2.awk \
	uninit2.ok \
	uninit3.awk \
	uninit3.ok \
	uninit4.awk \
	uninit4.ok \
	uninitialized.awk \
	uninitialized.ok \
	unterm.awk \
	unterm.ok \
	whiny.awk \
	whiny.in \
	whiny.ok \
	wideidx.awk \
	wideidx.in \
	wideidx.ok \
	wideidx2.awk \
	wideidx2.ok \
	widesub.awk \
	widesub.ok \
	widesub2.awk \
	widesub2.ok \
	widesub3.awk \
	widesub3.in \
	widesub3.ok \
	widesub4.awk \
	widesub4.ok \
	wjposer1.awk \
	wjposer1.in \
	wjposer1.ok \
	zero2.awk \
	zero2.ok \
	zeroe0.awk \
	zeroe0.ok \
	zeroflag.awk \
	zeroflag.ok

TESTS_WE_ARE_NOT_DOING_YET_FIXME_ONE_DAY = longdbl

# Get rid of core files when cleaning and generated .ok file
CLEANFILES = core core.* fmtspcl.ok

# try to keep these sorted
BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 \
	arrayprm2 arrayprm3 arryref2 arryref3 arryref4 arryref5 arynasty \
	arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
	aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \
	clsflnam compare compare2 concat1 concat2 concat3 concat4 convfmt datanonl defref \
	delarprm delarpm2 delfunc dynlj eofsplit exitval1 exitval2 fldchg fldchgnf fmtspcl fmttest fnamedat \
	fnarray fnarray2 fnarydel fnaryscl fnasgnm fnmisc fnparydl \
	fordel forsimp fsbs fsspcoln fsrs fstabplus funsemnl funsmnam funstack getline \
	getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \
	gsubtst2 gsubtst3 gsubtst4 gsubtst5 hex hsprint inputred intest intformat \
	intprec iobug1 leaddig leadnl litoct longsub longwrds manglprm math membug1 \
	messages minusstr mmap8k mtchi18n nasty nasty2 negexp nested nfldstr \
	nfneg nfset nlfldsep nlinstr nlstrina noeffect nofile nofmtch noloop1 \
	noloop2 nonl noparms nors nulrsend numindex numsubstr octsub ofmt \
	ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf ovrflow1 paramdup paramtyp \
	parse1 parsefld parseme pcntplus prdupval prec printf0 printf1 prmarscl prmreuse \
	prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq \
	reindops reparse resplit rs rsnul1nl rsnulbig rsnulbig2 rstest1 \
	rstest2 rstest3 rstest4 rstest5 rswhite scalar sclforin sclifin \
	sortempty splitargv splitarr splitdef splitvar splitwht sprintfc \
	strcat1 strtod strnum1 subamp subi18n subsepnm subslash substr swaplns \
	synerr1 synerr2 tradanch \
	tweakfld uninit2 uninit3 uninit4 uninitialized unterm wideidx wideidx2 \
	widesub widesub2 widesub3 widesub4 wjposer1 zeroe0 zeroflag zero2

UNIX_TESTS = fflush getlnhd localenl pid pipeio1 pipeio2 poundbang space strftlng

GAWK_EXT_TESTS = argtest asort asorti backw badargs binmode1 clos1way devfd devfd1 devfd2 double1 double2 \
	fieldwdth fsfwfs fwtest fwtest2 gensub gensub2 gnuops2 gnuops3 gnureops icasefs \
	icasers igncdym igncfs ignrcase ignrcas2 lint lintold match1 match2 manyfiles \
	nondec nondec2 posix procinfs printfbad1 regx8bit rebuf reint reint2 rsstart1 \
	rsstart2 rsstart3 rstest6 shadow sort1 strtonum strftime whiny

EXTRA_TESTS = regtest inftest

INET_TESTS = inetechu inetecht inetdayu inetdayt

# List of the tests which should be run with --lint option:
NEED_LINT = defref fmtspcl noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized

# List of the tests which should be run with --lint-old option:
NEED_LINT_OLD = lintold

# List of the tests which fail with EXIT CODE 1
FAIL_CODE1 = fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm

# List of the files that appear in manual tests or are for reserve testing:
GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk

CMP = cmp
AWKPROG = ../gawk$(EXEEXT)

# This business forces the locale to be C for running the tests,
# unless we override it to something else for testing.
#
# This can also be done in individual tests where we wish to
# check things specifically not in the C locale.
AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG)

# Message stuff is to make it a little easier to follow.
# Make the pass-fail last and dependent on others to avoid
# spurious errors if `make -j' in effect.
check:	msg \
	printlang \
	basic-msg-start  basic           basic-msg-end \
	unix-msg-start   unix-tests      unix-msg-end \
	extend-msg-start gawk-extensions extend-msg-end
	@$(MAKE) pass-fail

basic:	$(BASIC_TESTS)

unix-tests: $(UNIX_TESTS)

gawk-extensions: $(GAWK_EXT_TESTS)

extra:	$(EXTRA_TESTS) inet

inet:	inetmesg $(INET_TESTS)

msg::
	@echo ''
	@echo 'Any output from "cmp" is bad news, although some differences'
	@echo 'in floating point values are probably benign -- in particular,'
	@echo 'some systems may omit a leading zero and the floating point'
	@echo 'precision may lead to slightly different output in a few cases.'

printlang::
	@$(AWK) -f $(srcdir)/printlang.awk

basic-msg-start:
	@echo "======== Starting basic tests ========"

basic-msg-end:
	@echo "======== Done with basic tests ========"

unix-msg-start:
	@echo "======== Starting Unix tests ========"

unix-msg-end:
	@echo "======== Done with Unix tests ========"

extend-msg-start:
	@echo "======== Starting gawk extension tests ========"

extend-msg-end:
	@echo "======== Done with gawk extension tests ========"


# This test is a PITA because increasingly, /tmp is getting
# mounted noexec.  So, we'll test it locally.  Sigh.
#
# More PITA; some systems have medium short limits on #! paths,
# so this can still fail
poundbang::
	@echo $@
	@sed "s;/tmp/gawk;`pwd`/$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk
	@chmod +x ./_pbd.awk
	@if ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@` ; \
	then : ; \
	else \
		sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \
		chmod +x ./_pbd.awk ; \
		LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`;  \
	fi
	@-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk

messages::
	@echo $@
	@$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
	@-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3

argarray::
	@echo $@
	@case $(srcdir) in \
	.)	: ;; \
	*)	cp $(srcdir)/argarray.in . ;; \
	esac
	@TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@
	@case $(srcdir) in \
	.)	: ;; \
	*)	rm -f ./argarray.in ;; \
	esac
	@-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@

regtest::
	@echo 'Some of the output from regtest is very system specific, do not'
	@echo 'be distressed if your output differs from that distributed.'
	@echo 'Manual inspection is called for.'
	AWK=$(AWKPROG) $(srcdir)/regtest.sh

manyfiles::
	@echo manyfiles
	@rm -rf junk
	@mkdir junk
	@$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@
	@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
	@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/  *//g" > _$@
	@rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

compare::
	@echo $@
	@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
	@-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@

inftest::
	@echo $@
	@echo This test is very machine specific...
	@$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@
	@-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@

getline2::
	@echo $@
	@$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
	@-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@

awkpath::
	@echo $@
	@AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
	@-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@

argtest::
	@echo $@
	@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
	@-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@

badargs::
	@echo $@
	@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
	@-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@

nonl::
	@echo $@
	@-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
	@-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@

strftime::
	@echo This test could fail on slow machines or on a minute boundary,
	@echo so if it does, double check the actual results:
	@echo $@
	@GAWKLOCALE=C; export GAWKLOCALE; \
	TZ=GMT0; export TZ; \
	(LC_ALL=C date) | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk
	@-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0

litoct::
	@echo $@
	@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
	@-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@

devfd::
	@echo $@
	@$(AWK) 1 /dev/fd/4 /dev/fd/5 4<$(srcdir)/devfd.in4 5<$(srcdir)/devfd.in5 >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

fflush::
	@echo $@
	@$(srcdir)/fflush.sh >_$@
	@-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@

tweakfld::
	@echo $@
	@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
	@rm -f errors.cleanup
	@-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@

mmap8k::
	@echo $@
	@$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@
	@-$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@

tradanch::
	@echo $@
	@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
	@-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@

# AIX /bin/sh exec's the last command in a list, therefore issue a ":"
# command so that pid.sh is fork'ed as a child before being exec'ed.
pid::
	@echo pid
	@AWKPATH=$(srcdir) AWK=$(AWKPROG) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
	@-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@`

strftlng::
	@echo $@
	@TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@
	@if $(CMP) $(srcdir)/strftlng.ok _$@ >/dev/null 2>&1 ; then : ; else \
	TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
	fi
	@-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@

nors::
	@echo $@
	@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
	@-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@

fmtspcl.ok: fmtspcl.tok Makefile
	@$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null

fmtspcl: fmtspcl.ok
	@echo fmtspcl
	@$(AWK) -f $(srcdir)/fmtspcl.awk  --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $@.ok _$@ && rm -f _$@

reint::
	@echo $@
	@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
	@-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@

pipeio1::
	@echo $@
	@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
	@rm -f test1 test2
	@-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@

pipeio2::
	@echo $@
	@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
	@-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@

clobber::
	@echo $@
	@$(AWK) -f $(srcdir)/clobber.awk >_$@
	@-$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
	@rm -f seq

arynocls::
	@echo $@
	@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
	@-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@

getlnbuf::
	@echo $@
	@-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@
	@-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
	@-$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@

inetmesg::
	@echo These tests only work if your system supports the services
	@echo "'discard'" at port 9 and "'daytimed'" at port 13. Check your
	@echo file /etc/services and do "'netstat -a'".

inetechu::
	@echo This test is for establishing UDP connections
	@$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}'

inetecht::
	@echo This test is for establishing TCP connections
	@$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}'

inetdayu::
	@echo This test is for bidirectional UDP transmission
	@$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \
	"/inet/udp/0/127.0.0.1/13" |& getline; print $0}'

inetdayt::
	@echo This test is for bidirectional TCP transmission
	@$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \
	"/inet/tcp/0/127.0.0.1/13" |& getline; print $0}'

redfilnm::
	@echo $@
	@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
	@-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@

leaddig::
	@echo $@
	@$(AWK) -v x=2E  -f $(srcdir)/leaddig.awk >_$@
	@-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@

gsubtst3::
	@echo $@
	@$(AWK) --re-interval -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

space::
	@echo $@
	@$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

printf0::
	@echo $@
	@$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

rsnulbig::
	@echo $@
	@ : Suppose that block size for pipe is at most 128kB:
	@$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print "abcdefgh123456\n" }' 2>&1 | \
	$(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \
	$(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

rsnulbig2::
	@echo $@
	@$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n n); \
		for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \
		$(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \
		$(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

whiny::
	@echo $@
	@WHINY_USERS=1 $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

wideidx::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) -f $@.awk  < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

wideidx2::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

widesub::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

widesub2::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

widesub3::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) -f $@.awk  < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

widesub4::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

ignrcas2::
	@echo $@
	@GAWKLOCALE=en_US ; export GAWKLOCALE ; \
	$(AWK) -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

subamp::
	@echo $@
	@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
	$(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

# This test makes sure gawk exits with a zero code.
# Thus, unconditionally generate the exit code.
exitval1::
	@echo $@
	@$(AWK) -f $(srcdir)/exitval1.awk >_$@ 2>&1; echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

fsspcoln::
	@echo $@
	@$(AWK) -f $(srcdir)/$@.awk 'FS=[ :]+' $(srcdir)/$@.in >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

rsstart1::
	@echo $@
	@$(AWK) -f $(srcdir)/$@.awk $(srcdir)/rsstart1.in >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

rsstart2::
	@echo $@
	@$(AWK) -f $(srcdir)/$@.awk $(srcdir)/rsstart1.in >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

rsstart3::
	@echo $@
	@head $(srcdir)/rsstart1.in | $(AWK) -f $(srcdir)/rsstart2.awk >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

nondec2::
	@echo $@
	@$(AWK) --non-decimal-data -v a=0x1 -f $(srcdir)/$@.awk >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

nofile::
	@echo $@
	@$(AWK) '{}' no/such/file >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

binmode1::
	@echo $@
	@$(AWK) -v BINMODE=3 'BEGIN { print BINMODE }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

subi18n::
	@echo $@
	@GAWKLOCALE=en_US.UTF-8 ; $(AWK) -f $(srcdir)/$@.awk > _$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

concat4::
	@echo $@
	@GAWKLOCALE=en_US.UTF-8 ; $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

devfd1::
	@echo $@
	@$(AWK) -f $(srcdir)/$@.awk 4< $(srcdir)/devfd.in1 5< $(srcdir)/devfd.in2 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

# The program text is the '1' which will print each record. How compact can you get?
devfd2::
	@echo $@
	@$(AWK) 1 /dev/fd/4 /dev/fd/5 4< $(srcdir)/devfd.in1 5< $(srcdir)/devfd.in2 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

mixed1::
	@echo $@
	@$(AWK) -f /dev/null --source 'BEGIN {return junk}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

mtchi18n::
	@echo $@
	@GAWKLOCALE=ru_RU.UTF-8 ; export GAWKLOCALE ; \
	$(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

reint2::
	@echo $@
	@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
	AWKPATH=$(srcdir) $(AWK) --re-interval -f $@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@

localenl::
	@echo $@
	@$(srcdir)/$@.sh >_$@
	@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@



# Targets generated for other tests:
include Maketests

$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
	files=`cd "$(srcdir)" && echo *.awk *.in`; \
	$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests

clean:
	rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~

# An attempt to print something that can be grepped for in build logs
pass-fail:
	@COUNT=`ls _* 2>/dev/null | wc -l` ; \
	if test $$COUNT = 0 ; \
	then	echo ALL TESTS PASSED ; \
	else	echo $$COUNT TESTS FAILED ; \
	fi

# This target for my convenience to look at all the results
diffout:
	for i in _* ; \
	do  \
		if [ "$$i" != "_*" ]; then \
		echo ============== $$i ============= ; \
		if [ -r $${i#_}.ok ]; then \
		diff -c $${i#_}.ok $$i ; \
		else \
		diff -c $(srcdir)/$${i#_}.ok  $$i ; \
		fi ; \
		fi ; \
	done | more

# convenient way to scan valgrind results for errors
valgrind-scan:
	@echo "Scanning valgrind log files for problems:"
	@$(AWK) '\
	function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \
	  printf "\t%s\n",$$0}; \
	{$$1 = ""}; \
	/Prog and args are:/ {incmd = 1; cmd = ""; next}; \
	incmd {if (NF == 1) incmd = 0; else {cmd = (cmd $$0); next}}; \
	/ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \
	/definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \
	/possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \
	/ suppressed:/ && !/: 0 bytes in 0 blocks/ {show()}; \
	' log.[0-9]*

# This target is for testing with electric fence.
efence:
	for i in $$(ls _* | sed 's;_\(.*\);\1;') ; \
	do \
		bad=$$(wc -l < _$$i) \
		ok=$$(wc -l < $$i.ok) ; \
		if (( $$bad == $$ok + 2 )) ; \
		then \
			rm _$$i ; \
		fi ; \
	done