2015-07-31 08:30:42 +00:00
|
|
|
|
#!/usr/bin/env bash
|
2015-01-23 04:02:41 +00:00
|
|
|
|
## run_build.sh --- Travis CI File for Spacemacs
|
|
|
|
|
##
|
|
|
|
|
## Copyright (c) 2012-2014 Sylvain Benner
|
|
|
|
|
## Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
|
|
|
|
##
|
|
|
|
|
## Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
## URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
##
|
|
|
|
|
## This file is not part of GNU Emacs.
|
|
|
|
|
##
|
|
|
|
|
## License: GPLv3
|
2015-07-31 08:30:42 +00:00
|
|
|
|
|
2015-09-23 12:55:33 +00:00
|
|
|
|
tests=("core")
|
2015-07-31 08:30:42 +00:00
|
|
|
|
|
|
|
|
|
if [ $USER != "travis" ]; then
|
|
|
|
|
echo "This script is not designed to run locally."
|
|
|
|
|
echo "Instead, navigate to the appropriate test folder and run make there instead."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2016-03-07 09:50:29 +00:00
|
|
|
|
if [ $TRAVIS_SECURE_ENV_VARS = false ] &&
|
|
|
|
|
[ $TRAVIS_PULL_REQUEST != false ] &&
|
2017-03-24 06:18:46 +00:00
|
|
|
|
[ "$TRAVIS_BRANCH" = "master" ]; then
|
2016-03-07 09:50:29 +00:00
|
|
|
|
|
|
|
|
|
printf '=%.0s' {1..70}
|
|
|
|
|
printf "\n し(*・∀・)/ Thanks for the contribution! \(・∀・*)ノ\n"
|
|
|
|
|
printf '=%.0s' {1..70}
|
|
|
|
|
printf "\n( ^◡^)っ Please submit your pull request against the develop branch.\n"
|
|
|
|
|
echo "You can read the contribution guidelines at:"
|
|
|
|
|
echo "https://github.com/syl20bnr/spacemacs/blob/develop/CONTRIBUTING.org"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2017-03-24 06:18:46 +00:00
|
|
|
|
if [ "${FORMATTING}" = "space-test" ]; then
|
|
|
|
|
cd "${TRAVIS_BUILD_DIR}"
|
|
|
|
|
echo "Testing for trailing and all sorts of broken white spaces"
|
|
|
|
|
echo "TRAVIS_COMMIT_RANGE: ${TRAVIS_COMMIT_RANGE}"
|
|
|
|
|
first_commit=`echo ${TRAVIS_COMMIT_RANGE} | sed -r 's/\..*//'`
|
|
|
|
|
git reset -q "${first_commit}"
|
|
|
|
|
## git reset -q HEAD~1
|
|
|
|
|
git diff --check > space_test_result
|
|
|
|
|
if [[ -s space_test_result ]]; then
|
|
|
|
|
cat space_test_result
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo "No bad spaces detected"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Emacs tests
|
2015-12-11 05:40:15 +00:00
|
|
|
|
echo "Pwd $(pwd)"
|
|
|
|
|
rm -rf ~/.emacs.d
|
|
|
|
|
ln -sf `pwd` ~/.emacs.d
|
2015-07-31 08:30:42 +00:00
|
|
|
|
|
|
|
|
|
for test in "${tests[@]}"; do
|
|
|
|
|
rm -rf ~/.emacs.d/elpa
|
|
|
|
|
rm -rf ~/.emacs.d/.cache
|
2015-12-11 05:40:15 +00:00
|
|
|
|
rm -f ~/.spacemacs
|
2015-07-31 08:30:42 +00:00
|
|
|
|
|
|
|
|
|
testdir=~/.emacs.d/tests/$test
|
2015-12-11 05:40:15 +00:00
|
|
|
|
echo "Running '$test' in '$testdir' folder"
|
2015-07-31 08:30:42 +00:00
|
|
|
|
if [ -f $testdir/dotspacemacs.el ]; then
|
|
|
|
|
cp $testdir/dotspacemacs.el ~/.spacemacs
|
|
|
|
|
fi
|
2015-12-11 05:40:15 +00:00
|
|
|
|
cd $testdir && echo "Now in $(pwd)"
|
2015-07-31 08:30:42 +00:00
|
|
|
|
make test || exit 2
|
|
|
|
|
done
|