-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
190 lines (155 loc) · 7.33 KB
/
Copy pathMakefile
File metadata and controls
190 lines (155 loc) · 7.33 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
.PHONY: all lisp-bomberman lisp-airhockey lisp-jumpnbump lisp-pong lisp-tictactoe lisp-gofish gateway test test-all test-e2e clean setup test-lisp test-gateway test-bomberman-cross test-airhockey-cross test-airhockey-prediction test-jnb-cross test-pong-cross test-tictactoe test-gofish test-fixed-point test-bomberman-unit test-bomberman-respawn test-bomberman-stress benchmark check-lisp check-parens alive-lsp kill-servers kill-game kill-gateway
all: lisp-bomberman gateway
setup:
sbcl --eval "(ql:quickload :fset)" --eval "(ql:quickload :usocket)" --quit
cd gateway && go mod download
alive-lsp: build-lsp-client
sbcl --script tools/alive-tcp-server.lisp
build-lsp-client:
cd tools/lsp-client && go build -o lsp-client .
check-parens:
go run scripts/check-parens.go src/*.lisp src/games/*.lisp
check-lisp:
sbcl --non-interactive \
--load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(uiop:quit)"
gateway:
cd gateway && go run main.go $(ARGS)
lisp-bomberman:
sbcl --load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(let* ((level (foldback:make-bomberman-map)) (bots (foldback:spawn-bots level 3))) (foldback:start-server :game-id \"bomberman\" :simulation-fn #'foldback:bomberman-update :serialization-fn #'foldback:bomberman-serialize :join-fn #'foldback:bomberman-join :initial-custom-state (fset:map (:level level) (:bots bots) (:seed 123))))"
lisp-airhockey:
sbcl --load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(foldback:start-server :game-id \"airhockey\" :simulation-fn #'foldback:airhockey-update :serialization-fn #'foldback:airhockey-serialize :join-fn #'foldback:airhockey-join)"
lisp-jumpnbump:
sbcl --load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(foldback:start-server :game-id \"jumpnbump\" :simulation-fn #'foldback:jnb-update :serialization-fn #'foldback:jnb-serialize :join-fn #'foldback:jnb-join :initial-custom-state (fset:map (:seed 123)))"
lisp-pong:
sbcl --load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(foldback:start-server :game-id \"pong\" :simulation-fn #'foldback:pong-update :serialization-fn #'foldback:pong-serialize :join-fn #'foldback:pong-join)"
lisp-gofish:
sbcl --load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(foldback:start-server :game-id \"gofish\" :simulation-fn #'foldback:gf-update :serialization-fn #'foldback:gf-serialize :join-fn #'foldback:gf-join :tick-rate 10 :initial-custom-state (fset:map (:seed 12345)))"
lisp-tictactoe:
sbcl --load foldback.asd \
--eval "(ql:quickload :foldback)" \
--eval "(foldback:start-server :game-id \"tictactoe\" :simulation-fn #'foldback:ttt-update :serialization-fn #'foldback:ttt-serialize :join-fn #'foldback:ttt-join :tick-rate 10)"
test: test-lisp test-gateway test-engine test-server-flow test-bomberman-cross test-airhockey-cross test-airhockey-prediction test-jnb-cross test-pong-cross test-tictactoe test-gofish
test-lisp:
sbcl --non-interactive \
--load foldback.asd \
--eval "(ql:quickload :foldback)" \
--load tests/bomberman-rollback-test.lisp \
--load tests/physics-test.lisp \
--eval "(uiop:quit)"
test-gateway:
cd gateway && go test -v ./...
test-engine:
@echo "--- Running Engine Reconciliation Tests (JS) ---"
node tests/engine-test.js
test-server-flow:
@echo "--- Running Server Flow Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/server-flow-test.lisp
test-bomberman-cross:
@echo "--- Running Bomberman Cross-Platform Tests ---"
node tests/bomberman-cross-test.js
@echo "\n--- Running Bomberman Cross-Platform Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/bomberman-cross-test.lisp
test-airhockey-cross:
@echo "--- Running Air Hockey Cross-Platform Tests (JS) ---"
node tests/airhockey-cross-test.js
@echo "\n--- Running Air Hockey Cross-Platform Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/airhockey-cross-test.lisp
test-airhockey-prediction:
@echo "--- Running Air Hockey Late-Input Rollback Test (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/airhockey-prediction-test.lisp
test-jnb-cross:
@echo "--- Running Jump and Bump Cross-Platform Tests (JS) ---"
node tests/jumpnbump-cross-test.js
@echo "\n--- Running Jump and Bump Cross-Platform Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/jumpnbump-cross-test.lisp
test-pong-cross:
@echo "--- Running Pong Cross-Platform Tests (JS) ---"
node tests/pong-cross-test.js
@echo "\n--- Running Pong Cross-Platform Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/pong-cross-test.lisp
test-tictactoe:
@echo "--- Running Tic-Tac-Toe Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/tictactoe-test.lisp
@echo "\n--- Running Tic-Tac-Toe Cross-Platform Tests (JS) ---"
node tests/tictactoe-cross-test.js
test-gofish:
@echo "--- Running Go Fish Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/gofish-test.lisp \
--load tests/gofish-serialize-dump.lisp
@echo "\n--- Running Go Fish Cross-Platform Tests (JS) ---"
node tests/gofish-cross-test.js
test-fixed-point:
@echo "--- Running Fixed-Point Cross-Platform Tests (JS) ---"
node tests/fixed-point-cross-test.js
@echo "\n--- Running Fixed-Point Cross-Platform Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/fixed-point-cross-test.lisp
test-bomberman-unit:
@echo "--- Running Bomberman Unit Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/bomberman-unit-test.lisp
test-bomberman-respawn:
@echo "--- Running Bomberman Respawn Tests (Lisp) ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/bomberman-respawn-test.lisp
test-bomberman-stress:
@echo "--- Running Bomberman Stress Test ---"
sbcl --non-interactive \
--eval "(asdf:load-asd (truename \"foldback.asd\"))" \
--eval "(ql:quickload :foldback)" \
--load tests/bomberman-stress-test.lisp
test-e2e:
@echo "--- Running Playwright E2E Tests (all games) ---"
bash tests/run-e2e.sh
test-all: test-lisp test-gateway test-fixed-point test-bomberman-unit test-bomberman-respawn test-bomberman-cross test-airhockey-cross test-airhockey-prediction test-jnb-cross test-pong-cross test-bomberman-stress test-e2e
kill-game:
-pkill -f "sbcl.*foldback"
kill-gateway:
-lsof -ti :8080 | xargs -r kill
kill-servers: kill-game kill-gateway
benchmark:
sbcl --non-interactive \
--load foldback.asd \
--load tests/performance-bench.lisp