-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (40 loc) · 1.61 KB
/
Copy pathMakefile
File metadata and controls
48 lines (40 loc) · 1.61 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
# vgi-grammar VGI worker — build, unit-test, and SQL E2E targets.
#
# Usage:
# make build # fat JAR -> build/libs/vgi-grammar-<ver>-all.jar
# make test # JUnit + SQL E2E (the full suite)
# make test-unit # ./gradlew test (JUnit only)
# make test-sql # shadowJar + haybarn-unittest over test/sql/*
#
# SQL E2E needs haybarn-unittest on PATH:
# uv tool install haybarn-unittest # binary at ~/.local/bin/haybarn-unittest
# export PATH="$$HOME/.local/bin:$$PATH"
GRADLE ?= ./gradlew
UNITTEST ?= haybarn-unittest
TEST_DIR = .
TEST_PATTERN = test/sql/*
# The fat JAR is a self-contained VGI worker; its manifest sets Add-Opens so a
# bare `java -jar` works as a LOCATION (no extra --add-opens needed).
JAR_GLOB = build/libs/vgi-grammar-*-all.jar
.PHONY: test test-unit test-sql build clean
build:
$(GRADLE) --no-daemon shadowJar
test-unit:
$(GRADLE) --no-daemon test
# SQL E2E: build the fat JAR, then run the .test files through DuckDB via
# haybarn-unittest with the worker as the VGI LOCATION.
test-sql: build
@command -v $(UNITTEST) >/dev/null 2>&1 || { \
echo "ERROR: $(UNITTEST) not found on PATH." >&2; \
echo " Install: uv tool install haybarn-unittest" >&2; \
echo " Then: export PATH=\"\$$HOME/.local/bin:\$$PATH\"" >&2; \
exit 1; \
}
@JAR="$$(ls $(JAR_GLOB) | head -1)"; \
if [ -z "$$JAR" ]; then echo "ERROR: fat JAR not built ($(JAR_GLOB))" >&2; exit 1; fi; \
echo "Worker JAR: $$JAR"; \
VGI_GRAMMAR_WORKER="java -jar $$(pwd)/$$JAR" \
$(UNITTEST) --test-dir "$(TEST_DIR)" "$(TEST_PATTERN)"
test: test-unit test-sql
clean:
$(GRADLE) --no-daemon clean