Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (49 loc) · 2.19 KB
/
Copy pathMakefile
File metadata and controls
66 lines (49 loc) · 2.19 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
.PHONY: all test nits docs graphs rm-graphs doctest coverage insta-test fixnits nightly
RUST_SRC=$(shell find . -type f -wholename '*/src/*.rs' -or -name 'Cargo.toml')
TESTS=$(shell find tests/ -type f -name '*.egg' -not -name '*repro-*')
WWW=${PWD}/target/www
# Keep release-mode test builds checking debug assertions without changing the
# normal release profile used by CodSpeed benchmarks and production binaries.
TEST_PROFILE_ENV=CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=true
all: test nits docs
# Build egglog and benchmark every tests/*.egg file with hyperfine, writing an
# HTML dashboard to nightly/output/ (matching `report=` in nightly-conf).
# Run nightly on nightly.cs.washington.edu. Dependencies install into a venv so
# this works on PEP 668 externally-managed systems; eval_live must be importable
# by the script's interpreter, so run it with the venv's python.
nightly:
python3 -m venv nightly/.venv
nightly/.venv/bin/pip install -q -r scripts/requirements.txt
nightly/.venv/bin/python scripts/nightly_bench.py
test: doctest
$(TEST_PROFILE_ENV) cargo insta test --test-runner nextest --release --workspace --unreferenced reject
coverage:
$(TEST_PROFILE_ENV) cargo llvm-cov nextest --release --workspace --lcov --output-path lcov.info
# Note: doctests are not included in coverage reports
doctest:
$(TEST_PROFILE_ENV) cargo test --doc --release --workspace
nits:
@rustup component add clippy
cargo clippy --tests -- -D warnings
@rustup component add rustfmt
cargo fmt --check
cargo doc --workspace
fixnits:
@rustup component add rustfmt
cargo fmt
@rustup component add rustfmt
cargo clippy --fix --tests --workspace --allow-dirty
docs:
mkdir -p ${WWW}/
cargo doc --no-deps --all-features --workspace
touch target/doc/.nojekyll # prevent github from trying to run jekyll
cp www/index.html ${WWW}/index.html
cp -r target/doc ${WWW}/docs
graphs: $(patsubst %.egg,%.svg,$(filter-out $(wildcard tests/repro-*.egg),$(wildcard tests/*.egg)))
json: $(patsubst %.egg,%.json,$(filter-out $(wildcard tests/repro-*.egg),$(wildcard tests/*.egg)))
%.svg: %.egg
cargo run --release -- --to-dot --to-svg $^
%.json: %.egg
cargo run --release -- --to-json $^
rm-graphs:
rm -f tests/*.dot tests/*.svg