summaryrefslogtreecommitdiff
path: root/testsuite/Makefile.tests
blob: 922956411a5707f6b777b155298308daf299cfc6 (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
# Testsuite makefile for GNU sed

SHELL = /bin/sh

# These are only fallback values. They are usually overridden by runtest.
srcdir = .
SED = ../sed/sed
SEDENV = LC_ALL=C $(TIME)

#TIME=time
CMP=cmp
RM=rm -f

enable sep inclib 8bit 8to7 newjis xabcx dollar noeol bkslashes \
numsub head madding mac-mf empty xbxcx xbxcx3 recall recall2 xemacs \
appquit fasts uniq manis linecnt khadafy allsub flipcase space modulo \
y-bracket y-newline::
	$(SEDENV) $(SED) -f $(srcdir)/$@.sed \
		< $(srcdir)/$@.inp > $@.out 
	$(CMP) $(srcdir)/$@.good $@.out 
	@$(RM) $@.out 

0range::
	$(SEDENV) $(SED) -s -f $(srcdir)/$@.sed < $(srcdir)/$@.inp > $@.out 
	$(CMP) $(srcdir)/$@.good $@.out 
	@$(RM) $@.out 

# This checks for a bug in 3.02 and 3.02.80
stdin::
	($(SEDENV) $(SED) d; $(SEDENV) $(SED) G) < $(srcdir)/numsub.inp > $@.1out 
	$(SEDENV) cat $(srcdir)/numsub.inp | ($(SEDENV) $(SED) d; $(SEDENV) $(SED) G) > $@.2out 
	$(CMP) $@.1out $@.2out 
	@$(RM) $@.1out $@.2out 

cv-vars classes middle dc distrib factor numsub2 numsub3 numsub4 numsub5 \
insens::
	$(SEDENV) $(SED) -n -f $(srcdir)/$@.sed < $(srcdir)/$@.inp > $@.out 
	$(CMP) $(srcdir)/$@.good $@.out 
	@$(RM) $@.out 

noeolw::
	$(SEDENV) $(SED) -n -f $(srcdir)/$@.sed \
	  $(srcdir)/noeol.inp $(srcdir)/noeol.inp > $@.out 
	$(CMP) $(srcdir)/$@.good $@.out 
	$(CMP) $(srcdir)/$@.1good $@.1out
	$(CMP) $(srcdir)/$@.2good $@.2out
	@$(RM) $@.1out $@.2out $@.out

subwrite::
	$(SEDENV) $(SED) -f $(srcdir)/$@.sed < $(srcdir)/$@.inp > $@.1out 
	$(CMP) $(srcdir)/subwrt1.good $@.1out 
	$(CMP) $(srcdir)/subwrt2.good $@.wout
	@$(RM) $@.1out $@.wout

bsd::
	$(SEDENV) sh $(srcdir)/$@.sh '$(SED)' bsd.out
	$(CMP) $(srcdir)/$@.good $@.out 
	@$(RM) $@.out 

writeout::
	$(SEDENV) $(SED) -f $(srcdir)/$@.sed < $(srcdir)/$@.inp >$@.1out 
	$(CMP) $(srcdir)/wrtout1.good $@.1out 
	$(CMP) $(srcdir)/wrtout2.good $@.wout
	@$(RM) $@.1out $@.wout

readin.in2: $(srcdir)/readin.in2
	cat $(srcdir)/readin.in2 > $@

readin:: readin.in2
	$(SEDENV) $(SED) -f $(srcdir)/$@.sed < $(srcdir)/$@.inp >$@.out 
	$(CMP) $(srcdir)/$@.good $@.out 
	@$(RM) $@.out 

eval.in2: $(srcdir)/eval.inp
	cat $(srcdir)/eval.inp > $@

eval:: eval.in2
	$(SEDENV) $(SED) -f $(srcdir)/$@.sed < $(srcdir)/$@.inp > $@.out 
	$(CMP) $(srcdir)/$@.good $@.out 
	@$(RM) $@.out 

binary binary2 binary3::
	$(SEDENV) $(SED) -n -f $(srcdir)/$@.sed < $(srcdir)/binary.inp >$@.out 
	$(CMP) $(srcdir)/binary.good $@.out 
	@$(RM) $@.out 

#
# cmdlines targets
#

help::
	$(SED) --help | $(SED) '1s/ [^ ]* / sed /' > $@.1out 
	$(SED) 2>&1 | $(SED) '1s/ [^ ]* / sed /' > $@.2out || :
	$(CMP) $@.1out $@.2out 
	@$(RM) $@.1out $@.2out

version::
	$(SEDENV) $(SED) --version > $@.out 2>&1
	$(CMP) $@.good $@.out 
	@$(RM) $@.good $@.out

file::
	$(SEDENV) $(SED) --file=$(srcdir)/newjis.sed \
		< $(srcdir)/newjis.inp > $@.out 
	$(CMP) $(srcdir)/newjis.good $@.out 
	@$(RM) $@.out 

quiet::
	$(SEDENV) $(SED) --quiet -f $(srcdir)/cv-vars.sed \
		< $(srcdir)/cv-vars.inp > $@.out 
	$(CMP) $(srcdir)/cv-vars.good $@.out 
	@$(RM) $@.out 

# The following target is not used in super sed builds (only GNU sed)

bug-regex7$(EXEEXT) bug-regex8$(EXEEXT) bug-regex9$(EXEEXT) \
bug-regex10$(EXEEXT) bug-regex11$(EXEEXT) bug-regex12$(EXEEXT) \
bug-regex13$(EXEEXT) bug-regex14$(EXEEXT) bug-regex15$(EXEEXT) bug-regex16$(EXEEXT) \
bug-regex21$(EXEEXT) runtests$(EXEEXT) runptests$(EXEEXT)::
	echo "$(SEDENV) ./$@ > `echo $@ | $(SED) s/$(EXEEXT)$$/.log/`"
	@$(SEDENV) ./$@ > `echo $@ | $(SED) s/$(EXEEXT)$$/.log/`

tst-pcre$(EXEEXT)::
	$(SEDENV) ./tst-pcre $(srcdir)/PCRE.tests > tst-pcre.log

tst-boost$(EXEEXT)::
	$(SEDENV) ./tst-boost $(srcdir)/BOOST.tests > tst-boost.log

tst-rxspencer$(EXEEXT)::
	$(SEDENV) ./tst-rxspencer $(srcdir)/SPENCER.tests > tst-spencer.log

tst-regex2$(EXEEXT)::
	$(SEDENV) ./tst-regex2 $(srcdir)/tst-regex2.c > tst-regex2.log

# The following target is not used in GNU sed builds (only super-sed)

pcretest$(EXEEXT)::
	$(SEDENV) ./pcretest $(srcdir)/pcre1.inp pcre1.out
	$(CMP) $(srcdir)/pcre1.good pcre1.out
	#$(SEDENV) ./pcretest -p $(srcdir)/pcre1.inp pcre1p.out
	#$(CMP) $(srcdir)/pcre1p.good pcre1p.out
	$(SEDENV) ./pcretest -P $(srcdir)/pcre2.inp pcre2.out
	$(CMP) $(srcdir)/pcre2.good pcre2.out
	$(SEDENV) ./pcretest -P -p $(srcdir)/pcre2.inp pcre2p.out
	$(CMP) $(srcdir)/pcre2p.good pcre2p.out
	$(SEDENV) ./pcretest $(srcdir)/pcre3.inp pcre3.out
	$(CMP) $(srcdir)/pcre3.good pcre3.out
	$(SEDENV) ./pcretest -p $(srcdir)/pcre3.inp pcre3p.out
	$(CMP) $(srcdir)/pcre3p.good pcre3p.out
	@$(RM) pcre*.out

.PHONY: \
bug-regex7$(EXEEXT) bug-regex8$(EXEEXT) bug-regex9$(EXEEXT) \
bug-regex10$(EXEEXT) bug-regex11$(EXEEXT) bug-regex12$(EXEEXT) \
bug-regex13$(EXEEXT) bug-regex14$(EXEEXT) bug-regex15$(EXEEXT) bug-regex16$(EXEEXT) \
bug-regex21$(EXEEXT) runtests$(EXEEXT) runptests$(EXEEXT) tst-regex2$(EXEEXT) \
tst-pcre$(EXEEXT) tst-boost$(EXEEXT) tst-rxspencer$(EXEEXT) pcretest$(EXEEXT)