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
#!/bin/sh
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
WINDOW_COLLECTION="${GPU_WINDOW_COLLECTION:-$ROOT/../window}"
RENDER_IR_TEST_BIN="${TMPDIR:-/tmp}/gpu_render_ir_tests_$$"
trap 'rm -f "$RENDER_IR_TEST_BIN"' EXIT HUP INT TERM
if [ "${GPU_SKIP_LUA_SELFTEST:-0}" != "1" ]; then
echo "==> test: lua tooling"
lua tools/test.lua selftest
lua tools/test.lua visual-matrix --dry-run --json "${TMPDIR:-/tmp}/gpu_visual_matrix_dry_run_$$.json" >/dev/null
fi
echo "==> test: shader"
odin test shader
shader/tests/workflow_equivalence.sh
echo "==> test: render_ir"
odin test tests/render_ir -collection:window="$WINDOW_COLLECTION" -out:"$RENDER_IR_TEST_BIN"
echo "==> test: profile"
odin test tests/profile -collection:window="$WINDOW_COLLECTION"
echo "==> test: tests"
odin test tests -collection:window="$WINDOW_COLLECTION"
echo "==> check: d3d12 transition boundary"
if grep -n "Type = \\.TRANSITION\\|transition_resource(" backend/d3d12/d3d12_ops.odin backend/d3d12/d3d12_frame.odin; then
echo "D3D12 transition barriers must go through typed helpers in d3d12_backend.odin" >&2
exit 1
fi
for backend in vulkan d3d11 d3d12 opengl; do
echo "==> check: gpu ($backend)"
odin check . -no-entry-point -collection:window="$WINDOW_COLLECTION" -define:GPU_BACKEND="$backend"
done
for example in examples/*; do
if [ -d "$example" ] && [ -f "$example/main.odin" ]; then
echo "==> check: $example"
odin check "$example" -collection:window="$WINDOW_COLLECTION"
fi
done
for tool in tools/*; do
if [ -d "$tool" ] && [ -f "$tool/main.odin" ]; then
echo "==> check: $tool"
odin check "$tool" -collection:window="$WINDOW_COLLECTION"
fi
done