Blame


1 3096da4e 2021-10-07 op # tests to run as a port of the regression suite. Leave empty to run
2 3096da4e 2021-10-07 op # all.
3 3096da4e 2021-10-07 op TESTS=
4 3096da4e 2021-10-07 op
5 4b93be28 2022-10-31 op DISTFILES = Makefile \
6 4b93be28 2022-10-31 op env \
7 4b93be28 2022-10-31 op err \
8 4b93be28 2022-10-31 op example.mime.types \
9 4b93be28 2022-10-31 op fcgi-test.c \
10 4b93be28 2022-10-31 op fill-file.c \
11 4b93be28 2022-10-31 op hello \
12 4b93be28 2022-10-31 op invalid \
13 4b93be28 2022-10-31 op iri_test.c \
14 4b93be28 2022-10-31 op lib.sh \
15 4b93be28 2022-10-31 op max-length-reply \
16 4b93be28 2022-10-31 op puny-test.c \
17 4b93be28 2022-10-31 op regress \
18 4b93be28 2022-10-31 op serve-bigfile \
19 4b93be28 2022-10-31 op slow \
20 4b93be28 2022-10-31 op tests.sh \
21 4b93be28 2022-10-31 op valid.ext
22 4b93be28 2022-10-31 op
23 1610f954 2023-06-13 op include ../config.mk
24 5c2e310e 2021-01-22 op
25 1610f954 2023-06-13 op COBJS = ${COMPATS:.c=.o}
26 1610f954 2023-06-13 op REG_COMPATS = ${COBJS:%=../%}
27 96e3c013 2022-07-04 op
28 1610f954 2023-06-13 op PUNY_SRCS = puny-test.c ../puny.c ../utf8.c ../utils.c ../log.c
29 1610f954 2023-06-13 op PUNY_OBJS = ${PUNY_SRCS:.c=.o} ${REG_COMPATS}
30 1610f954 2023-06-13 op
31 1610f954 2023-06-13 op IRI_SRCS = iri_test.c ../iri.c ../utf8.c
32 1610f954 2023-06-13 op IRI_OBJS = ${IRI_SRCS:.c=.o} ${REG_COMPATS}
33 1610f954 2023-06-13 op
34 4b93be28 2022-10-31 op .PHONY: all data clean dist
35 5c2e310e 2021-01-22 op
36 a62c63f2 2021-12-29 op all: data puny-test iri_test fcgi-test
37 e5285d54 2021-12-09 op ./regress ${TESTS}
38 5c2e310e 2021-01-22 op
39 5741561d 2021-12-09 op data: testdata cert.pem testca.pem valid.crt invalid.cert.pem
40 0f2124e2 2021-06-12 op
41 1610f954 2023-06-13 op puny-test: ${PUNY_OBJS}
42 1610f954 2023-06-13 op ${CC} ${PUNY_OBJS} -o puny-test ${LIBS} ${LDFLAGS}
43 3300cbe0 2021-01-27 op
44 1610f954 2023-06-13 op iri_test: ${IRI_OBJS}
45 1610f954 2023-06-13 op ${CC} ${IRI_OBJS} -o $@ ${LIBS} ${LDFLAGS}
46 5c2e310e 2021-01-22 op
47 609fc9f9 2021-01-22 op fill-file: fill-file.o
48 1610f954 2023-06-13 op ${CC} fill-file.o -o $@ ${LIBS} ${LDFLAGS}
49 609fc9f9 2021-01-22 op
50 0f2124e2 2021-06-12 op fcgi-test: fcgi-test.o
51 1610f954 2023-06-13 op ${CC} fcgi-test.o ${REG_COMPATS} -o fcgi-test ${LIBS} ${LDFLAGS}
52 0f2124e2 2021-06-12 op
53 5c2e310e 2021-01-22 op key.pem: cert.pem
54 5c2e310e 2021-01-22 op
55 5c2e310e 2021-01-22 op # XXX: key size is NOT GOOD. This is only for testing. Smaller keys
56 5c2e310e 2021-01-22 op # are quicker to generate. DON'T DO THIS AT HOME.
57 5c2e310e 2021-01-22 op cert.pem:
58 7322a054 2021-07-03 op openssl req -x509 -newkey rsa:2048 \
59 7322a054 2021-07-03 op -keyout key.pem \
60 7322a054 2021-07-03 op -out cert.pem \
61 7322a054 2021-07-03 op -days 365 -nodes \
62 7322a054 2021-07-03 op -subj "/CN=localhost"
63 3e0164f4 2021-07-19 op ln -s cert.pem localhost.cert.pem
64 3e0164f4 2021-07-19 op ln -s key.pem localhost.key.pem
65 5c2e310e 2021-01-22 op @echo
66 5c2e310e 2021-01-22 op
67 02be96c6 2021-02-09 op testca.pem:
68 02be96c6 2021-02-09 op openssl genrsa -out testca.key 2048
69 7322a054 2021-07-03 op openssl req -x509 -new -sha256 \
70 7322a054 2021-07-03 op -key testca.key \
71 7322a054 2021-07-03 op -days 365 -nodes \
72 7322a054 2021-07-03 op -out testca.pem \
73 7322a054 2021-07-03 op -subj "/CN=testca"
74 02be96c6 2021-02-09 op @echo
75 02be96c6 2021-02-09 op
76 02be96c6 2021-02-09 op valid.crt: testca.pem
77 02be96c6 2021-02-09 op openssl genrsa -out valid.key 2048
78 7322a054 2021-07-03 op openssl req -new -key valid.key \
79 7322a054 2021-07-03 op -out valid.csr \
80 7322a054 2021-07-03 op -subj "/CN=valid"
81 02be96c6 2021-02-09 op @echo
82 02be96c6 2021-02-09 op openssl x509 -req -in valid.csr \
83 02be96c6 2021-02-09 op -CA testca.pem \
84 02be96c6 2021-02-09 op -CAkey testca.key \
85 02be96c6 2021-02-09 op -CAcreateserial \
86 02be96c6 2021-02-09 op -out valid.crt \
87 02be96c6 2021-02-09 op -days 365 \
88 02be96c6 2021-02-09 op -sha256 -extfile valid.ext
89 02be96c6 2021-02-09 op
90 02be96c6 2021-02-09 op invalid.cert.pem: cert.pem
91 02be96c6 2021-02-09 op cp cert.pem invalid.cert.pem
92 02be96c6 2021-02-09 op cp key.pem invalid.key.pem
93 02be96c6 2021-02-09 op
94 5c2e310e 2021-01-22 op clean:
95 5c2e310e 2021-01-22 op rm -f *.o iri_test cert.pem key.pem
96 3e0164f4 2021-07-19 op rm -f localhost.cert.pem localhost.key.pem
97 c2899486 2021-10-02 op rm -f testca.* valid.csr valid.key valid.crt invalid.*pem
98 a62c63f2 2021-12-29 op rm -rf testdata fill-file puny-test fcgi-test
99 d273c064 2023-06-09 op rm -f gmid.pid fcgi.sock
100 5c2e310e 2021-01-22 op
101 609fc9f9 2021-01-22 op testdata: fill-file
102 5c2e310e 2021-01-22 op mkdir testdata
103 609fc9f9 2021-01-22 op ./fill-file testdata/bigfile
104 5c2e310e 2021-01-22 op printf "# hello world\n" > testdata/index.gmi
105 e3ddf390 2021-02-06 op cp hello slow err invalid serve-bigfile env testdata/
106 c836cdfa 2021-03-29 op cp max-length-reply testdata
107 5c2e310e 2021-01-22 op mkdir testdata/dir
108 475205fa 2022-07-04 op date > 'testdata/dir/current date'
109 c8b74339 2021-01-24 op cp hello testdata/dir
110 5c2e310e 2021-01-22 op cp testdata/index.gmi testdata/dir/foo.gmi
111 fb121226 2022-02-26 op touch testdata/test.m3u8 testdata/foo.1
112 4b93be28 2022-10-31 op
113 4b93be28 2022-10-31 op dist: ${DISTFILES}
114 4b93be28 2022-10-31 op mkdir -p ${DESTDIR}/
115 4b93be28 2022-10-31 op ${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
116 4b93be28 2022-10-31 op cd ${DESTDIR}/ && chmod +x env err hello invalid \
117 611dffe8 2023-06-13 op max-length-reply regress slow