fairtalking-second-work / scripts /test_batch_script.sh
huahua123313's picture
Add files using upload-large-folder tool
07001d0 verified
Raw
History Blame Contribute Delete
2.8 kB
#!/usr/bin/env bash
# Test script to verify batch_test_all.sh functionality
set -euo pipefail
cd "$(dirname "$0")/.."
echo "=== Testing batch_test_all.sh configuration ==="
echo ""
# Test 1: Check if all required test scripts exist
echo "1. Checking test scripts exist:"
for method in "cta" "psm" "radr"; do
# Check ours script
if [ -f "scripts/test_${method}.sh" ]; then
echo " ✓ scripts/test_${method}.sh (ours)"
else
echo " ✗ scripts/test_${method}.sh (ours) - NOT FOUND"
fi
# Check thb script
if [ -f "scripts/test_${method}_thb.sh" ]; then
echo " ✓ scripts/test_${method}_thb.sh (thb)"
else
echo " ✗ scripts/test_${method}_thb.sh (thb) - NOT FOUND"
fi
done
# Check ff++ and hdtf scripts
if [ -f "scripts/test_ffpp.sh" ]; then
echo " ✓ scripts/test_ffpp.sh (ff++)"
else
echo " ✗ scripts/test_ffpp.sh (ff++) - NOT FOUND"
fi
if [ -f "scripts/test_hdtf_paired.sh" ]; then
echo " ✓ scripts/test_hdtf_paired.sh (hdtf)"
else
echo " ✗ scripts/test_hdtf_paired.sh (hdtf) - NOT FOUND"
fi
echo ""
# Test 2: Check if output directories exist
echo "2. Checking output directories:"
for method in "cta" "psm" "radr"; do
if [ -d "outputs/$method/checkpoints" ]; then
checkpoint_count=$(find "outputs/$method/checkpoints" -name "*.ckpt" -not -name "last.ckpt" | wc -l)
echo " ✓ outputs/$method/checkpoints ($checkpoint_count checkpoints)"
else
echo " ✗ outputs/$method/checkpoints - NOT FOUND"
fi
done
echo ""
# Test 3: Check if batch_test_all.sh is executable
echo "3. Checking batch_test_all.sh:"
if [ -f "scripts/batch_test_all.sh" ]; then
echo " ✓ scripts/batch_test_all.sh exists"
# Make it executable
chmod +x "scripts/batch_test_all.sh"
echo " ✓ Made scripts/batch_test_all.sh executable"
# Test syntax
if bash -n "scripts/batch_test_all.sh"; then
echo " ✓ Syntax check passed"
else
echo " ✗ Syntax check failed"
fi
else
echo " ✗ scripts/batch_test_all.sh - NOT FOUND"
fi
echo ""
# Test 4: Show what the batch script would do
echo "4. Batch script execution plan:"
echo " Methods to test: cta, psm, radr"
echo " Datasets to test: ours, thb, ff++, hdtf"
echo " Checkpoints per method: top-3 + last"
echo " Total test combinations: 3 methods × 4 datasets × 4 checkpoints = 48 tests"
echo ""
# Test 5: Show sample command for one test
echo "5. Sample test command:"
echo " bash scripts/test_psm.sh outputs/psm/checkpoints/last.ckpt"
echo ""
echo "=== Test completed ==="
echo ""
echo "To run the full batch test:"
echo " bash scripts/batch_test_all.sh"
echo ""
echo "This will create a CSV file with all results in the current directory."