1 # tests to run as a port of the regression suite. Leave empty to run
5 include ../Makefile.local
7 .PHONY: all data clean regres
9 all: data gg puny-test iri_test fcgi-test
12 data: testdata cert.pem testca.pem valid.crt invalid.cert.pem
14 gg: gg.o ../iri.o ../utf8.o ${COMPAT}
15 ${CC} gg.o ../iri.o ../utf8.o ${COMPAT} -o $@ ${LDFLAGS}
17 puny-test: puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT}
18 ${CC} puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT} \
19 -o puny-test ${LDFLAGS}
21 iri_test: iri_test.o ../iri.o ../utf8.o ${COMPAT}
22 ${CC} iri_test.o ../iri.o ../utf8.o ${COMPAT} -o $@ ${LDFLAGS}
24 fill-file: fill-file.o
25 ${CC} fill-file.o -o $@ ${LDFLAGS}
27 fcgi-test: fcgi-test.o
28 ${CC} fcgi-test.o ${COMPAT} -o fcgi-test ${LDFLAGS}
32 # XXX: key size is NOT GOOD. This is only for testing. Smaller keys
33 # are quicker to generate. DON'T DO THIS AT HOME.
35 openssl req -x509 -newkey rsa:2048 \
40 ln -s cert.pem localhost.cert.pem
41 ln -s key.pem localhost.key.pem
45 openssl genrsa -out testca.key 2048
46 openssl req -x509 -new -sha256 \
54 openssl genrsa -out valid.key 2048
55 openssl req -new -key valid.key \
59 openssl x509 -req -in valid.csr \
65 -sha256 -extfile valid.ext
67 invalid.cert.pem: cert.pem
68 cp cert.pem invalid.cert.pem
69 cp key.pem invalid.key.pem
72 rm -f *.o iri_test cert.pem key.pem
73 rm -f localhost.cert.pem localhost.key.pem
74 rm -f testca.* valid.csr valid.key valid.crt invalid.*pem
75 rm -rf testdata fill-file puny-test gg fcgi-test
80 ./fill-file testdata/bigfile
81 ./sha testdata/bigfile testdata/bigfile.sha
82 printf "# hello world\n" > testdata/index.gmi
83 ./sha testdata/index.gmi testdata/index.gmi.sha
84 cp hello slow err invalid serve-bigfile env testdata/
85 cp max-length-reply testdata
88 cp testdata/index.gmi testdata/dir/foo.gmi