diff options
Diffstat (limited to 'testsuite/Makefile.tests')
-rw-r--r-- | testsuite/Makefile.tests | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/testsuite/Makefile.tests b/testsuite/Makefile.tests new file mode 100644 index 0000000..eada28d --- /dev/null +++ b/testsuite/Makefile.tests @@ -0,0 +1,158 @@ +# 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:: + $(SED) 's^@'VERSION'@^$(VERSION)^' $(srcdir)/version.gin > $@.good + $(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) |