forked from rue-language/rue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·42 lines (35 loc) · 1.42 KB
/
test.sh
File metadata and controls
executable file
·42 lines (35 loc) · 1.42 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
#!/usr/bin/env bash
set -euo pipefail
# Run all tests for the rue compiler
cd "$(dirname "$0")"
# Run unit tests for all crates
echo "Running unit tests..."
./buck2 test \
//crates/rue-span:rue-span-test \
//crates/rue-error:rue-error-test \
//crates/rue-target:rue-target-test \
//crates/rue-lexer:rue-lexer-test \
//crates/rue-parser:rue-parser-test \
//crates/rue-rir:rue-rir-test \
//crates/rue-cfg:rue-cfg-test \
//crates/rue-air:rue-air-test \
//crates/rue-codegen:rue-codegen-test \
//crates/rue-linker:rue-linker-test \
//crates/rue-compiler:rue-compiler-test
# Get the path to the rue binary (this also builds it if needed)
RUE_BINARY="$(./buck2 build //crates/rue:rue --show-output | tail -1 | awk '{print $2}')"
# Run spec tests (buck2 run will build rue-spec if needed)
echo "Running spec tests..."
RUE_BINARY="$RUE_BINARY" \
RUE_SPEC_CASES="crates/rue-spec/cases" \
./buck2 run //crates/rue-spec:rue-spec -- --quiet "$@"
# Run traceability check (fails if coverage < 100% or orphan references exist)
echo "Running spec traceability check..."
RUE_SPEC_DIR="docs/spec/src" \
RUE_SPEC_CASES="crates/rue-spec/cases" \
./buck2 run //crates/rue-spec:rue-spec -- --traceability
# Run UI tests (compiler-specific tests like warnings)
echo "Running UI tests..."
RUE_BINARY="$RUE_BINARY" \
RUE_UI_CASES="crates/rue-ui-tests/cases" \
./buck2 run //crates/rue-ui-tests:rue-ui-tests -- --quiet "$@"