393ce3c0ed
lua_app.cpp had grown to 701 lines holding every binding, the module loader and the app lifecycle, so new bindings landed wherever the cursor was. Each Lua table now has its own file under bindings/, and the app is recovered from the lua_State's extra space instead of a file-static, so a second state cannot reach the wrong app. Three tests each redeclared the binding surface, which broke twice this session when a binding changed; test/fake_device.lua is now the single stub. `make test` runs all four suites and pins Lua 5.4, matching the vendored interpreter rather than the 5.2 the tests had silently been using.
37 lines
973 B
Makefile
37 lines
973 B
Makefile
# Run inside `nix develop`, which provides pio, lua and a compiler.
|
|
# LUA is pinned to 5.4 to match the interpreter vendored into the firmware.
|
|
|
|
LUA ?= lua
|
|
CXX ?= c++
|
|
CXXFLAGS ?= -std=c++11 -Wall -Wextra
|
|
BUILD_DIR := .pio/build/esp32-32e
|
|
LUA_TESTS := test/ui_layout.lua test/ui_theme.lua test/settings_calibration.lua
|
|
|
|
.PHONY: test test-lua test-cpp build upload monitor clean
|
|
|
|
test: test-cpp test-lua
|
|
|
|
test-lua:
|
|
@$(LUA) -e 'assert(_VERSION == "Lua 5.4", "tests need Lua 5.4 to match the firmware, got " .. _VERSION)'
|
|
@for t in $(LUA_TESTS); do printf '%-32s ' "$$t"; $(LUA) "$$t" || exit 1; done
|
|
|
|
test-cpp: $(BUILD_DIR)/round_rect_test
|
|
@printf '%-32s ' test/round_rect_test.cpp; $(BUILD_DIR)/round_rect_test
|
|
|
|
$(BUILD_DIR)/round_rect_test: test/round_rect_test.cpp src/gfx/round_rect.h
|
|
@mkdir -p $(@D)
|
|
@$(CXX) $(CXXFLAGS) $< -o $@
|
|
|
|
build:
|
|
pio run
|
|
|
|
upload:
|
|
pio run -t upload
|
|
|
|
monitor:
|
|
pio device monitor
|
|
|
|
clean:
|
|
pio run -t clean
|
|
rm -f $(BUILD_DIR)/round_rect_test
|