general: better test out
This commit is contained in:
19
run
19
run
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user