2015-11-18 13:36:51 +01:00
|
|
|
#!/usr/bin/env bash
|
2015-02-24 00:23:34 +01:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 Philipp Rosenkranz <philipp.rosenkranz@fu-berlin.de>
|
|
|
|
#
|
|
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
# directory for more details.
|
|
|
|
#
|
|
|
|
|
2016-07-13 16:04:26 +02:00
|
|
|
CI_BASE_BRANCH=${CI_BASE_BRANCH:-master}
|
|
|
|
|
2015-02-24 00:17:28 +01:00
|
|
|
if [[ $BUILDTEST_MCU_GROUP ]]
|
|
|
|
then
|
2017-04-20 12:15:59 +02:00
|
|
|
export BASE_BRANCH="${CI_BASE_BRANCH}"
|
2015-05-20 14:10:34 +02:00
|
|
|
|
2015-02-28 18:56:48 +01:00
|
|
|
if [ "$BUILDTEST_MCU_GROUP" == "static-tests" ]
|
|
|
|
then
|
2015-02-28 19:16:48 +01:00
|
|
|
RESULT=0
|
2016-03-01 13:54:04 +01:00
|
|
|
RECALL="$1"
|
2015-02-28 19:16:48 +01:00
|
|
|
|
2016-03-01 13:54:04 +01:00
|
|
|
if [ "$RECALL" != "recall" ]; then
|
2016-07-13 16:04:26 +02:00
|
|
|
if git diff ${CI_BASE_BRANCH} HEAD -- "$0" &> /dev/null; then
|
|
|
|
git rebase ${CI_BASE_BRANCH} || git rebase --abort
|
2016-03-01 13:54:04 +01:00
|
|
|
|
|
|
|
"$0" "recall"
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-03-02 12:10:44 +01:00
|
|
|
trap "RESULT=1" ERR
|
|
|
|
|
2015-11-24 06:02:39 +01:00
|
|
|
git rebase ${CI_BASE_BRANCH}
|
|
|
|
if (( $? != 0 )); then
|
|
|
|
git rebase --abort > /dev/null 2>&1
|
|
|
|
echo "Rebase failed, aborting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-03-02 12:10:44 +01:00
|
|
|
if [ $RESULT -ne 0 ]; then
|
|
|
|
exit $RESULT
|
|
|
|
fi
|
2015-02-28 18:56:48 +01:00
|
|
|
|
2020-02-21 10:31:43 +01:00
|
|
|
exec ./dist/tools/ci/static_tests.sh
|
2015-02-28 18:56:48 +01:00
|
|
|
fi
|
|
|
|
|
2016-04-14 16:49:52 +02:00
|
|
|
if [ "$BUILDTEST_MCU_GROUP" == "host" ]; then
|
|
|
|
make -C dist/tools
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
|
2015-05-26 19:28:44 +02:00
|
|
|
if [ "$BUILDTEST_MCU_GROUP" == "x86" ]
|
|
|
|
then
|
2016-03-23 23:52:00 +01:00
|
|
|
make -C ./tests/unittests all-debug test BOARD=native TERMPROG='gdb -batch -ex r -ex bt $(ELF)' || exit
|
2015-11-24 06:02:39 +01:00
|
|
|
set_result $?
|
2015-02-28 18:56:48 +01:00
|
|
|
fi
|
2015-11-24 06:02:39 +01:00
|
|
|
|
2017-04-20 12:15:59 +02:00
|
|
|
|
2016-03-15 00:08:18 +01:00
|
|
|
./dist/tools/compile_test/compile_test.py $BASE_BRANCH
|
2015-11-24 06:02:39 +01:00
|
|
|
set_result $?
|
2015-02-06 03:36:16 +01:00
|
|
|
fi
|
2015-11-24 06:02:39 +01:00
|
|
|
|
|
|
|
exit $RESULT
|