Files
FlexLove/testing/run_with_coverage.sh
Michael Freno 1dab1a197e start testing
2025-11-14 20:59:40 -05:00

40 lines
917 B
Bash
Executable File

#!/bin/bash
# Run tests with code coverage
# Set up LuaRocks path
eval $(luarocks path)
# Clean up old coverage files
rm -f luacov.stats.out luacov.report.out
# Run tests with coverage enabled
COVERAGE=1 lua testing/runAll.lua
# Check if tests passed
if [ $? -eq 0 ]; then
echo ""
echo "========================================"
echo "Generating coverage report..."
echo "========================================"
# Generate detailed report
luacov
# Show summary
echo ""
echo "========================================"
echo "Coverage Summary"
echo "========================================"
# Extract and display summary information
if [ -f luacov.report.out ]; then
echo ""
grep -A 100 "^Summary" luacov.report.out | head -30
echo ""
echo "Full report available in: luacov.report.out"
fi
else
echo "Tests failed. Coverage report not generated."
exit 1
fi