2018-02-26 22:20:11 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# Test script for travis-ci.org continuous integration.
|
|
|
|
|
|
|
|
# Stop script early on any error; check variables; be verbose
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
# Paths to tools installed by travis-install.sh
|
2018-06-28 22:03:41 +03:00
|
|
|
MAIN_DIR=${PWD}
|
|
|
|
BUILD_DIR=${PWD}/travis_build
|
|
|
|
export PATH=${BUILD_DIR}/gcc-arm-none-eabi-7-2017-q4-major/bin:${PATH}
|
2018-06-28 23:17:34 +03:00
|
|
|
export PATH=${BUILD_DIR}/pru-gcc/bin:${PATH}
|
2018-06-28 22:03:41 +03:00
|
|
|
PYTHON=${BUILD_DIR}/python-env/bin/python
|
2018-02-26 22:20:11 +03:00
|
|
|
|
|
|
|
|
2018-06-28 20:00:54 +03:00
|
|
|
######################################################################
|
|
|
|
# Check for whitespace errors
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
echo "travis_fold:start:check_whitespace"
|
|
|
|
echo "=============== Check whitespace"
|
2018-07-01 16:42:09 +03:00
|
|
|
WS_DIRS="config/ docs/ klippy/ scripts/ src/ test/"
|
2018-07-01 16:45:25 +03:00
|
|
|
WS_EXCLUDE="-path scripts/kconfig -prune"
|
2018-07-01 16:50:42 +03:00
|
|
|
WS_FILES="-o -iname '*.[csh]' -o -name '*.py' -o -name '*.sh'"
|
2018-06-28 20:00:54 +03:00
|
|
|
WS_FILES="$WS_FILES -o -name '*.md' -o -name '*.cfg'"
|
2018-07-01 17:52:30 +03:00
|
|
|
WS_FILES="$WS_FILES -o -name '*.test' -o -name '*.config'"
|
2018-07-01 16:50:42 +03:00
|
|
|
WS_FILES="$WS_FILES -o -iname '*.lds' -o -iname 'Makefile' -o -iname 'Kconfig'"
|
2018-06-28 20:00:54 +03:00
|
|
|
eval find $WS_DIRS $WS_EXCLUDE $WS_FILES | xargs ./scripts/check_whitespace.py
|
|
|
|
echo "travis_fold:end:check_whitespace"
|
|
|
|
|
|
|
|
|
2018-02-26 22:20:11 +03:00
|
|
|
######################################################################
|
|
|
|
# Run compile tests for several different MCU types
|
|
|
|
######################################################################
|
|
|
|
|
2018-06-28 22:03:41 +03:00
|
|
|
DICTDIR=${BUILD_DIR}/dict
|
2018-02-26 22:20:11 +03:00
|
|
|
mkdir -p ${DICTDIR}
|
|
|
|
|
|
|
|
for TARGET in test/configs/*.config ; do
|
2018-02-26 23:21:39 +03:00
|
|
|
echo "travis_fold:start:mcu_compile $TARGET"
|
2018-02-26 22:20:11 +03:00
|
|
|
echo "=============== Test compile $TARGET"
|
|
|
|
make clean
|
|
|
|
make distclean
|
|
|
|
unset CC
|
|
|
|
cp ${TARGET} .config
|
|
|
|
make olddefconfig
|
|
|
|
make V=1
|
|
|
|
cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict
|
2018-02-26 23:21:39 +03:00
|
|
|
echo "travis_fold:end:mcu_compile $TARGET"
|
2018-02-26 22:20:11 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Verify klippy host software
|
|
|
|
######################################################################
|
|
|
|
|
2018-06-28 22:03:41 +03:00
|
|
|
HOSTDIR=${BUILD_DIR}/hosttest
|
2018-02-26 22:20:11 +03:00
|
|
|
mkdir -p ${HOSTDIR}
|
|
|
|
|
2018-02-26 23:21:39 +03:00
|
|
|
echo "travis_fold:start:klippy"
|
2018-02-26 22:20:11 +03:00
|
|
|
echo "=============== Test invoke klippy"
|
2017-09-12 03:53:32 +03:00
|
|
|
$PYTHON scripts/test_klippy.py -d ${DICTDIR} test/klippy/*.test
|
2018-02-26 23:21:39 +03:00
|
|
|
echo "travis_fold:end:klippy"
|