updates to launcer
This commit is contained in:
+16
-37
@@ -2,40 +2,19 @@
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
mkdir -p "$ROOT/.build/build-logs"
|
||||
LOG="$ROOT/.build/build-logs/test-$(date +%Y%m%d-%H%M%S).log"
|
||||
exec > >(tee "$LOG") 2>&1
|
||||
print '=== OrionToolbar tests ==='
|
||||
# A successful compile is the minimum regression check.
|
||||
"$ROOT/scripts/build.sh"
|
||||
APP="$ROOT/.build/Build/Products/Debug/OrionToolbar.app"
|
||||
plutil -lint "$APP/Contents/Info.plist"
|
||||
# Verify that the Parallels executable and JSON discovery work independently of SwiftUI.
|
||||
PRLCTL=''
|
||||
for candidate in /usr/local/bin/prlctl '/Applications/Parallels Desktop.app/Contents/MacOS/prlctl'; do
|
||||
if [[ -x "$candidate" ]]; then PRLCTL="$candidate"; break; fi
|
||||
done
|
||||
if [[ -n "$PRLCTL" ]]; then
|
||||
"$PRLCTL" list -a -j | python3 -c '
|
||||
import json,sys
|
||||
v=json.load(sys.stdin)
|
||||
assert isinstance(v,list), "Expected Parallels JSON array"
|
||||
for item in v:
|
||||
assert isinstance(item,dict), "Invalid VM record"
|
||||
assert item.get("name"), "VM without name"
|
||||
assert item.get("uuid"), "VM without UUID"
|
||||
print("Parallels discovery OK: {} VM(s)".format(len(v)))
|
||||
'
|
||||
else
|
||||
echo 'SKIP: Parallels CLI not installed'
|
||||
fi
|
||||
if [[ -d "$ROOT/tests" ]] && find "$ROOT/tests" -name 'test_*.py' -print -quit | grep -q .; then
|
||||
python3 -m unittest discover -s "$ROOT/tests" -v
|
||||
fi
|
||||
# Run Xcode tests only if a test plan is configured for this scheme.
|
||||
if [[ "${RUN_XCODE_TESTS:-0}" == 1 ]]; then
|
||||
xcodebuild -project "$ROOT/OrionToolbar.xcodeproj" -scheme OrionToolbar -configuration Debug -destination 'platform=macOS' -derivedDataPath "$ROOT/.build" CODE_SIGNING_ALLOWED=NO test
|
||||
else
|
||||
echo 'XCTest not run (set RUN_XCODE_TESTS=1 if the scheme has a test target).'
|
||||
fi
|
||||
print "Tests complete. Log: $LOG"
|
||||
mkdir -p .build/test-logs
|
||||
LOG=".build/test-logs/test-$(date +%Y%m%d-%H%M%S).log"
|
||||
{
|
||||
echo '=== ORIONTOOLBAR REGRESSION TESTS ==='
|
||||
echo 'Source contracts (non-destructive)'
|
||||
/usr/bin/env python3 -m unittest discover -s tests -p 'test_*.py' -v
|
||||
if [[ "${1:-}" == '--live' || "${1:-}" == '--all' ]]; then
|
||||
echo 'Read-only Parallels integration checks'
|
||||
ORION_LIVE=1 /usr/bin/env python3 -m unittest discover -s tests -p 'test_*.py' -v
|
||||
fi
|
||||
if [[ "${1:-}" == '--build' || "${1:-}" == '--all' ]]; then
|
||||
echo 'Xcode build (does not launch app)'
|
||||
/bin/zsh scripts/build.sh
|
||||
fi
|
||||
} 2>&1 | tee "$LOG"
|
||||
echo "Test log: $LOG"
|
||||
|
||||
Reference in New Issue
Block a user