3 # testing of a release tarball extracted from release.sh
4 # because if this breaks release.sh exits
5 # and running tests again 2.4 to 2.7 automatic never worked for me
6 # and 3.x is not included
9 # Contact: grubert@users.sourceforge.net
10 # Revision: $Revision: 7548 $
11 # Date: $Date: 2012-12-13 10:08:17 +0100 (Don, 13 Dez 2012) $
12 # Copyright: This script has been placed in the public domain.
14 USAGE
="USAGE $0 python-version docutils-version"
20 if [ -z "`which python$py_ver`" ] ; then
21 echo "ERROR python$py_ver not found."
26 tarball
=docutils-
${docutils_ver}.
tar.gz
28 if [ ! -e $tarball ] ; then
29 echo "ERROR $tarball not found."
34 function print_command
()
36 # Print "$@", quoting parameters containing spaces.
39 echo "$param" |
grep -Fq ' ' && echo -n " '$param'" ||
echo -n " $param"
51 echo "Testing the release tarball: docutils-${docutils_ver} under python$py_ver."
53 echo "ATTENTION: some parts must be run as root/sudo to be able to remove/install into site-packages."
59 run mkdir
-p $test_dir
62 py_ver_maj
=${py_ver:0:1}
63 echo "Deleting and installing Docutils on Python $py_ver ($py_ver_maj)."
67 if [ $py_ver_maj = "2" ] ; then
68 docutils_install_dir
=$
(python
$py_ver -c 'import docutils, os.path; print os.path.dirname(docutils.__file__)')
70 docutils_install_dir
=$
(python
$py_ver -c 'import docutils, os.path; print(os.path.dirname(docutils.__file__))')
73 if [ -z "$docutils_install_dir" ] ; then
74 echo "No docutils installation found"
76 echo "docutils installation found: $docutils_install_dir"
77 echo "remove docutils installation (sudo). Ctrl-C to abort"
79 sudo
rm -rfv $docutils_install_dir
82 echo "build and install (sudo). Ctrl-C to abort"
84 run
tar xzf ..
/$tarball
86 cd docutils-
"$docutils_ver"
88 python
$py_ver setup.py build
89 sudo python
$py_ver setup.py
install
91 echo "Remove __init__.py from docutils code directory to make sure it is not used.."
93 rm -rf docutils
/__init__.py
95 # BUG test-dependecies.py
96 # * breaks on record.txt access if not run as root
97 # * fails missing dependencies to files in docutils/docs.
99 echo "run alltests.py"
101 if [ ${py_ver_maj} = "2" ] ; then
107 python
$py_ver -u ${TESTD}/alltests.py
109 echo "remove test directory Ctrl C to abort"