# Foundation tests (store, config, session, plexer, repl). # Run from taicpp/: make -f tests/foundation.mk test # Outputs stay under build/. Independent of the main Makefile on purpose: the # foundation area builds and tests itself with only sqlite3 as a link dependency. CXX ?= g++ CXXFLAGS ?= -std=c++23 -Wall -Wextra -O1 INC = -Isrc -Isrc/store -Isrc/session -Isrc/config -Isrc/plexer -Isrc/repl FB = build/foundation FSRCS = $(wildcard src/store/*.cpp) $(wildcard src/session/*.cpp) $(wildcard src/config/*.cpp) $(wildcard src/plexer/*.cpp) $(wildcard src/repl/*.cpp) FOBJS = $(patsubst src/%.cpp,$(FB)/%.o,$(FSRCS)) LIBS = -lsqlite3 -pthread .PHONY: all test clean-foundation all: build/foundation_probe build/repl_probe build/foundation_test $(FB)/%.o: src/%.cpp @mkdir -p $(dir $@) $(CXX) $(CXXFLAGS) $(INC) -c $< -o $@ build/foundation_probe: tests/foundation_probe.cpp $(FOBJS) $(CXX) $(CXXFLAGS) $(INC) $< $(FOBJS) $(LIBS) -o $@ build/repl_probe: tests/repl_probe.cpp $(FOBJS) $(CXX) $(CXXFLAGS) $(INC) $< $(FOBJS) $(LIBS) -o $@ build/foundation_test: tests/foundation_test.cpp $(FOBJS) $(CXX) $(CXXFLAGS) $(INC) $< $(FOBJS) $(LIBS) -o $@ test: all build/foundation_test python3 tests/foundation_parity.py python3 tests/repl_persist.py python3 tests/tmux_ask.py clean-foundation: rm -rf $(FB) build/foundation_probe build/repl_probe build/foundation_test