Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (57 loc) · 2.2 KB
/
Copy pathMakefile
File metadata and controls
69 lines (57 loc) · 2.2 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
60
61
62
63
64
65
66
67
68
69
# IsoCheck Makefile — one-command setup, build, test, campaign
# All builds happen on the Linux filesystem inside WSL for correct performance (not /mnt/c).
# Usage: make setup && make test && make campaign
SHELL := /bin/bash
# Linux-native build directory (not NTFS via /mnt/c)
BUILD_DIR := $(HOME)/isocheck-build
SRC_DIR := $(shell pwd)
CHECKER_BIN := $(BUILD_DIR)/cli/isocheck
VENV := $(BUILD_DIR)/venv
.PHONY: setup build test campaign clean lint docker-up docker-down buggy-campaign
# --- setup: bring up Postgres, install Python deps, build C++ ---
setup: docker-up build python-deps
@echo "=== Setup complete ==="
docker-up:
docker compose up -d postgres
@echo "Waiting for Postgres to be healthy..."
@until docker exec isocheck-postgres-1 pg_isready -U isocheck_app -d isocheck 2>/dev/null; do sleep 1; done
@echo "Postgres is ready."
docker-down:
docker compose down -v
# --- build: C++ build on native Linux filesystem ---
build:
@mkdir -p $(BUILD_DIR)
cmake -S $(SRC_DIR) -B $(BUILD_DIR) -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=20
cmake --build $(BUILD_DIR) --parallel
# --- python-deps: install pinned Python dependencies ---
python-deps:
python3 -m venv $(VENV) 2>/dev/null || true
$(VENV)/bin/pip install -r $(SRC_DIR)/harness/requirements.txt -q
# --- test: run all C++ unit tests ---
test: build
cd $(BUILD_DIR) && ctest --output-on-failure --parallel $$(nproc)
# --- campaign: run the standard acceptance campaign (correct-append) ---
campaign: build docker-up python-deps
$(VENV)/bin/python $(SRC_DIR)/harness/run_campaign.py \
--checker-bin $(CHECKER_BIN) \
--runs 20 \
--clients 8 \
--txns 63 \
--output-dir $(SRC_DIR)/campaign_results
# --- buggy-campaign: run the buggy-append positive control ---
buggy-campaign: build docker-up python-deps
$(VENV)/bin/python $(SRC_DIR)/harness/buggy_runner.py \
--checker-bin $(CHECKER_BIN) \
--runs 20 \
--isolation "READ COMMITTED" \
--output-dir $(SRC_DIR)/buggy_results_rc
$(VENV)/bin/python $(SRC_DIR)/harness/buggy_runner.py \
--checker-bin $(CHECKER_BIN) \
--runs 20 \
--isolation "SERIALIZABLE" \
--output-dir $(SRC_DIR)/buggy_results_ser
clean:
rm -rf $(BUILD_DIR)
docker compose down -v 2>/dev/null || true