mirror of
https://github.com/dimitri/el-get.git
synced 2024-09-29 13:08:51 +08:00
5b213704f6
* .travis.yml: * test/travis-ci.sh (ert-tests): Load mm-util for 26-prerelease to avoid Bug#30258. * el-get-custom.el (el-get-status-file): Add :type.
69 lines
2.3 KiB
Bash
69 lines
2.3 KiB
Bash
# source me
|
|
# Define the following functions here to keep .travis.yml nice and tidy
|
|
# - prereqs()
|
|
# - byte-compile()
|
|
# - check-recipes()
|
|
# - check-whitespace()
|
|
# - ert-tests()
|
|
|
|
# Installs Emacs plus ert and package.el as needed.
|
|
prereqs() {
|
|
curl -LO https://github.com/npostavs/emacs-travis/releases/download/bins/emacs-bin-${EMACS_VERSION}.tar.gz
|
|
tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C /
|
|
# Configure $PATH: Emacs installed to /tmp/emacs
|
|
export PATH=/tmp/emacs/bin:${PATH}
|
|
|
|
# Put external elisp into pkg/.
|
|
(mkdir -p pkg && cd pkg
|
|
if ! emacs -Q --batch --eval "(require 'ert)" ; then
|
|
ert_compat=https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205
|
|
curl -LO $ert_compat/lisp/emacs-lisp/ert.el \
|
|
-O $ert_compat/lisp/emacs-lisp/ert-x.el
|
|
fi
|
|
if ! emacs -Q --batch --eval "(require 'package)" ; then
|
|
pkg_compat23=https://raw.githubusercontent.com/mirrors/emacs/ba08b24186711eaeb3748f3d1f23e2c2d9ed0d09
|
|
curl -LO $pkg_compat23/lisp/emacs-lisp/package.el \
|
|
-O $pkg_compat23/lisp/emacs-lisp/package-x.el
|
|
fi)
|
|
}
|
|
|
|
if [ "$EMACS_VERSION" = '24.5' ]; then
|
|
# check-recipes [-W<check>...] <path>
|
|
check-recipes() {
|
|
emacs -Q -L . -batch -l el-get-check -f el-get-check-recipe-batch "$@"
|
|
}
|
|
check-whitespace() {
|
|
git --no-pager -c core.whitespace=tab-in-indent diff --check "$TRAVIS_COMMIT_RANGE"
|
|
}
|
|
else
|
|
# If we have only changes to recipe files, there is no need to run
|
|
# with more than 1 emacs version.
|
|
git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep -Fvq recipes/ ||
|
|
{ echo 'Recipe only diff, skipping tests' ; exit 0 ; }
|
|
|
|
# Only need to run these for 1 version, so make them nops here
|
|
check-recipes() { :; }
|
|
check-whitespace() { :; }
|
|
fi
|
|
|
|
ert-tests() {
|
|
emacs -batch -Q $EMACS_OPT -L pkg/ -L . -l test/el-get-tests.el -f ert-run-tests-batch-and-exit
|
|
}
|
|
|
|
# byte-compile [-Werror] <files>...
|
|
byte-compile() {
|
|
error_on_warning=nil
|
|
if [ "$1" = "-Werror" ] ; then
|
|
error_on_warning=t
|
|
shift
|
|
fi
|
|
emacs -Q -L pkg/ -L . -L methods/ -batch \
|
|
--eval "(setq byte-compile-error-on-warn $error_on_warning)" \
|
|
-f batch-byte-compile "$@"
|
|
}
|
|
|
|
shopt -s nullglob
|
|
|
|
# show definitions for log
|
|
declare -f prereqs byte-compile ert-tests check-recipes check-whitespace
|