Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 5db03e88 authored by Ryan C. Thompson's avatar Ryan C. Thompson

More intelligent test file guessing.

Now you can say "test/run-test.sh 303" to run the test
"test/el-get-issue-303.el"

Also, give an explicit error message when a test file does not exist.
parent d564974c
......@@ -19,13 +19,21 @@ set_default TEST_HOME "$TMPDIR/el-get-test-home"
set_default EMACS "$(which emacs)"
run_test () {
testfile="$1"
echo "*** Running el-get test $testfile interactively ***"
mkdir -p "$TEST_HOME"/.emacs.d
rm -rf "$TEST_HOME"/.emacs.d/el-get/
HOME="$TEST_HOME" "$EMACS" -Q -L "$EL_GET_LIB_DIR" \
-f toggle-debug-on-error -l "$EL_GET_LIB_DIR/el-get.el" \
-l "$testfile"
for x in "$1" "$TEST_DIR/$1" "$TEST_DIR/$1.el" "$TEST_DIR/el-get-issue-$1.el"; do
if [ -f "$x" ]; then
testfile="$x"
fi
done
if [ -z "$testfile" ]; then
echo "*** ERROR $1: Could not find test file ***"
else
echo "*** Running el-get test $testfile interactively ***"
mkdir -p "$TEST_HOME"/.emacs.d
rm -rf "$TEST_HOME"/.emacs.d/el-get/
HOME="$TEST_HOME" "$EMACS" -Q -L "$EL_GET_LIB_DIR" \
-f toggle-debug-on-error -l "$EL_GET_LIB_DIR/el-get.el" \
-l "$testfile"
fi
}
for t in "$@"; do
......
......@@ -15,25 +15,34 @@ fi
set_default EL_GET_LIB_DIR "$(dirname "$(dirname "$(readlink -f "$0")")")"
set_default TMPDIR "$(dirname "$(mktemp --dry-run)")"
set_default TEST_HOME "$TMPDIR/el-get-test-home"
set_default TEMP_HOME "$TMPDIR/el-get-test-home"
set_default EMACS "$(which emacs)"
set_default TEST_DIR "$(dirname $0)"
# 5 seconds in between tests to avoid accidental DoS from running too
# many tests in a short time
set_default DELAY_BETWEEN_TESTS 5
run_test () {
testfile="$1"
echo "*** Running el-get test $testfile ***"
mkdir -p "$TEST_HOME"/.emacs.d
rm -rf "$TEST_HOME"/.emacs.d/el-get/
HOME="$TEST_HOME" "$EMACS" -Q -batch -L "$EL_GET_LIB_DIR" \
-l "$EL_GET_LIB_DIR/el-get.el" -l "$testfile"
result="$?"
if [ "$result" = 0 ]; then
echo "*** SUCCESS $testfile ***"
for x in "$1" "$TEST_DIR/$1" "$TEST_DIR/$1.el" "$TEST_DIR/el-get-issue-$1.el"; do
if [ -f "$x" ]; then
testfile="$x"
fi
done
if [ -z "$testfile" ]; then
echo "*** ERROR $1: Could not find test file ***"
else
echo "*** FAILED $testfile ***"
echo "*** Running el-get test $testfile ***"
mkdir -p "$TEMP_HOME"/.emacs.d
rm -rf "$TEMP_HOME"/.emacs.d/el-get/
HOME="$TEMP_HOME" "$EMACS" -Q -batch -L "$EL_GET_LIB_DIR" \
-l "$EL_GET_LIB_DIR/el-get.el" -l "$testfile"
result="$?"
if [ "$result" = 0 ]; then
echo "*** SUCCESS $testfile ***"
else
echo "*** FAILED $testfile ***"
fi
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment