omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / tests / r15_preflight_test.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # R15 preflight parser regression (tools/r15_machine_state.sh preflight-parse). |
| 18 | # kernel-with-smmu-pmus.csv is the 2026-10-05 12:53Z preflight file whose SMMU |
| 19 | # PMU "cycles" lines made the old parser divide by zero; cpu-pmu-only.csv is the |
| 20 | # 2026-09-29 PASS run's file. Both must read the X925 at ~3.9 GHz (exit 0); a |
| 21 | # 3 GHz core must fail the 3.75 GHz cut (exit 3); a file with no CPU cycles |
| 22 | # event must report no samples (exit 4), never a clock. |
| 23 | cd "$(dirname "$0")/.." || exit 1 |
| 24 | T=tools/r15_machine_state.sh; D=tests/r15_preflight; fail=0 |
| 25 | check() { # file expected-exit expected-text |
| 26 | out=$("$T" preflight-parse "$D/$1" 2>&1); rc=$? |
| 27 | if [ "$rc" = "$2" ] && printf '%s\n' "$out" | grep -Fq -- "$3"; then echo "[+] $1: exit $rc" |
| 28 | else echo "[-] $1: exit $rc (want $2), output: $(printf '%s' "$out" | tail -1)"; fail=$((fail + 1)); fi |
| 29 | } |
| 30 | check kernel-with-smmu-pmus.csv 0 "median seconds 13-20: 3.896 GHz" |
| 31 | check cpu-pmu-only.csv 0 "median seconds 13-20: 3.896 GHz" |
| 32 | check slow-core-3ghz.csv 3 "median seconds 13-20: 3.000 GHz" |
| 33 | check no-cpu-cycles.csv 4 "preflight: no samples" |
| 34 | echo "failures $fail"; [ "$fail" = 0 ] |