-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
76 lines (64 loc) · 2.43 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# $Id: Makefile,v 1.3 2007/10/29 22:50:16 carregal Exp $
DESTDIR ?=
# Default prefix
PREFIX ?= /usr/local
# System's lua directory (where Lua libraries are installed)
LUA_DIR ?= $(PREFIX)/share/lua/5.1
DELIM=-e "print(([[=]]):rep(70))"
PKGPATH=-e "package.path='src/?.lua;'..package.path"
# Lua interpreter
LUA=lua
.PHONY: certs
install:
mkdir -p $(DESTDIR)$(LUA_DIR)/copas
cp src/copas.lua $(DESTDIR)$(LUA_DIR)/copas.lua
cp src/copas/ftp.lua $(DESTDIR)$(LUA_DIR)/copas/ftp.lua
cp src/copas/smtp.lua $(DESTDIR)$(LUA_DIR)/copas/smtp.lua
cp src/copas/http.lua $(DESTDIR)$(LUA_DIR)/copas/http.lua
cp src/copas/timer.lua $(DESTDIR)$(LUA_DIR)/copas/timer.lua
cp src/copas/lock.lua $(DESTDIR)$(LUA_DIR)/copas/lock.lua
cp src/copas/semaphore.lua $(DESTDIR)$(LUA_DIR)/copas/semaphore.lua
cp src/copas/queue.lua $(DESTDIR)$(LUA_DIR)/copas/queue.lua
tests/certs/clientA.pem:
cd ./tests/certs && \
./rootA.sh && \
./rootB.sh && \
./serverA.sh && \
./serverB.sh && \
./clientA.sh && \
./clientB.sh && \
cd ../..
certs: tests/certs/clientA.pem
test: certs
$(LUA) $(DELIM) $(PKGPATH) tests/close.lua
$(LUA) $(DELIM) $(PKGPATH) tests/connecttwice.lua
$(LUA) $(DELIM) $(PKGPATH) tests/errhandlers.lua
$(LUA) $(DELIM) $(PKGPATH) tests/exit.lua
$(LUA) $(DELIM) $(PKGPATH) tests/exittest.lua
$(LUA) $(DELIM) $(PKGPATH) tests/http-timeout.lua
$(LUA) $(DELIM) $(PKGPATH) tests/httpredirect.lua
$(LUA) $(DELIM) $(PKGPATH) tests/largetransfer.lua
$(LUA) $(DELIM) $(PKGPATH) tests/lock.lua
$(LUA) $(DELIM) $(PKGPATH) tests/loop_starter.lua
$(LUA) $(DELIM) $(PKGPATH) tests/no_luasocket.lua
$(LUA) $(DELIM) $(PKGPATH) tests/pause.lua
$(LUA) $(DELIM) $(PKGPATH) tests/queue.lua
$(LUA) $(DELIM) $(PKGPATH) tests/removeserver.lua
$(LUA) $(DELIM) $(PKGPATH) tests/removethread.lua
$(LUA) $(DELIM) $(PKGPATH) tests/request.lua 'http://www.google.com'
$(LUA) $(DELIM) $(PKGPATH) tests/request.lua 'https://www.google.nl' true
$(LUA) $(DELIM) $(PKGPATH) tests/semaphore.lua
$(LUA) $(DELIM) $(PKGPATH) tests/starve.lua
$(LUA) $(DELIM) $(PKGPATH) tests/tcptimeout.lua
$(LUA) $(DELIM) $(PKGPATH) tests/timer.lua
$(LUA) $(DELIM) $(PKGPATH) tests/timeout_errors.lua
$(LUA) $(DELIM) $(PKGPATH) tests/tls-sni.lua
$(LUA) $(DELIM) $(PKGPATH) tests/udptimeout.lua
$(LUA) $(DELIM)
coverage:
$(RM) luacov.stats.out
$(MAKE) test LUA="$(LUA) -lluacov"
luacov
clean:
$(RM) luacov.stats.out luacov.report.out
$(RM) tests/certs/*.pem tests/certs/*.srl