annotate etc/bundled-packages/test.sh @ 5411:fd714e8ba81e

Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
author Mats Lidell <matsl@xemacs.org>
date Sun, 24 Oct 2010 00:20:52 +0200
parents 232d873b9705
children 90dcf2376909
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4354
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
1 # tests for the bundled packages feature
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
2
5411
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
3 # This file is part of XEmacs.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
4
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
5 # XEmacs is free software: you can redistribute it and/or modify it
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
6 # under the terms of the GNU General Public License as published by the
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
7 # Free Software Foundation, either version 3 of the License, or (at your
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
8 # option) any later version.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
9
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
10 # XEmacs is distributed in the hope that it will be useful, but WITHOUT
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
13 # for more details.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
14
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
15 # You should have received a copy of the GNU General Public License
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
16 # along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
fd714e8ba81e Converted to GPLv3 or later. Written by Stephen Turnbull hence.GPLv2 or later.
Mats Lidell <matsl@xemacs.org>
parents: 4354
diff changeset
17
4354
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
18 # usage: sh etc/bundled-packages/tests.sh [TMP_TEST_DIR]
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
19
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
20 # Always run this script from the top directory of the source tree.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
21 # You need a mv that supports the -v for verbose flag, and a mkdir that
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
22 # supports the -p flag to make parents.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
23 # Output from this script is preceded by 4 stars (****).
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
24
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
25 # This test script is probably more fragile than the build process, but if
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
26 # it runs to completion things are probably OK.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
27
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
28 # configure the installation target
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
29
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
30 if test -z "$1"; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
31 TMP_TEST_DIR=/tmp/test/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
32 else
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
33 TMP_TEST_DIR=$1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
34 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
35
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
36 srcdir=`pwd`
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
37 blddir=${TMP_TEST_DIR}/build
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
38 pkgdir=${TMP_TEST_DIR}/lib/xemacs
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
39
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
40 echo "**** srcdir = ${srcdir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
41 echo "**** blddir = ${blddir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
42 echo "**** pkgdir = ${pkgdir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
43
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
44 if test -e "${pkgdir}"; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
45 echo "**** pkgdir (${pkgdir}) exists; bailing out."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
46 exit -1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
47 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
48
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
49 # mv existing tarballs out of harm's way and make a fake one
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
50
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
51 echo "**** Moving existing tarballs to etc/bundled-packages/saved."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
52 mkdir -p etc/bundled-packages/saved
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
53 cd etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
54 echo "**** 'mv' may error because there are no files to move. It's harmless."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
55 mv -v *.tar.gz saved/
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
56 cd ../..
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
57
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
58 # configure in a temporary directory
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
59
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
60 if test -e ${blddir}; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
61 echo "**** blddir (${blddir}) exists; bailing out."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
62 exit -1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
63 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
64 mkdir -p ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
65 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
66 echo "**** Running 'configure'. This takes *several minutes*."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
67 echo "**** Redirecting configure output to ${blddir}/beta.err."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
68 ${srcdir}/configure >beta.err 2>&1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
69
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
70 # test check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
71
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
72 echo "**** This test should produce no error and no output."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
73 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
74 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
75 echo "**** This test should explain how to install bootstrap packages."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
76 echo "This file pretends to be a bootstrap hierarchy." > xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
77 tar czf bootstrap.tar.gz xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
78 rm xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
79 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
80 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
81 echo "**** This test should explain how to install all three."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
82 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
83 echo "This file pretends to be a xemacs-packages hierarchy." > xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
84 echo "This file pretends to be a mule-packages hierarchy." > mule-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
85 tar czf xemacs-sumo.tar.gz xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
86 tar czf xemacs-mule-sumo.tar.gz mule-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
87 rm xemacs-packages mule-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
88 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
89 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
90
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
91 # test installation without package path given
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
92
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
93 echo "**** Make the 'make-path' utility needed by the installation routine."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
94 make -C lib-src make-path
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
95 echo "**** This test should error because --with-late-packages wasn't given."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
96 make install-bootstrap-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
97
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
98 # test installation with package path given
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
99
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
100 echo "**** Running 'configure'. This takes *several minutes*."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
101 echo "**** Redirecting configure output to ${blddir}/beta.err."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
102 ${srcdir}/configure --with-late-packages=${pkgdir} >beta.err 2>&1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
103 echo "**** Make the 'make-path' utility needed by the installation routine."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
104 make -C lib-src make-path
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
105 echo "**** Test install-bootstrap-packages."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
106 make install-bootstrap-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
107 echo "**** The following should list xemacs-packages in the right place."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
108 ls ${pkgdir}/*
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
109
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
110 #### no tests below this line ####
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
111
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
112 # put tarballs back and clean up
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
113
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
114 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
115 rm *.tar.gz
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
116 echo "**** 'mv' may error because there are no files to move. It's harmless."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
117 mv -v saved/*.tar.gz ../
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
118 rmdir saved
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
119 rm -rf ${blddir} ${pkgdir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
120 exit 0