aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
blob: 8f10d339865b52eae2301086dea5f8b5a73a9b3a (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
SHELL = /bin/sh

bigtest:        basic poundbang gawk.extensions

basic:  msg swaplns messages argarray longwrds \
        getline fstabplus compare arrayref rs fsrs rand \
        fsbs negexp asgext anchgsub splitargv awkpath nfset reparse

gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \
                badargtest

extra:  regtest inftest

poundbang::
        cp ../gawk /tmp && chmod +x poundbang && ./poundbang poundbang >tmp
        rm -f /tmp/gawk
        cmp poundbang.good tmp && rm -f tmp

msg::
        @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.'

swaplns::
        @../gawk -f swaplns.awk data >tmp
        cmp swaplns.good tmp && rm -f tmp

messages::
        @../gawk -f messages.awk >out2 2>out3
        { cmp out1.good out1 && cmp out2.good out2 && cmp out3.good out3 && rm -f out1 out2 out3; } || { test -c /dev/stdout && echo IT IS OK THAT THIS TEST FAILED; }

argarray::
        @TEST=test echo just a test | ../gawk -f argarray.awk argarray.awk - >tmp
        cmp argarray.good tmp && rm -f tmp

fstabplus::
        @echo '1                2' | ../gawk -f fstabplus >tmp
        cmp fstabplus.good tmp && rm -f tmp

fsrs::
        @../gawk -f fsrs.awk fsrs.in >tmp
        cmp fsrs.good tmp && rm -f tmp

igncfs::
        @../gawk -f igncfs.awk igncfs.in >tmp
        cmp igncfs.good tmp && rm -f tmp

longwrds::
        @../gawk -f longwrds.awk manpage | sort >tmp
        cmp longwrds.good tmp && rm -f tmp

fieldwdth::
        @echo '123456789' | ../gawk -v FIELDWIDTHS="2 3 4" '{ print $$2}' >tmp
        cmp fieldwdth.good tmp && rm -f tmp

ignrcase::
        @echo xYz | ../gawk -v IGNORECASE=1 '{ sub(/y/, ""); print}' >tmp
        cmp ignrcase.good tmp && rm -f tmp

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=`pwd`/../gawk ./regtest

posix::
        @echo '1:2,3 4' | ../gawk -f posix >tmp
        cmp posix.good tmp && rm -f tmp

manyfiles::
        @mkdir junk
        @../gawk 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >tmp
        @../gawk -f manyfiles.awk tmp tmp
        @echo "This number better be 1 ->" | tr -d '\012'
        @wc -l junk/* | ../gawk '$$1 != 2' | wc -l
        @rm -rf junk tmp

compare::
        @../gawk -f compare.awk 0 1 compare.in >tmp
        cmp compare.good tmp && rm -f tmp

arrayref::
        @../gawk -f arrayref >tmp
        cmp arrayref.good tmp && rm -f tmp

rs::
        @../gawk -v RS="" '{ print $$1, $$2}' rs.data >tmp
        cmp rs.good tmp && rm -f tmp

fsbs::
        @../gawk -v FS='\' '{ print $$1, $$2 }' fsbs.in >tmp
        cmp fsbs.good tmp && rm -f tmp

inftest::
        @echo This test is very machine specific...
        @../gawk -f inftest.awk >tmp
        cmp inftest.good tmp && rm -f tmp

getline::
        @../gawk -f getline.awk getline.awk getline.awk >tmp
        cmp getline.good tmp && rm -f tmp

rand::
        @echo The following line should just be 19 random numbers between 1 and 100
        @../gawk -f rand.awk

negexp::
        @../gawk 'BEGIN { a = -2; print 10^a }' >tmp
        cmp negexp.good tmp && rm -f tmp

asgext::
        @../gawk -f asgext.awk asgext.in >tmp
        cmp asgext.good tmp && rm -f tmp

anchgsub::
        @../gawk -f anchgsub.awk anchgsub.in >tmp
        cmp anchgsub.good tmp && rm -f tmp

splitargv::
        @../gawk -f splitargv.awk splitargv.in >tmp
        cmp splitargv.good tmp && rm -f tmp

awkpath::
        @AWKPATH=".:lib" ../gawk -f awkpath.awk >tmp
        cmp awkpath.good tmp && rm -f tmp

nfset::
        @../gawk -f nfset.awk nfset.in >tmp
        cmp nfset.good tmp && rm -f tmp

reparse::
        @../gawk -f reparse.awk reparse.in >tmp
        cmp reparse.good tmp && rm -f tmp

argtest::
        @../gawk -f argtest.awk -x -y abc >tmp
        cmp argtest.good tmp && rm -f tmp

badargtest::
        @-../gawk -f 2>&1 | grep -v patchlevel > tmp
        cmp badargs.good tmp && rm -f tmp

clean:
        rm -f tmp core