blob: 9f83837c3a04c7db67ac173f1625b7d724a04070 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
#!/bin/bash
# Author: Andreas Roehler <andreas.roehler@online.de>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Commentary:
# This script tests Emacs python-mode.
# Caveats:
#
# needs being started in `test' directory
# optional shell argument PATH/TO/EMACS-SOURCE-DIRECTORY might be given
#
# If testing with emacs-24 please be aware of bug 11984 [0], for the
# time being the patch will need to be added manually.
#
# IPython 0.12 due to a bug in argparse requires a patch [1] to work.
#
# 0. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11984
# 1. http://bugs.python.org/issue13720
# Code:
# if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
# hash -r 2>/dev/null
# fi
# needs being in `test' directory
# PCOT=`pwd`
PCOT=$PWD
# PDIR=".."
PDIR=$(cd ..; pwd)
# the directory that this file is in.
# TESTDIR="$(dirname "$0")"
# PDIR="$TESTDIR/.."
# write PATH-TO-EMACS source code default directory here
EMACS_DEFAULT_DIR="/usr/share/emacs/24.2"
EMACS_DIR=
if [ $1 ]; then
echo "\$1: $1"
EMACS_DIR=$1
else
EMACS_DIR=$EMACS_DEFAULT_DIR
fi
[ -s python-mode-ert-results.txt ] && rm -f python-mode-ert-results.txt
# else
# cat <<EOF
# usage: ${0##*/} EMACS_DIR
#
# This script tests python-mode with non-installed Emacsen in a Bash.
#
# It assumes being in directory "test" below python-mode.el and relies on source-code directories as delivered by bzr branch.
#
# Edit \$EMACS_DIR to specify an Emacs or put "PATH-TO-EMACS-SOURCES" as shell argument.
#
# To run tests with installed Emacs, load available test-files like "py-bug-numbered-tests.el" and do "M-x py-run-bug-numbered-tests". Alternatively you may edit variables making it point according to you installation.
#
# EOF
#
# fi
echo "\$EMACS_DIR: $EMACS_DIR"
if [ $1 ]; then
EMACS="$EMACS_DIR/src/emacs"
else
EMACS=emacs
fi
echo "\$EMACS: $EMACS"
# EMACS="/usr/bin/emacs"
# python-mode file to load
if [ -s "../python-components-mode.el" ];
then
PYTHONMODE="../python-components-mode.el"
elif
[ -s "../python-mode.el" ];
then
PYTHONMODE="../python-mode.el"
else
cat <<EOF
usage: ${0##*/} EMACS_DIR
This script tests python-mode with non-installed Emacsen in a Bash.
It assumes being in directory "test" below python-mode.el and relies on source-code directories as delivered by bzr branch.
Edit \$EMACS_DIR to specify an Emacs or put "PATH-TO-EMACS-SOURCES" as shell argument.
To run tests with installed Emacs, load available test-files like "py-bug-numbered-tests.el" and do "M-x py-run-bug-numbered-tests". Alternatively you may edit variables making it point according to you installation.
EOF
fi
# edit this to get locally installed stuff loaded
MYEXTENSIONS="${HOME}/arbeit/emacs/elisp"
APAIR="${HOME}/arbeit/emacs/autopair/autopair.el"
if [ -s ${HOME}/.emacs.d/elpa/smart-operator-4.0/smart-operator.elc ];then
SO="${HOME}/.emacs.d/elpa/smart-operator-4.0/smart-operator.elc"
elif [ -s ${HOME}/.emacs.d/elpa/smart-operator-4.0/smart-operator.el ];then
SO="${HOME}/.emacs.d/elpa/smart-operator-4.0/smart-operator.el"
else
SO="${MYEXTENSIONS}/smart-operator.el"
fi
COLMK="$PDIR/extensions/column-marker.el"
HIGHL="$PDIR/extensions/highlight-indentation.el"
# CLMACS="${EMACS_DIR}/lisp/emacs-lisp/cl-macs.el"
if [ -s "${EMACS_DIR}/lisp/emacs-lisp/cl-macs.elc" ];then
CLMACS="${EMACS_DIR}/lisp/emacs-lisp/cl-macs.elc"
elif [ -s "${EMACS_DIR}/lisp/emacs-lisp/cl-macs.el" ];then
CLMACS="${EMACS_DIR}/lisp/emacs-lisp/cl-macs.el"
else echo "${EMACS_DIR}/lisp/emacs-lisp/cl-macs.el not found"
fi
# BYTECOMP="${EMACS_DIR}/lisp/emacs-lisp/bytecomp.el"
if [ -s "${EMACS_DIR}/lisp/emacs-lisp/bytecomp.elc" ];then
BYTECOMP="${EMACS_DIR}/lisp/emacs-lisp/bytecomp.elc"
else
BYTECOMP="${EMACS_DIR}/lisp/emacs-lisp/bytecomp.el"
fi
if [ -s "${EMACS_DIR}/lisp/custom.elc" ];then
CUSTOM="${EMACS_DIR}/lisp/custom.elc"
else
CUSTOM="${EMACS_DIR}/lisp/comint.el"
fi
if [ -s "${EMACS_DIR}/lisp/ansi-color.elc" ];then
ANSICOLOR="${EMACS_DIR}/lisp/ansi-color.elc"
else
ANSICOLOR="${EMACS_DIR}/lisp/ansi-color.el"
fi
if [ -s "${EMACS_DIR}/lisp/comint.elc" ]; then
COMINT="${EMACS_DIR}/lisp/comint.elc"
else
COMINT="${EMACS_DIR}/lisp/comint.el"
fi
if [ -s "${EMACS_DIR}/lisp/progmodes/cc-cmds.el" ];then
CC_CMDS="${EMACS_DIR}/lisp/progmodes/cc-cmds.el"
echo "\$CC_CMDS: $CC_CMDS"
elif [ -s "${EMACS_DIR}/lisp/progmodes/cc-cmds.el.gz" ];then
CC_CMDS="${EMACS_DIR}/lisp/progmodes/cc-cmds.el.gz"
echo "\$CC_CMDS: $CC_CMDS"
else
echo "${EMACS_DIR}/lisp/progmodes/cc-cmds.el not found"
fi
# SKEL="${EMACS_DIR}/lisp/skeleton.el"
if [ -s "${EMACS_DIR}/lisp/skeleton.elc" ];then
SKELETON="${EMACS_DIR}/lisp/skeleton.elc"
else
SKELETON="${EMACS_DIR}/lisp/skeleton.el"
fi
PYCO="$PDIR/completion/pycomplete.el"
# $EMACS -Q -batch -l $HOME/emacs_20130227/lisp/emacs-lisp/cl-lib.el -l $HOME/emacs_20130227/lisp/emacs-lisp/ert.el -l ${PCOT}/py-ert-tests.el -f ert-run-tests-batch-and-exit
# $EMACS -Q -batch -load ${EMACS_DIR}lisp/emacs-lisp/ert.el -load ${PCOT}/python-mode-ert-tests.el -f ert-run-tests-batch-and-exit
$EMACS -Q --batch --eval "(message (emacs-version))" --eval "(when (featurep 'python)(unload-feature 'python t))" --eval "(when (featurep 'python-mode)(unload-feature 'python-mode t))" --eval "(add-to-list 'load-path \"$PDIR/\")" --eval "(add-to-list 'load-path \"$TESTDIR/\")" --eval "(setq py-install-directory \"$PDIR\"))" --eval "(message \"py-install-directory: %s\" py-install-directory)" --eval "(setq py-load-pymacs-p nil)" -load $BYTECOMP -load $CC_CMDS -load $COMINT -load $ANSICOLOR -load $CLMACS -load $CUSTOM -load $SKELETON -load $SO -load $COLMK -load $HIGHL -load $PYTHONMODE --eval "(message \"py-temp-directory: %s\" py-temp-directory)" -l py-ert-tests-2.el -f ert-run-tests-batch-and-exit
# | tee -a python-mode-ert-results.txt && cat python-mode-ert-results.txt | grep FAILED
|