Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (45 loc) · 1.75 KB
/
Copy pathMakefile
File metadata and controls
59 lines (45 loc) · 1.75 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
.PHONY: deps discipline check test examples-check test-integration test-api test-wss test-load examples clean
LUA ?= lua
deps:
luarocks install lua-protobuf
luarocks install luasocket
luarocks install luasec
luarocks install lua-zlib
luarocks install lua-cjson
examples-check:
$(LUAC) -p examples/*.lua examples/love2d/*.lua
discipline:
$(LUA) discipline/scanner.lua .
check: discipline
LUAC ?= luac
test: examples-check
$(LUA) tests/unit_test.lua
$(LUA) tests/wire_test.lua
$(LUA) tests/replay_test.lua
# Integration tests — hit real TikTok endpoints.
# Gate env vars:
# PIRATETOK_LIVE_TEST_USER — live TikTok username (H1, H4, W1-W7, D1)
# PIRATETOK_LIVE_TEST_OFFLINE_USER — offline TikTok username (H2)
# PIRATETOK_LIVE_TEST_HTTP=1 — enables nonexistent-user probe (H3)
# PIRATETOK_LIVE_TEST_COOKIES — session cookies for 18+ room info (H4)
# PIRATETOK_LIVE_TEST_USERS — comma-separated live usernames (M1)
test-api:
$(LUA) tests/test_api_integration.lua
test-wss:
$(LUA) tests/test_wss_smoke.lua
test-load:
$(LUA) tests/test_multi_stream_load.lua
test-integration: test-api test-wss test-load
test-online:
@echo "--- online_check: offline user ---"
$(LUA) examples/online_check.lua contexpirat || true
@echo "--- online_check: nonexistent user ---"
$(LUA) examples/online_check.lua fakeuser999xyznotreal || true
@echo "--- online_check: provide a live username as arg ---"
@echo "usage: make test-online LIVE_USER=<username>"
@if [ -n "$(LIVE_USER)" ]; then $(LUA) examples/online_check.lua $(LIVE_USER); fi
test-chat:
@if [ -z "$(LIVE_USER)" ]; then echo "usage: make test-chat LIVE_USER=<username>"; exit 1; fi
$(LUA) examples/basic_chat.lua $(LIVE_USER)
clean:
@echo "nothing to clean — pure Lua"