File size: 1,436 Bytes
98fac1e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a450c7f
 
98fac1e
 
 
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
# NativePort Web-Access API Benchmarks — build, test and validate.
# Standard library only: no pip install, no third-party tools, no network access.
#
#   make build      regenerate data/ from the snapshot
#   make test       run the unittest suite
#   make validate   parse, hash and scan the package, print a report
#   make check      all three, in order
#   make hashes     print SHA-256 for the source snapshot and every artifact
#
# Point the build at another snapshot with:  make check EVALS=/path/to/evals.json
#
# scripts/validate.py is an internal review tool and is not in the public upload set,
# so "make validate" reports and skips when it is absent instead of failing.

PYTHON ?= python3
EVALS  ?= /tmp/nativeport-evals-current.json
DATA   ?= data

.PHONY: check build test validate hashes help

check: build test validate

build:
	$(PYTHON) scripts/build_dataset.py --input $(EVALS) --output-dir $(DATA)

test:
	NP_EVALS_JSON=$(EVALS) $(PYTHON) -m unittest discover -s tests -v

validate:
	@if [ -f scripts/validate.py ]; then \
		$(PYTHON) scripts/validate.py --input $(EVALS); \
	else \
		echo "validate: scripts/validate.py is internal and not part of the public"; \
		echo "          upload set; skipping package validation."; \
	fi

hashes:
	@sha256sum $(EVALS) $(DATA)/metric_rows.jsonl $(DATA)/benchmarks.csv \
	  $(DATA)/benchmarks.jsonl $(DATA)/summary.json README.md LICENSE

help:
	@sed -n '1,13p' Makefile