-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcoverage.sh
More file actions
executable file
·32 lines (28 loc) · 978 Bytes
/
Copy pathcoverage.sh
File metadata and controls
executable file
·32 lines (28 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Generate code coverage report locally
echo "Generating code coverage report..."
# Create build directories
mkdir -p build/logs build/coverage
# Run PHPUnit with coverage (with Xdebug coverage mode)
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover build/logs/clover.xml --coverage-html build/coverage
if [ $? -eq 0 ]; then
echo ""
echo "✅ Coverage report generated successfully!"
echo ""
echo "📊 Coverage reports available at:"
echo " - HTML: build/coverage/index.html"
echo " - Clover XML: build/logs/clover.xml"
echo ""
echo "🌐 Open the HTML report in your browser:"
if command -v xdg-open &> /dev/null; then
echo " xdg-open build/coverage/index.html"
elif command -v open &> /dev/null; then
echo " open build/coverage/index.html"
else
echo " file://$(pwd)/build/coverage/index.html"
fi
else
echo ""
echo "❌ Coverage generation failed!"
exit 1
fi