2018-02-26 22:20:11 +03:00
|
|
|
#!/bin/bash
|
2020-10-30 22:14:39 +03:00
|
|
|
# Test script for continuous integration.
|
2018-02-26 22:20:11 +03:00
|
|
|
|
2018-07-05 22:19:37 +03:00
|
|
|
# Stop script early on any error; check variables
|
2018-07-05 18:49:10 +03:00
|
|
|
set -eu
|
2018-02-26 22:20:11 +03:00
|
|
|
|
2020-10-30 22:14:39 +03:00
|
|
|
# Paths to tools installed by ci-install.sh
|
2018-06-28 22:03:41 +03:00
|
|
|
MAIN_DIR=${PWD}
|
2020-10-30 22:14:39 +03:00
|
|
|
BUILD_DIR=${PWD}/ci_build
|
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-07-05 18:49:10 +03:00
|
|
|
######################################################################
|
2020-10-30 22:14:39 +03:00
|
|
|
# Section grouping output message helpers
|
2018-07-05 18:49:10 +03:00
|
|
|
######################################################################
|
|
|
|
|
|
|
|
start_test()
|
|
|
|
{
|
2020-09-26 05:13:56 +03:00
|
|
|
echo "::group::=============== $1 $2"
|
2018-07-05 18:49:10 +03:00
|
|
|
set -x
|
|
|
|
}
|
|
|
|
|
|
|
|
finish_test()
|
|
|
|
{
|
|
|
|
set +x
|
|
|
|
echo "=============== Finished $2"
|
2020-09-26 05:13:56 +03:00
|
|
|
echo "::endgroup::"
|
2018-07-05 18:49:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-06-28 20:00:54 +03:00
|
|
|
######################################################################
|
|
|
|
# Check for whitespace errors
|
|
|
|
######################################################################
|
|
|
|
|
2018-07-08 16:29:13 +03:00
|
|
|
start_test check_whitespace "Check whitespace"
|
2019-06-24 00:44:48 +03:00
|
|
|
./scripts/check_whitespace.sh
|
2018-07-05 18:49:10 +03:00
|
|
|
finish_test check_whitespace "Check whitespace"
|
2018-06-28 20:00:54 +03:00
|
|
|
|
|
|
|
|
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-08-01 21:05:31 +03:00
|
|
|
start_test mcu_compile "$TARGET"
|
2018-02-26 22:20:11 +03:00
|
|
|
make clean
|
|
|
|
make distclean
|
|
|
|
unset CC
|
|
|
|
cp ${TARGET} .config
|
|
|
|
make olddefconfig
|
|
|
|
make V=1
|
2018-07-05 18:49:10 +03:00
|
|
|
finish_test mcu_compile "$TARGET"
|
2018-07-08 16:29:13 +03:00
|
|
|
cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict
|
2018-02-26 22:20:11 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Verify klippy host software
|
|
|
|
######################################################################
|
|
|
|
|
2018-07-05 18:49:10 +03:00
|
|
|
start_test klippy "Test invoke klippy"
|
2017-09-12 03:53:32 +03:00
|
|
|
$PYTHON scripts/test_klippy.py -d ${DICTDIR} test/klippy/*.test
|
2018-07-05 18:49:10 +03:00
|
|
|
finish_test klippy "Test invoke klippy"
|