-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (59 loc) · 2.6 KB
/
Copy pathMakefile
File metadata and controls
74 lines (59 loc) · 2.6 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
70
71
72
73
74
# Seal VPE — cross-language build and test targets
# https://github.com/nousresearch/seal
.PHONY: default
default: test
# ---------------------------------------------------------------------------
# Generate test vectors
# ---------------------------------------------------------------------------
.PHONY: vectors
vectors:
python3 tests/generate_vectors.py
# ---------------------------------------------------------------------------
# Python tests
# ---------------------------------------------------------------------------
.PHONY: test-python
test-python:
python3 -m pytest tests/ -x -q
# ---------------------------------------------------------------------------
# TypeScript tests
# ---------------------------------------------------------------------------
.PHONY: test-ts
test-ts:
cd vpe-ts && npm test
# ---------------------------------------------------------------------------
# Go tests
# ---------------------------------------------------------------------------
.PHONY: test-go
test-go:
cd vpe-go && go test ./vpe/...
# ---------------------------------------------------------------------------
# Rust tests
# ---------------------------------------------------------------------------
.PHONY: test-rust
test-rust:
cd vpe-rust && cargo test
# ---------------------------------------------------------------------------
# Cross-language interop: generate vectors then run ALL suite tests
# ---------------------------------------------------------------------------
.PHONY: cross-lang-test-vectors
cross-lang-test-vectors: vectors
@echo "=== Python ===" && python3 -m pytest tests/test_interop_vectors.py tests/test_core.py -x -q && \
echo "" && \
echo "=== TypeScript ===" && cd vpe-ts && npm test && \
echo "" && \
echo "=== Go ===" && cd ../vpe-go && go test ./vpe/... && \
echo "" && \
echo "=== Rust ===" && cd ../vpe-rust && cargo test && \
echo "" && \
echo "=== ALL TESTS PASSED ==="
# ---------------------------------------------------------------------------
# Quick test (just the interop vectors across all languages)
# ---------------------------------------------------------------------------
.PHONY: cross-lang-interop
cross-lang-interop: vectors
@echo "=== Python interop ===" && python3 -m pytest tests/test_interop_vectors.py -x -q && \
echo "=== TypeScript interop ===" && cd vpe-ts && npx jest tests/interop_vectors.test.ts && \
echo "=== Go interop ===" && cd ../vpe-go && go test -run TestInteropVectorAll ./vpe/... && \
echo "=== Rust interop ===" && cd ../vpe-rust && cargo test test_interop_all_vectors -- --nocapture && \
echo "" && \
echo "=== ALL INTEROP TESTS PASSED ==="