#!/bin/sh
# Build and test the OMP-native adapter helper. One binary dispatches launch,
# digest, history, Psyche, and echo-commune subcommands.
# [impl->REQ-DIST-BINARY-CONSOLIDATE]
set -u
ROOT=$(CDPATH= cd "$(dirname "$0")/../.." && pwd)
CRATE="$ROOT/tools/omp-spt/Cargo.toml"

if ! command -v cargo >/dev/null 2>&1; then
  echo "SKIP: cargo not on PATH (Rust toolchain needed to build/test omp-spt)"
  exit 0
fi

cargo test  --quiet --manifest-path "$CRATE" || { echo "FAIL: cargo test"; exit 1; }
cargo build --release --quiet --manifest-path "$CRATE" || { echo "FAIL: cargo build --release"; exit 1; }
echo "ok  omp-spt: cargo test + release build"
