2008-08-14 16:05:14 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2008-08-27 20:15:27 -05:00
|
|
|
# Script to run nosetests under multiple versions of Python
|
2008-08-14 16:05:14 -05:00
|
|
|
|
2009-01-28 22:21:56 -06:00
|
|
|
export IPA_UNIT_TEST_MODE="cli_test"
|
2008-08-27 20:15:27 -05:00
|
|
|
versions="python2.4 python2.5 python2.6"
|
2008-08-14 16:05:14 -05:00
|
|
|
|
2008-08-27 20:15:27 -05:00
|
|
|
for name in $versions
|
2008-08-14 16:05:14 -05:00
|
|
|
do
|
|
|
|
executable="/usr/bin/$name"
|
2008-08-27 20:15:27 -05:00
|
|
|
if [[ -f $executable ]]; then
|
|
|
|
echo "[ $name: Starting tests... ]"
|
2008-08-27 21:35:11 -05:00
|
|
|
((runs += 1))
|
2009-02-05 13:57:11 -06:00
|
|
|
if $executable /usr/bin/nosetests -v #--with-doctest
|
2008-08-27 20:15:27 -05:00
|
|
|
then
|
|
|
|
echo "[ $name: Tests OK ]"
|
|
|
|
else
|
|
|
|
echo "[ $name: Tests FAILED ]"
|
|
|
|
((failures += 1))
|
|
|
|
fi
|
2008-08-14 16:05:14 -05:00
|
|
|
else
|
2008-08-27 20:15:27 -05:00
|
|
|
echo "[ $name: Not found ]"
|
2008-08-14 16:05:14 -05:00
|
|
|
fi
|
2008-08-27 21:35:11 -05:00
|
|
|
echo ""
|
2008-08-14 16:05:14 -05:00
|
|
|
done
|
2008-08-27 20:15:27 -05:00
|
|
|
|
|
|
|
if [ $failures ]; then
|
2008-08-27 21:35:11 -05:00
|
|
|
echo "[ Ran under $runs version(s); FAILED under $failures version(s) ]"
|
2008-12-11 19:07:54 -06:00
|
|
|
echo "FAIL!"
|
2008-08-27 20:15:27 -05:00
|
|
|
exit $failures
|
2008-08-27 21:35:11 -05:00
|
|
|
else
|
|
|
|
echo "[ Ran under $runs version(s); all OK ]"
|
2008-08-27 20:15:27 -05:00
|
|
|
fi
|