general: better test out

This commit is contained in:
Michael Freno
2026-01-15 16:17:18 -05:00
parent 9c6bdaed6a
commit 2686223274
2 changed files with 55 additions and 18 deletions

19
run
View File

@@ -98,12 +98,27 @@ if [ "$ACTION" = "build" ]; then
elif [ "$ACTION" = "test" ]; then
echo "Running unit tests..."
run_with_output "xcodebuild -project Gaze.xcodeproj -scheme Gaze -configuration Debug test"
VERBOSE=true
if [ $? -eq 0 ]; then
# Run tests and capture output
TEST_OUTPUT=$(xcodebuild -project Gaze.xcodeproj -scheme Gaze -configuration Debug test 2>&1)
TEST_EXIT_CODE=$?
# Display the test output
echo "$TEST_OUTPUT"
# Check if tests passed or failed
if [ $TEST_EXIT_CODE -eq 0 ]; then
echo "✅ Tests passed!"
else
echo "❌ Tests failed!"
# Extract and display failing tests in a pretty format
echo ""
echo "📝 Failed Tests:"
echo "================"
echo "$TEST_OUTPUT" | grep -E "(FAIL|Error|failed)" | sed 's/^/ • /'
echo "================"
exit 1
fi
elif [ "$ACTION" = "run" ]; then