phoebus_os/installer/tests/test_syntax.sh
Phoebus 38214ea9e7 chore: import Phoebus OS installer and Rust migration
Initial public import of the proven Bash installer (installer/) and the production Rust workspace (installer-rs/). The reference ISO, build output and local agent transcripts are gitignored.

Verified: installer/tests/run_tests.sh and cargo test --workspace both pass.
2026-09-20 02:07:33 -07:00

22 lines
641 B
Bash

#!/usr/bin/env bash
# shellcheck shell=bash
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
TEST_NAME="test_syntax"
PHOEBUS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
failures=0
count=0
while IFS= read -r file; do
count=$((count + 1))
if bash -n "$file" 2>/dev/null; then
printf ' ok syntax %s\n' "${file#"$PHOEBUS_ROOT"/}"
else
printf ' FAIL syntax %s\n' "${file#"$PHOEBUS_ROOT"/}"
bash -n "$file" 2>&1 | sed 's/^/ /'
failures=$((failures + 1))
fi
done < <(find "$PHOEBUS_ROOT" -type f \( -name '*.sh' -o -path '*/bin/*' \) | sort)
TESTS_RUN=$count
TESTS_FAILED=$failures
phoebus_test_report