comparison etc/bundled-packages/test.sh @ 4354:232d873b9705

Add support for installing bundled patches.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sun, 23 Dec 2007 20:32:16 -0800
parents
children fd714e8ba81e
comparison
equal deleted inserted replaced
4353:4143b78d0df0 4354:232d873b9705
1 # tests for the bundled packages feature
2
3 # usage: sh etc/bundled-packages/tests.sh [TMP_TEST_DIR]
4
5 # Always run this script from the top directory of the source tree.
6 # You need a mv that supports the -v for verbose flag, and a mkdir that
7 # supports the -p flag to make parents.
8 # Output from this script is preceded by 4 stars (****).
9
10 # This test script is probably more fragile than the build process, but if
11 # it runs to completion things are probably OK.
12
13 # configure the installation target
14
15 if test -z "$1"; then
16 TMP_TEST_DIR=/tmp/test/bundled-packages
17 else
18 TMP_TEST_DIR=$1
19 fi
20
21 srcdir=`pwd`
22 blddir=${TMP_TEST_DIR}/build
23 pkgdir=${TMP_TEST_DIR}/lib/xemacs
24
25 echo "**** srcdir = ${srcdir}"
26 echo "**** blddir = ${blddir}"
27 echo "**** pkgdir = ${pkgdir}"
28
29 if test -e "${pkgdir}"; then
30 echo "**** pkgdir (${pkgdir}) exists; bailing out."
31 exit -1
32 fi
33
34 # mv existing tarballs out of harm's way and make a fake one
35
36 echo "**** Moving existing tarballs to etc/bundled-packages/saved."
37 mkdir -p etc/bundled-packages/saved
38 cd etc/bundled-packages
39 echo "**** 'mv' may error because there are no files to move. It's harmless."
40 mv -v *.tar.gz saved/
41 cd ../..
42
43 # configure in a temporary directory
44
45 if test -e ${blddir}; then
46 echo "**** blddir (${blddir}) exists; bailing out."
47 exit -1
48 fi
49 mkdir -p ${blddir}
50 cd ${blddir}
51 echo "**** Running 'configure'. This takes *several minutes*."
52 echo "**** Redirecting configure output to ${blddir}/beta.err."
53 ${srcdir}/configure >beta.err 2>&1
54
55 # test check-available-packages
56
57 echo "**** This test should produce no error and no output."
58 make check-available-packages
59 cd ${srcdir}/etc/bundled-packages
60 echo "**** This test should explain how to install bootstrap packages."
61 echo "This file pretends to be a bootstrap hierarchy." > xemacs-packages
62 tar czf bootstrap.tar.gz xemacs-packages
63 rm xemacs-packages
64 cd ${blddir}
65 make check-available-packages
66 echo "**** This test should explain how to install all three."
67 cd ${srcdir}/etc/bundled-packages
68 echo "This file pretends to be a xemacs-packages hierarchy." > xemacs-packages
69 echo "This file pretends to be a mule-packages hierarchy." > mule-packages
70 tar czf xemacs-sumo.tar.gz xemacs-packages
71 tar czf xemacs-mule-sumo.tar.gz mule-packages
72 rm xemacs-packages mule-packages
73 cd ${blddir}
74 make check-available-packages
75
76 # test installation without package path given
77
78 echo "**** Make the 'make-path' utility needed by the installation routine."
79 make -C lib-src make-path
80 echo "**** This test should error because --with-late-packages wasn't given."
81 make install-bootstrap-packages
82
83 # test installation with package path given
84
85 echo "**** Running 'configure'. This takes *several minutes*."
86 echo "**** Redirecting configure output to ${blddir}/beta.err."
87 ${srcdir}/configure --with-late-packages=${pkgdir} >beta.err 2>&1
88 echo "**** Make the 'make-path' utility needed by the installation routine."
89 make -C lib-src make-path
90 echo "**** Test install-bootstrap-packages."
91 make install-bootstrap-packages
92 echo "**** The following should list xemacs-packages in the right place."
93 ls ${pkgdir}/*
94
95 #### no tests below this line ####
96
97 # put tarballs back and clean up
98
99 cd ${srcdir}/etc/bundled-packages
100 rm *.tar.gz
101 echo "**** 'mv' may error because there are no files to move. It's harmless."
102 mv -v saved/*.tar.gz ../
103 rmdir saved
104 rm -rf ${blddir} ${pkgdir}
105 exit 0