annotate etc/bundled-packages/test.sh @ 5294:bbff29a01820

Add compiler macros and compilation sanity-checks for functions with keywords. 2010-10-25 Aidan Kehoe <kehoea@parhasard.net> Add compiler macros and compilation sanity-checking for various functions that take keywords. * byte-optimize.el (side-effect-free-fns): #'symbol-value is side-effect free and not error free. * bytecomp.el (byte-compile-normal-call): Check keyword argument lists for sanity; store information about the positions where keyword arguments start using the new byte-compile-keyword-start property. * cl-macs.el (cl-const-expr-val): Take a new optional argument, cl-not-constant, defaulting to nil, in this function; return it if the expression is not constant. (cl-non-fixnum-number-p): Make this into a separate function, we want to pass it to #'every. (eql): Use it. (define-star-compiler-macros): Use the same code to generate the member*, assoc* and rassoc* compiler macros; special-case some code in #'add-to-list in subr.el. (remove, remq): Add compiler macros for these two functions, in preparation for #'remove being in C. (define-foo-if-compiler-macros): Transform (remove-if-not ...) calls to (remove ... :if-not) at compile time, which will be a real win once the latter is in C. (define-substitute-if-compiler-macros) (define-subst-if-compiler-macros): Similarly for these functions. (delete-duplicates): Change this compiler macro to use #'plists-equal; if we don't have information about the type of SEQUENCE at compile time, don't bother attempting to inline the call, the function will be in C soon enough. (equalp): Remove an old commented-out compiler macro for this, if we want to see it it's in version control. (subst-char-in-string): Transform this to a call to nsubstitute or nsubstitute, if that is appropriate. * cl.el (ldiff): Don't call setf here, this makes for a load-time dependency problem in cl-macs.el
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 25 Oct 2010 13:04:04 +0100
parents 232d873b9705
children fd714e8ba81e
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
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
3 # 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
4
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
5 # 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
6 # 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
7 # supports the -p flag to make parents.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
8 # 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
9
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
10 # 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
11 # it runs to completion things are probably OK.
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
12
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
13 # configure the installation target
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
14
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
15 if test -z "$1"; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
16 TMP_TEST_DIR=/tmp/test/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
17 else
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
18 TMP_TEST_DIR=$1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
19 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
20
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
21 srcdir=`pwd`
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
22 blddir=${TMP_TEST_DIR}/build
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
23 pkgdir=${TMP_TEST_DIR}/lib/xemacs
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 echo "**** srcdir = ${srcdir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
26 echo "**** blddir = ${blddir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
27 echo "**** pkgdir = ${pkgdir}"
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
28
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
29 if test -e "${pkgdir}"; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
30 echo "**** pkgdir (${pkgdir}) exists; bailing out."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
31 exit -1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
32 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
33
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
34 # 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
35
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
36 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
37 mkdir -p etc/bundled-packages/saved
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
38 cd etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
39 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
40 mv -v *.tar.gz saved/
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
41 cd ../..
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
42
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
43 # configure in a temporary directory
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
44
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
45 if test -e ${blddir}; then
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
46 echo "**** blddir (${blddir}) exists; bailing out."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
47 exit -1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
48 fi
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
49 mkdir -p ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
50 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
51 echo "**** Running 'configure'. This takes *several minutes*."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
52 echo "**** Redirecting configure output to ${blddir}/beta.err."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
53 ${srcdir}/configure >beta.err 2>&1
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
54
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
55 # test check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
56
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
57 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
58 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
59 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
60 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
61 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
62 tar czf bootstrap.tar.gz xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
63 rm xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
64 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
65 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
66 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
67 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
68 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
69 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
70 tar czf xemacs-sumo.tar.gz xemacs-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
71 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
72 rm xemacs-packages mule-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
73 cd ${blddir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
74 make check-available-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
75
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
76 # test installation without package path given
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
77
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
78 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
79 make -C lib-src make-path
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
80 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
81 make install-bootstrap-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
82
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
83 # test installation with package path given
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
84
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
85 echo "**** Running 'configure'. This takes *several minutes*."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
86 echo "**** Redirecting configure output to ${blddir}/beta.err."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
87 ${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
88 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
89 make -C lib-src make-path
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
90 echo "**** Test install-bootstrap-packages."
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
91 make install-bootstrap-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
92 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
93 ls ${pkgdir}/*
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
94
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
95 #### no tests below this line ####
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
96
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
97 # put tarballs back and clean up
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
98
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
99 cd ${srcdir}/etc/bundled-packages
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
100 rm *.tar.gz
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
101 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
102 mv -v saved/*.tar.gz ../
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
103 rmdir saved
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
104 rm -rf ${blddir} ${pkgdir}
232d873b9705 Add support for installing bundled patches.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
diff changeset
105 exit 0