1 # tests to run as a port of the regression suite. Leave empty to run
5 # host to bind to during regress
6 REGRESS_HOST = localhost
28 COBJS = ${COMPATS:.c=.o}
29 REG_COMPATS = ${COBJS:%=../%}
31 PUNY_SRCS = puny-test.c ../puny.c ../utf8.c ../utils.c ../log.c
32 PUNY_OBJS = ${PUNY_SRCS:.c=.o} ${REG_COMPATS}
34 IRI_SRCS = iri_test.c ../iri.c ../utf8.c
35 IRI_OBJS = ${IRI_SRCS:.c=.o} ${REG_COMPATS}
37 .PHONY: all data clean dist
39 all: data puny-test iri_test fcgi-test
40 env REGRESS_HOST="${REGRESS_HOST}" ./regress ${TESTS}
42 data: testdata cert.pem testca.pem valid.crt invalid.cert.pem
44 puny-test: ${PUNY_OBJS}
45 ${CC} ${PUNY_OBJS} -o puny-test ${LIBS} ${LDFLAGS}
48 ${CC} ${IRI_OBJS} -o $@ ${LIBS} ${LDFLAGS}
50 fill-file: fill-file.o
51 ${CC} fill-file.o -o $@ ${LIBS} ${LDFLAGS}
53 fcgi-test: fcgi-test.o
54 ${CC} fcgi-test.o ${REG_COMPATS} -o fcgi-test ${LIBS} ${LDFLAGS}
58 # XXX: key size is NOT GOOD. This is only for testing. Smaller keys
59 # are quicker to generate. DON'T DO THIS AT HOME.
61 openssl req -x509 -newkey rsa:2048 \
66 ln -s cert.pem localhost.cert.pem
67 ln -s key.pem localhost.key.pem
71 openssl genrsa -out testca.key 2048
72 openssl req -x509 -new -sha256 \
80 openssl genrsa -out valid.key 2048
81 openssl req -new -key valid.key \
85 openssl x509 -req -in valid.csr \
91 -sha256 -extfile valid.ext
93 invalid.cert.pem: cert.pem
94 cp cert.pem invalid.cert.pem
95 cp key.pem invalid.key.pem
98 rm -f *.o iri_test cert.pem key.pem
99 rm -f localhost.cert.pem localhost.key.pem
100 rm -f testca.* valid.csr valid.key valid.crt invalid.*pem
101 rm -rf testdata fill-file puny-test fcgi-test
102 rm -f gmid.pid fcgi.sock
106 ./fill-file testdata/bigfile
107 printf "# hello world\n" > testdata/index.gmi
108 cp hello slow err invalid serve-bigfile env testdata/
109 cp max-length-reply testdata
111 date > 'testdata/dir/current date'
112 cp hello testdata/dir
113 cp testdata/index.gmi testdata/dir/foo.gmi
114 touch testdata/test.m3u8 testdata/foo.1
118 ${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
119 cd ${DESTDIR}/ && chmod +x env err hello invalid \
120 max-length-reply regress slow