86 lines
2.7 KiB
Bash
Executable File
86 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
BUILD_DIR="$ROOT_DIR/build/task-hal"
|
|
MANIFEST_STDOUT="$BUILD_DIR/verify_task_hal_source_manifest.stdout.log"
|
|
PROBE_STDOUT="$BUILD_DIR/probe_trt_task_hal_runtime.stdout.log"
|
|
|
|
mkdir -p "$BUILD_DIR"
|
|
|
|
"$ROOT_DIR/tools/verify_task_hal_source_manifest.sh" >"$MANIFEST_STDOUT"
|
|
"$ROOT_DIR/tests/native/probe_trt_task_hal_runtime.sh" >"$PROBE_STDOUT"
|
|
|
|
value_from() {
|
|
local file="$1"
|
|
local key="$2"
|
|
awk -F= -v key="$key" '$1 == key { print substr($0, length(key) + 2); found=1 } END { if (!found) exit 1 }' "$file"
|
|
}
|
|
|
|
expect_value() {
|
|
local file="$1"
|
|
local key="$2"
|
|
local expected="$3"
|
|
local actual
|
|
actual="$(value_from "$file" "$key")"
|
|
if [[ "$actual" != "$expected" ]]; then
|
|
echo "$key expected $expected, got $actual" >&2
|
|
echo "from $file" >&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
expect_int_gt() {
|
|
local file="$1"
|
|
local key="$2"
|
|
local minimum="$3"
|
|
local actual
|
|
actual="$(value_from "$file" "$key")"
|
|
if ! [[ "$actual" =~ ^[0-9]+$ ]] || (( actual <= minimum )); then
|
|
echo "$key expected > $minimum, got $actual" >&2
|
|
echo "from $file" >&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
expect_value "$MANIFEST_STDOUT" task_hal_source_manifest_status ok
|
|
expect_value "$MANIFEST_STDOUT" task_hal_source_manifest_ready 1
|
|
expect_value "$MANIFEST_STDOUT" task_hal_reference_source_ready 1
|
|
expect_value "$MANIFEST_STDOUT" task_hal_missing_reference_source_count 0
|
|
expect_int_gt "$MANIFEST_STDOUT" task_source_count 0
|
|
expect_int_gt "$MANIFEST_STDOUT" hal_source_count 0
|
|
expect_int_gt "$MANIFEST_STDOUT" motion_source_count 0
|
|
expect_int_gt "$MANIFEST_STDOUT" nml_source_count 0
|
|
expect_value "$MANIFEST_STDOUT" task_hal_runtime_promoted 0
|
|
expect_value "$MANIFEST_STDOUT" nativeTaskReady false
|
|
expect_value "$MANIFEST_STDOUT" nativeHalSyncReady false
|
|
|
|
expect_value "$PROBE_STDOUT" trt_task_hal_source_proof_ready 1
|
|
expect_value "$PROBE_STDOUT" trt_task_hal_execution_enabled 0
|
|
expect_value "$PROBE_STDOUT" trt_task_hal_promotion_allowed 0
|
|
expect_value "$PROBE_STDOUT" native_task_hal_probe ok
|
|
expect_value "$PROBE_STDOUT" nativeTaskReady false
|
|
expect_value "$PROBE_STDOUT" nativeHalSyncReady false
|
|
|
|
native_probe_status="$(value_from "$PROBE_STDOUT" native_probe_status)"
|
|
probe_status="$(value_from "$PROBE_STDOUT" trt_task_hal_runtime_probe_status)"
|
|
case "$probe_status" in
|
|
ready_disabled_by_default|skipped_missing_host_runtime|blocked_missing_source)
|
|
;;
|
|
*)
|
|
echo "unexpected non-opt-in TRT task/HAL probe status: $probe_status" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
case "$native_probe_status" in
|
|
ready_disabled_by_default|skipped_missing_host_runtime)
|
|
;;
|
|
*)
|
|
echo "unexpected non-opt-in native probe status: $native_probe_status" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
echo "task_hal_phase0_native_probe_gate=ok"
|