added new bash validation scripts

This commit is contained in:
2025-06-13 05:05:33 +02:00
parent b669c7135a
commit d4d3dca574
2 changed files with 214 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#!/bin/bash
# quick_validation.sh - Simplified version for rapid testing
echo "=== Quick Surname Validation ==="
# Quick output comparison
echo "Generating results..."
gunzip -c dblp.xml.gz | ./surnames > c_quick.txt &
C_PID=$!
gunzip -c dblp.xml.gz | python3 surnames.py > python_quick.txt &
PYTHON_PID=$!
wait $C_PID $PYTHON_PID
echo "C results: $(wc -l < c_quick.txt) surnames"
echo "Python results: $(wc -l < python_quick.txt) surnames"
echo "Wang comparison:"
echo "C: $(grep "^Wang " c_quick.txt)"
echo "Python: $(grep "^Wang " python_quick.txt)"
if diff -q c_quick.txt python_quick.txt > /dev/null; then
echo "✓ Results identical!"
else
echo "⚠ Results differ"
fi
# Quick memory check
echo "Memory check:"
gunzip -c dblp.xml.gz | valgrind --leak-check=yes ./surnames > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "✓ No major memory issues"
else
echo "⚠ Check valgrind output"
fi
rm -f c_quick.txt python_quick.txt