CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / tests / omega / test-runner.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | # Refusal paths for tests/omega/run.sh. No compiler checkout is required. |
| 4 | set -eu |
| 5 | R=$(cd "$(dirname "$0")/../.." && pwd) |
| 6 | T=$(mktemp -d) |
| 7 | trap 'rm -rf "$T"' EXIT HUP INT TERM |
| 8 | fail() { echo "omega-runner-test: $*" >&2; exit 1; } |
| 9 | PIN=$(sed -n 's/^PINNED_SOURCE=//p' "$R/tests/omega/run.sh") |
| 10 | [ -n "$PIN" ] || fail "run.sh does not set PINNED_SOURCE" |
| 11 | |
| 12 | # A fresh checkout has no compiler harness configured. |
| 13 | if env -u OMEGA_OSC_COMPILER_DIR "$R/tests/omega/run.sh" >"$T/missing.log" 2>&1; then |
| 14 | fail "missing harness unexpectedly passed" |
| 15 | fi |
| 16 | grep -q 'compiler harness not configured' "$T/missing.log" || fail "missing harness diagnostic" |
| 17 | grep -q "$PIN" "$T/missing.log" || fail "missing harness did not name the pinned commit" |
| 18 | |
| 19 | # A missing named slice is reported before a compiler checkout is required. |
| 20 | mkdir -p "$T/missing/tests/omega" "$T/missing/omega/slices" |
| 21 | cp "$R/tests/omega/run.sh" "$T/missing/tests/omega/run.sh" |
| 22 | for f in doorbell.osc sequencer.osc nvrm.osc va.osc open_plan.osc kmod.osc mesa.osc; do |
| 23 | : >"$T/missing/omega/slices/$f" |
| 24 | done |
| 25 | if "$T/missing/tests/omega/run.sh" >"$T/slice.log" 2>&1; then |
| 26 | fail "missing named slice unexpectedly passed" |
| 27 | fi |
| 28 | grep -q 'missing required slice .*launch.osc' "$T/slice.log" || fail "missing-slice diagnostic" |
| 29 | |
| 30 | # A checkout at another commit fails with the expected and found revisions. |
| 31 | mkdir -p "$T/wrong/tests/omega" "$T/wrong/omega/slices" "$T/harness" |
| 32 | cp "$R/tests/omega/run.sh" "$T/wrong/tests/omega/run.sh" |
| 33 | cp "$R"/omega/slices/*.osc "$T/wrong/omega/slices/" |
| 34 | env -u GIT_DIR -u GIT_WORK_TREE git -C "$T/harness" init -q |
| 35 | env -u GIT_DIR -u GIT_WORK_TREE git -C "$T/harness" \ |
| 36 | -c user.name=test -c user.email=test@example.invalid -c commit.gpgsign=false \ |
| 37 | commit --allow-empty -qm wrong-pin |
| 38 | if env -u GIT_DIR -u GIT_WORK_TREE OMEGA_OSC_COMPILER_DIR="$T/harness" \ |
| 39 | "$T/wrong/tests/omega/run.sh" >"$T/version.log" 2>&1; then |
| 40 | fail "wrong harness source unexpectedly passed" |
| 41 | fi |
| 42 | grep -q "wrong harness source .*expected $PIN" "$T/version.log" || fail "wrong-version diagnostic" |
| 43 | |
| 44 | echo "omega-runner-test: PASS (missing harness, missing slice, wrong source pin)" |