2018-02-26 20:20:11 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# Test script for travis-ci.org continuous integration.
|
|
|
|
|
2018-07-05 21:19:37 +02:00
|
|
|
# Stop script early on any error; check variables
|
2018-07-05 17:49:10 +02:00
|
|
|
set -eu
|
2018-02-26 20:20:11 +01:00
|
|
|
|
|
|
|
# Paths to tools installed by travis-install.sh
|
2018-06-28 21:03:41 +02: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 22:17:34 +02:00
|
|
|
export PATH=${BUILD_DIR}/pru-gcc/bin:${PATH}
|
2018-06-28 21:03:41 +02:00
|
|
|
PYTHON=${BUILD_DIR}/python-env/bin/python
|
2018-02-26 20:20:11 +01:00
|
|
|
|
|
|
|
|
2018-07-05 17:49:10 +02:00
|
|
|
######################################################################
|
|
|
|
# Travis CI helpers
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
start_test()
|
|
|
|
{
|
|
|
|
echo "travis_fold:start:$1"
|
|
|
|
echo "=============== $2"
|
|
|
|
set -x
|
|
|
|
}
|
|
|
|
|
|
|
|
finish_test()
|
|
|
|
{
|
|
|
|
set +x
|
|
|
|
echo "=============== Finished $2"
|
|
|
|
echo "travis_fold:end:$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-06-28 19:00:54 +02:00
|
|
|
######################################################################
|
|
|
|
# Check for whitespace errors
|
|
|
|
######################################################################
|
|
|
|
|
2018-07-08 15:29:13 +02:00
|
|
|
start_test check_whitespace "Check whitespace"
|
2019-06-23 23:44:48 +02:00
|
|
|
./scripts/check_whitespace.sh
|
2018-07-05 17:49:10 +02:00
|
|
|
finish_test check_whitespace "Check whitespace"
|
2018-06-28 19:00:54 +02:00
|
|
|
|
|
|
|
|
2018-02-26 20:20:11 +01:00
|
|
|
######################################################################
|
|
|
|
# Run compile tests for several different MCU types
|
|
|
|
######################################################################
|
|
|
|
|
2018-06-28 21:03:41 +02:00
|
|
|
DICTDIR=${BUILD_DIR}/dict
|
2018-02-26 20:20:11 +01:00
|
|
|
mkdir -p ${DICTDIR}
|
|
|
|
|
|
|
|
for TARGET in test/configs/*.config ; do
|
2018-08-01 20:05:31 +02:00
|
|
|
start_test mcu_compile "$TARGET"
|
2018-02-26 20:20:11 +01:00
|
|
|
make clean
|
|
|
|
make distclean
|
|
|
|
unset CC
|
|
|
|
cp ${TARGET} .config
|
|
|
|
make olddefconfig
|
|
|
|
make V=1
|
2018-07-05 17:49:10 +02:00
|
|
|
finish_test mcu_compile "$TARGET"
|
2018-07-08 15:29:13 +02:00
|
|
|
cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict
|
2018-02-26 20:20:11 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Verify klippy host software
|
|
|
|
######################################################################
|
|
|
|
|
2018-06-28 21:03:41 +02:00
|
|
|
HOSTDIR=${BUILD_DIR}/hosttest
|
2018-02-26 20:20:11 +01:00
|
|
|
mkdir -p ${HOSTDIR}
|
|
|
|
|
2018-07-05 17:49:10 +02:00
|
|
|
start_test klippy "Test invoke klippy"
|
2017-09-12 02:53:32 +02:00
|
|
|
$PYTHON scripts/test_klippy.py -d ${DICTDIR} test/klippy/*.test
|
2018-07-05 17:49:10 +02:00
|
|
|
finish_test klippy "Test invoke klippy"
|