1 # tests to run as a port of the regression suite. Leave empty to run
5 include ../Makefile.local
7 COMPAT= ${COBJS:%=../%}
9 .PHONY: all data clean regress
11 all: data puny-test iri_test fcgi-test
14 data: testdata cert.pem testca.pem valid.crt invalid.cert.pem
16 puny-test: puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT}
17 ${CC} puny-test.o ../puny.o ../utf8.o ../utils.o ../log.o ${COMPAT} \
18 -o puny-test ${LDFLAGS}
20 iri_test: iri_test.o ../iri.o ../utf8.o ${COMPAT}
21 ${CC} iri_test.o ../iri.o ../utf8.o ${COMPAT} -o $@ ${LDFLAGS}
23 fill-file: fill-file.o
24 ${CC} fill-file.o -o $@ ${LDFLAGS}
26 fcgi-test: fcgi-test.o
27 ${CC} fcgi-test.o ${COMPAT} -o fcgi-test ${LDFLAGS}
31 # XXX: key size is NOT GOOD. This is only for testing. Smaller keys
32 # are quicker to generate. DON'T DO THIS AT HOME.
34 openssl req -x509 -newkey rsa:2048 \
39 ln -s cert.pem localhost.cert.pem
40 ln -s key.pem localhost.key.pem
44 openssl genrsa -out testca.key 2048
45 openssl req -x509 -new -sha256 \
53 openssl genrsa -out valid.key 2048
54 openssl req -new -key valid.key \
58 openssl x509 -req -in valid.csr \
64 -sha256 -extfile valid.ext
66 invalid.cert.pem: cert.pem
67 cp cert.pem invalid.cert.pem
68 cp key.pem invalid.key.pem
71 rm -f *.o iri_test cert.pem key.pem
72 rm -f localhost.cert.pem localhost.key.pem
73 rm -f testca.* valid.csr valid.key valid.crt invalid.*pem
74 rm -rf testdata fill-file puny-test fcgi-test
79 ./fill-file testdata/bigfile
80 ./sha testdata/bigfile testdata/bigfile.sha
81 printf "# hello world\n" > testdata/index.gmi
82 ./sha testdata/index.gmi testdata/index.gmi.sha
83 cp hello slow err invalid serve-bigfile env testdata/
84 cp max-length-reply testdata
86 date > 'testdata/dir/current date'
88 cp testdata/index.gmi testdata/dir/foo.gmi
89 touch testdata/test.m3u8 testdata/foo.1