Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
312 lines (263 loc) · 12.5 KB
/
Copy pathMakefile
File metadata and controls
312 lines (263 loc) · 12.5 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# Targets
.PHONY: test test-all test-unit test-integration test-game-startup test-zork1 test-zork2 test-parser test-containers test-directions test-light test-pronouns test-take test-turnbit test-clock test-clock-direct test-assertions test-check-commands test-read-mailbox test-walk-around-house test-horror-helpers test-horror test-horror-failures test-horror-playtest-regressions test-horror-all test-limehouse-walkthrough test-wondertown-descriptions test-pure-zil test-simple-new test-insert-file test-let test-save test-llm help llm-new llm-look test-zilch test-flow-control lint-zil zip limehouse-killings blackwood-horror wondertown
help:
@echo "Available targets:"
@echo " run-text - Run the game in text mode"
@echo " llm-new - Start a new LLM game session"
@echo " llm-look - Look around in LLM mode"
@echo ""
@echo "Test targets:"
@echo " test - Run all tests (unit + integration)"
@echo " test-all - Alias for 'test'"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run all integration tests"
@echo " test-zork1 - Run Zork1 integration tests"
@echo " test-zork2 - Run Zork2 integration tests"
@echo " test-game-startup - Start Lurking Horror and Spellbreaker"
@echo " test-parser - Run all parser/runtime tests"
@echo " test-pure-zil - Run pure ZIL tests (using ASSERT functions)"
@echo ""
@echo "Individual parser/runtime tests:"
@echo " test-containers - Run container interaction tests"
@echo " test-directions - Run direction/movement tests"
@echo " test-light - Run light source tests"
@echo " test-pronouns - Run pronoun tests"
@echo " test-take - Run TAKE command tests"
@echo " test-turnbit - Run TURNBIT flag tests"
@echo " test-clock - Run clock system tests"
@echo " test-clock-direct - Run clock system direct tests"
@echo " test-assertions - Run assertion tests"
@echo " test-check-commands - Run check commands tests"
@echo " test-read-mailbox - Run Zork I mailbox/read regression"
@echo " test-walk-around-house - Run forward ACTION routine regression"
@echo " test-simple-new - Run simple assertion tests"
@echo " test-insert-file - Run INSERT-FILE tests"
@echo " test-let - Run LET form tests"
@echo " test-save - Run save/restore tests"
@echo " test-llm - Run LLM persistence tests"
@echo " test-limehouse-walkthrough - Run Limehouse golden-path LLM test"
@echo " test-wondertown-descriptions - Run Wondertown rendered description regressions"
@echo " test-book-walkthroughs - Run story walkthroughs and companion tests"
@echo " test-meridian-scope - Check room and item coverage in Blackout at Meridian"
@echo " lint-zil - Check vocabulary and command responses"
@echo ""
@echo "Horror game tests:"
@echo " test-horror-helpers - Run horror test helpers"
@echo " - Run horror partial walkthrough"
@echo " test-horror-playtest-regressions - Run isolated Blackwood playtest regressions"
@echo " test-horror-failures - Run horror failing conditions tests"
@echo " test-horror - Run horror complete walkthrough"
@echo " test-horror-all - Run all horror tests"
@echo ""
@echo "Packaging targets:"
@echo " zip <gamename> - Create a zip of a book and its shared ZIL packages (e.g. make zip limehouse-killings)"
@echo ""
run-text:
lua main.lua
# LLM mode targets
llm-new:
@lua5.4 llm.lua --new-game --save savefile.sav
llm-look:
@lua5.4 llm.lua --action "look" --save savefile.sav
# Test targets
test: test-unit test-integration
@echo "All tests completed successfully!"
test-all: test
@echo "All tests completed successfully!"
test-unit:
@echo "Running unit tests..."
lua tests/run_all.lua
test-integration: test-adventure-packages test-new-books test-zork1 test-zork2 test-game-startup test-parser test-horror-all test-limehouse-walkthrough test-wondertown-descriptions test-book-playtests test-book-walkthroughs
@echo "All integration tests completed!"
test-zork1:
@echo "Running Zork1 integration tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/zork1-walkthrough
test-zork2:
@echo "Running Zork2 integration tests..."
@lua5.4 run-zil-test.lua infocom/zork2/test/test-auto-generated
test-game-startup:
@echo "Running imported game startup tests..."
@lua5.4 tests/test_game_startup.lua
test-parser: test-containers test-directions test-light test-pronouns test-take test-turnbit test-clock test-clock-direct test-assertions test-check-commands test-read-mailbox test-walk-around-house test-simple-new test-insert-file test-let test-save
@echo "All parser/runtime tests completed!"
test-containers:
@echo "Running container tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-containers
test-directions:
@echo "Running direction tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-directions
test-light:
@echo "Running light tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-light
test-pronouns:
@echo "Running pronoun tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-pronouns
test-take:
@echo "Running take command tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-take
test-turnbit:
@echo "Running TURNBIT flag tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-turnbit
test-clock:
@echo "Running clock system tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-clock
test-clock-direct:
@echo "Running clock system direct tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-clock-direct
test-assertions:
@echo "Running assertion tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-assertions
test-check-commands:
@echo "Running check commands tests..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-check-commands
test-read-mailbox:
@echo "Running Zork I mailbox/read regression..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-read-mailbox
test-walk-around-house:
@echo "Running Zork I forward ACTION routine regression..."
@lua5.4 run-zil-test.lua infocom/zork1/test/test-walk-around-house
test-simple-new:
@echo "Running simple assertion tests..."
@lua5.4 run-zil-test.lua zil/test-simple-new
test-insert-file:
@echo "Running INSERT-FILE tests..."
@lua5.4 run-zil-test.lua zil/test-insert-file
test-let:
@echo "Running LET form tests..."
@lua5.4 run-zil-test.lua zil/test-let
test-save:
@echo "Running save/restore tests..."
@lua5.4 run-zil-test.lua zil/test-save
test-llm:
@echo "Running LLM persistence tests..."
@lua tests/test_llm.lua
test-limehouse-walkthrough:
@echo "Running Limehouse Killings golden-path walkthrough..."
@lua5.4 run-zil-test.lua books/limehouse-killings/test/test-report-regressions
@lua5.4 run-zil-test.lua books/limehouse-killings/test/test-prose-reveal
@lua5.4 tests/test_limehouse_walkthrough.lua
@lua5.4 tests/test_limehouse_companion.lua
test-wondertown-descriptions:
@echo "Running Wondertown description ownership regressions..."
@lua5.4 run-zil-test.lua books/wondertown/test/test-description-ownership
@lua5.4 run-zil-test.lua books/wondertown/test/test-prose-reveal
test-zilch:
@echo "Running ZILCH feature tests..."
@lua5.4 run-zil-test.lua zil/test-zilch
test-flow-control:
@echo "Running flow control & data structure tests..."
@lua5.4 run-zil-test.lua zil/test-flow-control
test-horror-helpers:
@echo "Running horror test helpers..."
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-helpers
test-horror:
@echo "Running horror complete walkthrough tests..."
lua5.4 run-zil-test.lua books/blackwood-horror/test/test-walkthrough
test-horror-failures:
@echo "Running horror failing conditions tests..."
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-failures
test-horror-playtest-regressions:
@echo "Running isolated Blackwood playtest regressions..."
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-report-regressions
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-safe-key
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-say-ending
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-give-relic
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-something
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-scenery
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-lore
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-systems
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-prose-reveal
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-playtest-navigation
test-horror-all: test-horror-helpers test-horror-failures test-horror-playtest-regressions test-horror
@echo "All horror tests completed!"
.PHONY: test-book-playtests
test-book-playtests:
@set -e; for test in books/*/test/test-round*.zil; do \
lua5.4 run-zil-test.lua "$${test%.zil}"; \
done
@set -e; for test in books/*/test/test_round*_story.lua; do \
lua5.4 "$$test"; \
done
.PHONY: test-book-walkthroughs
test-book-walkthroughs:
@lua5.4 tests/test_take_indirect.lua
@lua5.4 tests/test_catalog_stress.lua
@lua5.4 tests/test_discovery_actions.lua
@lua5.4 tests/test_playtest_interactions.lua
@lua5.4 tests/test_completion_verbs.lua
@set -e; for test in books/*/test/test-walkthrough.zil; do \
lua5.4 run-zil-test.lua "$${test%.zil}"; \
done
@set -e; for test in books/*/test/test_walkthrough_*.lua; do \
lua5.4 "$$test"; \
done
.PHONY: test-meridian-scope
test-meridian-scope:
@lua5.4 tests/test_meridian_scope.lua
test-pure-zil: test-adventure-packages test-new-books test-book-playtests test-book-walkthroughs
@lua5.4 tests/test_rpg_status.lua
@lua5.4 run-zil-test.lua books/blackout-at-meridian/test/test-feats
@echo "Running pure ZIL tests..."
@lua5.4 run-zil-test.lua zil/test-simple-new
@lua5.4 run-zil-test.lua zil/test-insert-file
@lua5.4 run-zil-test.lua zil/test-let
@lua5.4 run-zil-test.lua infocom/zork1/test/test-containers
@lua5.4 run-zil-test.lua infocom/zork1/test/test-directions
@lua5.4 run-zil-test.lua infocom/zork1/test/test-light
@lua5.4 run-zil-test.lua infocom/zork1/test/test-pronouns
@lua5.4 run-zil-test.lua infocom/zork1/test/test-walk-around-house
@lua5.4 run-zil-test.lua infocom/zork1/test/test-take
@lua5.4 run-zil-test.lua infocom/zork1/test/test-turnbit
@lua5.4 run-zil-test.lua infocom/zork1/test/test-clock
@lua5.4 run-zil-test.lua infocom/zork1/test/test-clock-direct
@lua5.4 run-zil-test.lua infocom/zork1/test/test-assertions
@lua5.4 run-zil-test.lua infocom/zork1/test/test-check-commands
@lua5.4 run-zil-test.lua infocom/zork1/test/test-read-mailbox
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-helpers
@lua5.4 run-zil-test.lua books/blackwood-horror/test/test-failures
@lua5.4 run-zil-test.lua infocom/zork1/test/zork1-walkthrough
@lua5.4 run-zil-test.lua infocom/zork2/test/test-auto-generated
@lua5.4 run-zil-test.lua zil/test-zilch
@lua5.4 run-zil-test.lua zil/test-flow-control
@echo "All pure ZIL tests completed!"
BOOK_DIRS := $(patsubst %/game.json,%,$(wildcard books/*/game.json))
BOOK_WORDS := $(wildcard books/*/dungeon.zil books/*/dungeon-*.zil)
lint-zil:
@echo "Checking vocabulary consistency in book adventures..."
@lua5.4 scripts/check-vocab.lua $(BOOK_WORDS)
@echo "Parsing every book object's synonyms and adjectives..."
@lua5.4 tests/test_book_vocabulary.lua $(BOOK_DIRS)
@echo "Playing common verbs on every object..."
@lua5.4 scripts/check-responses.lua $(BOOK_DIRS)
.PHONY: test-book-vocabulary
test-book-vocabulary:
@lua5.4 tests/test_check_vocab.lua
@lua5.4 tests/test_book_vocabulary.lua $(BOOK_DIRS)
zip:
@set -e; game="$(filter-out zip,$(MAKECMDGOALS))"; \
if [ ! -f "books/$$game/game.json" ]; then echo "Usage: make zip <gamename>"; exit 1; fi; \
tmpdir=$$(mktemp -d); \
trap 'rm -rf "$$tmpdir"' EXIT; \
mkdir -p "$$tmpdir/books/$$game" "$(CURDIR)/publish"; \
cp books/$$game/*.zil books/$$game/game.json "$$tmpdir/books/$$game/"; \
cp -R core world rulesets "$$tmpdir/"; \
cd "$$tmpdir" && zip -qr "$$game.zip" books core world rulesets; \
mv "$$game.zip" "$(CURDIR)/publish/$$game.zip"; \
echo "Created publish/$$game.zip"
.PHONY: $(notdir $(BOOK_DIRS))
$(notdir $(BOOK_DIRS)):
@true
.PHONY: test-new-books
test-new-books:
@set -e; for book in pocket-weather silent-vector last-broadcast; do \
for test in books/$$book/test/test-*.zil; do \
lua5.4 run-zil-test.lua "$${test%.zil}"; \
done; \
for test in books/$$book/test/test_*.lua; do \
lua5.4 "$$test"; \
done; \
done
.PHONY: test-adventure-packages
test-adventure-packages:
@lua5.4 tests/test_adventure_packages.lua
@lua5.4 tests/test_book_snapshot_layout.lua