-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.25 KB
/
Copy pathMakefile
File metadata and controls
49 lines (38 loc) · 1.25 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
# Makefile — semanticversion-rs
# Port Mortem 2026, Track D (Python → Rust)
#
# Default target (`make`): build the PyO3 extension into the venv and run the
# ORIGINAL unmodified python-semanticversion test suite against it.
# Exits non-zero if any test fails.
VENV ?= /home/dolphin/rust-venv
PYTHON ?= $(VENV)/bin/python
MATURIN ?= $(VENV)/bin/maturin
PYTEST ?= $(VENV)/bin/python -m pytest
.PHONY: all build test test-original test-rust fuzz bench clean dev
all: dev test-original
## Install Rust build into active venv (development)
dev:
VIRTUAL_ENV=$(VENV) $(MATURIN) develop
## Full production build (wheel)
build:
VIRTUAL_ENV=$(VENV) $(MATURIN) build --release
## Run ORIGINAL unmodified Python test suite against Rust build (judge's validation path)
test-original: dev
$(PYTEST) tests/original/ -q
## Run native Rust unit tests
test-rust:
cargo test
## Run both test suites
test: test-rust test-original
## Differential fuzz (60+ seconds against Python oracle)
fuzz: dev
$(PYTHON) fuzz/fuzz_driver.py --duration 60 --output fuzz/log.txt
@tail -2 fuzz/log.txt
## Criterion benchmarks
bench:
cargo bench
## Remove build artefacts
clean:
cargo clean
find . -name '*.pyc' -delete
find . -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true