Files
waozi b4188db5ad Run the test bundle directly
A built .zx runs by its path; `ziran run --project FILE.zx` is no longer
a form of the command. `make check` passes with the current toolchain.
2026-11-23 04:16:51 -03:00

25 lines
655 B
Makefile

.DEFAULT_GOAL := check
ZIRAN ?= ziran
CC ?= cc
BUILD := build
.PHONY: check test clean
# Checks the package, then runs the tests as C and as a portable bundle.
check: test
test:
$(ZIRAN) check --project
$(ZIRAN) build --project --target=c --entry syntax_test:main \
-o $(BUILD)/test-c tests/syntax_test.zi
$(CC) -std=c99 -pedantic-errors -I$$($(ZIRAN) pkg path ziran)/include \
-I$(BUILD)/test-c $(BUILD)/test-c/*.c -o $(BUILD)/syntax-test
$(BUILD)/syntax-test
$(ZIRAN) bundle --project --entry syntax_test:main \
-o $(BUILD)/syntax-test.zx tests/syntax_test.zi
test "$$($(ZIRAN) run $(BUILD)/syntax-test.zx)" = 0
clean:
rm -rf $(BUILD)