run-all-extension-tests revision 905e42f96548e175ead68243a632f06b19285e1f
#!/bin/bash
echo -e "\n##### Extension Tests #####"
cd "$(dirname "$0")"
has_py_coverage=false
py_cover_files=$( mktemp )
if coverage.py -e >/dev/null 2>/dev/null; then
has_py_coverage=true
cover_py_cmd=coverage.py
else
if coverage -e >/dev/null 2>/dev/null; then
has_py_coverage=true
cover_py_cmd=coverage
fi
fi
#if $has_py_coverage; then
# $cover_py_cmd -e
#fi
function run_py_test() {
echo -e "\n>> Testing $1"
if $has_py_coverage; then
$cover_py_cmd -x "$1.test.py"
echo "../$1.py" >> $py_cover_files
else
python "$1.test.py"
fi
}
ls -1 *.test.py |
while read testFile; do
run_py_test $( echo $testFile | sed -r 's/^([^.]+)..*$/\1/' )
done
echo ""
if $has_py_coverage; then
cat $py_cover_files | xargs $cover_py_cmd -r
fi
rm $py_cover_files