From 02d0c882845bc0d340c0042e6bdf1683fc6cc602 Mon Sep 17 00:00:00 2001 From: Philipp Rosenkranz Date: Fri, 6 Feb 2015 03:36:16 +0100 Subject: [PATCH] tests/travis: split buildtests into MCU groups. --- .travis.yml | 53 ++++----------------- Makefile.buildtests | 5 +- boards/airfy-beacon/Makefile.features | 1 + boards/arduino-due/Makefile.features | 1 + boards/arduino-mega2560/Makefile.features | 1 + boards/avsextrem/Makefile.features | 1 + boards/cc2538dk/Makefile.features | 1 + boards/chronos/Makefile.features | 1 + boards/f4vi1/Makefile.features | 1 + boards/fox/Makefile.features | 1 + boards/iot-lab_M3/Makefile.features | 1 + boards/mbed_lpc1768/Makefile.features | 1 + boards/msb-430/Makefile.features | 1 + boards/msb-430h/Makefile.features | 1 + boards/msba2/Makefile.features | 1 + boards/msbiot/Makefile.features | 1 + boards/native/Makefile.features | 1 + boards/nucleo-f334/Makefile.features | 1 + boards/nucleo-l1/Makefile.features | 1 + boards/openmote/Makefile.features | 1 + boards/pca10000/Makefile.features | 1 + boards/pca10005/Makefile.features | 1 + boards/pttu/Makefile.features | 1 + boards/qemu-i386/Makefile.features | 1 + boards/redbee-econotag/Makefile.features | 1 + boards/samr21-xpro/Makefile.features | 1 + boards/spark-core/Makefile.features | 1 + boards/stm32f0discovery/Makefile.features | 1 + boards/stm32f3discovery/Makefile.features | 1 + boards/stm32f4discovery/Makefile.features | 1 + boards/telosb/Makefile.features | 1 + boards/udoo/Makefile.features | 1 + boards/wsn430-v1_3b/Makefile.features | 1 + boards/wsn430-v1_4/Makefile.features | 1 + boards/yunjia-nrf51822/Makefile.features | 1 + boards/z1/Makefile.features | 1 + dist/tools/travis-scripts/build_and_test.sh | 36 ++++++++++++++ dist/tools/travis-scripts/get-pkg-list.py | 36 ++++++++++++++ 38 files changed, 120 insertions(+), 44 deletions(-) create mode 100644 boards/msb-430/Makefile.features create mode 100644 boards/qemu-i386/Makefile.features create mode 100755 dist/tools/travis-scripts/build_and_test.sh create mode 100755 dist/tools/travis-scripts/get-pkg-list.py diff --git a/.travis.yml b/.travis.yml index 4fa9f0b95a..a82a62975a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,14 @@ language: c cache: apt env: - - NPROC_MAX=8 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=avr8 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=msp430 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=x86 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=arm7 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=cortex_m0 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=cortex_m3_1 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=cortex_m3_2 + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=cortex_m4 before_install: - sudo apt-get install emdebian-archive-keyring @@ -18,21 +25,7 @@ before_install: install: - > - sudo apt-get install \ - build-essential \ - gcc-multilib \ - gcc-arm-none-eabi \ - gcc-msp430 \ - pcregrep \ - libpcre3 \ - qemu-system-x86 \ - python3 \ - g++-multilib \ - gcc-avr \ - binutils-avr \ - avr-libc \ - cppcheck \ - doxygen + sudo apt-get install $(./dist/tools/travis-scripts/get-pkg-list.py) - git config --global user.email "travis@example.com" - git config --global user.name "Travis CI" @@ -41,33 +34,7 @@ install: - git log -1 --pretty=format:%H riot/master script: - - make -s -C ./examples/default info-concurrency - - git rebase riot/master || git rebase --abort - - - ./dist/tools/whitespacecheck/check.sh master || exit - - - ./dist/tools/licenses/check.sh master --diff-filter=MR --error-exitcode=0 || exit - - ./dist/tools/licenses/check.sh master --diff-filter=AC || exit - - - ./dist/tools/doccheck/check.sh master || exit - - - ./dist/tools/externc/check.sh master || exit - -# TODO: -# Remove all but `master` parameters to cppcheck (and remove second -# invocation) once all warnings of cppcheck have been taken care of -# in master. - - ./dist/tools/cppcheck/check.sh master --diff-filter=MR --error-exitcode=0 || exit - - ./dist/tools/cppcheck/check.sh master --diff-filter=AC || exit - - - make -C ./tests/unittests all test BOARD=native || exit -# TODO: -# Reenable once https://github.com/RIOT-OS/RIOT/issues/2300 is -# resolved: -# - make -C ./tests/unittests all test BOARD=qemu-i386 || exit - - - ./dist/tools/compile_test/compile_test.py - - ./dist/tools/pr_check/pr_check.sh riot/master + - ./dist/tools/travis-scripts/build_and_test.sh notifications: email: false diff --git a/Makefile.buildtests b/Makefile.buildtests index 4781c2c691..1d669a271a 100644 --- a/Makefile.buildtests +++ b/Makefile.buildtests @@ -216,11 +216,14 @@ ifneq (, $(filter info-boards-supported info-boards-features-missing info-build, define board_missing_features FEATURES_PROVIDED := $(FEATURES_PROVIDED_BAK) -include $${RIOTBOARD}/${1}/Makefile.features + ifneq ($(BUILDTEST_MCU_GROUP), $$(FEATURES_MCU_GROUP)) + BOARDS_FEATURES_MISSING += "${1} $${BUILDTEST_MCU_GROUP}" + BOARDS_WITH_MISSING_FEATURES += ${1} + endif FEATURES_MISSING := $$(filter-out $$(FEATURES_PROVIDED), $$(FEATURES_REQUIRED)) ifneq (, $${FEATURES_MISSING}) BOARDS_FEATURES_MISSING += "${1} $${FEATURES_MISSING}" - ifneq (, $$(filter-out $$(FEATURES_OPTIONAL), $$(FEATURES_MISSING))) BOARDS_WITH_MISSING_FEATURES += ${1} endif diff --git a/boards/airfy-beacon/Makefile.features b/boards/airfy-beacon/Makefile.features index 498e6d7eeb..f7dc503f5c 100644 --- a/boards/airfy-beacon/Makefile.features +++ b/boards/airfy-beacon/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid +FEATURES_MCU_GROUP = cortex_m0 diff --git a/boards/arduino-due/Makefile.features b/boards/arduino-due/Makefile.features index 1cae147202..0f13ae3cac 100644 --- a/boards/arduino-due/Makefile.features +++ b/boards/arduino-due/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_random +FEATURES_MCU_GROUP = cortex_m3_1 diff --git a/boards/arduino-mega2560/Makefile.features b/boards/arduino-mega2560/Makefile.features index 285b07a6c6..675243084d 100644 --- a/boards/arduino-mega2560/Makefile.features +++ b/boards/arduino-mega2560/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += periph_uart +FEATURES_MCU_GROUP = avr8 diff --git a/boards/avsextrem/Makefile.features b/boards/avsextrem/Makefile.features index a62395a350..b0d2b6d3aa 100644 --- a/boards/avsextrem/Makefile.features +++ b/boards/avsextrem/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver periph_rtc +FEATURES_MCU_GROUP = arm7 diff --git a/boards/cc2538dk/Makefile.features b/boards/cc2538dk/Makefile.features index 8c7ec59b68..62702bae3f 100644 --- a/boards/cc2538dk/Makefile.features +++ b/boards/cc2538dk/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_cpuid +FEATURES_MCU_GROUP = cortex_m3_1 diff --git a/boards/chronos/Makefile.features b/boards/chronos/Makefile.features index a62395a350..ca6ca1295a 100644 --- a/boards/chronos/Makefile.features +++ b/boards/chronos/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver periph_rtc +FEATURES_MCU_GROUP = msp430 diff --git a/boards/f4vi1/Makefile.features b/boards/f4vi1/Makefile.features index 4e85a0c0fa..ad65d4af31 100644 --- a/boards/f4vi1/Makefile.features +++ b/boards/f4vi1/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart +FEATURES_MCU_GROUP = cortex_m4 diff --git a/boards/fox/Makefile.features b/boards/fox/Makefile.features index 1fd4646dd7..dde11483cf 100644 --- a/boards/fox/Makefile.features +++ b/boards/fox/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt periph_cpuid cpp +FEATURES_MCU_GROUP = cortex_m3_1 diff --git a/boards/iot-lab_M3/Makefile.features b/boards/iot-lab_M3/Makefile.features index 1fd4646dd7..dde11483cf 100644 --- a/boards/iot-lab_M3/Makefile.features +++ b/boards/iot-lab_M3/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt periph_cpuid cpp +FEATURES_MCU_GROUP = cortex_m3_1 diff --git a/boards/mbed_lpc1768/Makefile.features b/boards/mbed_lpc1768/Makefile.features index 4e85a0c0fa..a94364238f 100644 --- a/boards/mbed_lpc1768/Makefile.features +++ b/boards/mbed_lpc1768/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart +FEATURES_MCU_GROUP = cortex_m3_1 diff --git a/boards/msb-430/Makefile.features b/boards/msb-430/Makefile.features new file mode 100644 index 0000000000..3b961e07b1 --- /dev/null +++ b/boards/msb-430/Makefile.features @@ -0,0 +1 @@ +FEATURES_MCU_GROUP = msp430 diff --git a/boards/msb-430h/Makefile.features b/boards/msb-430h/Makefile.features index 3f4b26f742..404ff76b5c 100644 --- a/boards/msb-430h/Makefile.features +++ b/boards/msb-430h/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver config +FEATURES_MCU_GROUP = msp430 diff --git a/boards/msba2/Makefile.features b/boards/msba2/Makefile.features index f853e7d3de..3c838174e4 100644 --- a/boards/msba2/Makefile.features +++ b/boards/msba2/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver periph_pwm periph_rtc cpp config +FEATURES_MCU_GROUP = arm7 diff --git a/boards/msbiot/Makefile.features b/boards/msbiot/Makefile.features index 9c23182ee1..1826fdc268 100644 --- a/boards/msbiot/Makefile.features +++ b/boards/msbiot/Makefile.features @@ -1,3 +1,4 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_i2c periph_pwm FEATURES_PROVIDED += transceiver +FEATURES_MCU_GROUP = cortex_m4 diff --git a/boards/native/Makefile.features b/boards/native/Makefile.features index 4ad14738b8..ef4f15ffd5 100644 --- a/boards/native/Makefile.features +++ b/boards/native/Makefile.features @@ -1,3 +1,4 @@ FEATURES_PROVIDED += transceiver periph_cpuid config cpp FEATURES_PROVIDED += periph_random FEATURES_PROVIDED += periph_rtc +FEATURES_MCU_GROUP = x86 diff --git a/boards/nucleo-f334/Makefile.features b/boards/nucleo-f334/Makefile.features index 0e8316f925..2aa1179ca3 100644 --- a/boards/nucleo-f334/Makefile.features +++ b/boards/nucleo-f334/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += cpp +FEATURES_MCU_GROUP = cortex_m4 diff --git a/boards/nucleo-l1/Makefile.features b/boards/nucleo-l1/Makefile.features index 67643f6de2..9ede200356 100644 --- a/boards/nucleo-l1/Makefile.features +++ b/boards/nucleo-l1/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += periph_gpio periph_uart periph_spi periph_i2c periph_cpuid FEATURES_PROVIDED += cpp +FEATURES_MCU_GROUP = cortex_m3_2 diff --git a/boards/openmote/Makefile.features b/boards/openmote/Makefile.features index 8c7ec59b68..6d56134904 100644 --- a/boards/openmote/Makefile.features +++ b/boards/openmote/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_cpuid +FEATURES_MCU_GROUP = cortex_m3_2 diff --git a/boards/pca10000/Makefile.features b/boards/pca10000/Makefile.features index 498e6d7eeb..f7dc503f5c 100644 --- a/boards/pca10000/Makefile.features +++ b/boards/pca10000/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid +FEATURES_MCU_GROUP = cortex_m0 diff --git a/boards/pca10005/Makefile.features b/boards/pca10005/Makefile.features index 498e6d7eeb..f7dc503f5c 100644 --- a/boards/pca10005/Makefile.features +++ b/boards/pca10005/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid +FEATURES_MCU_GROUP = cortex_m0 diff --git a/boards/pttu/Makefile.features b/boards/pttu/Makefile.features index 54bc2978ab..26efb4612c 100644 --- a/boards/pttu/Makefile.features +++ b/boards/pttu/Makefile.features @@ -1,3 +1,4 @@ # Enable this after fixing https://github.com/RIOT-OS/RIOT/issues/659 #FEATURES_PROVIDED += transceiver FEATURES_PROVIDED += periph_rtc +FEATURES_MCU_GROUP = arm7 diff --git a/boards/qemu-i386/Makefile.features b/boards/qemu-i386/Makefile.features new file mode 100644 index 0000000000..24a62d088e --- /dev/null +++ b/boards/qemu-i386/Makefile.features @@ -0,0 +1 @@ +FEATURES_MCU_GROUP = x86 diff --git a/boards/redbee-econotag/Makefile.features b/boards/redbee-econotag/Makefile.features index af23a974c8..5bc079ac1e 100644 --- a/boards/redbee-econotag/Makefile.features +++ b/boards/redbee-econotag/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver +FEATURES_MCU_GROUP = arm7 diff --git a/boards/samr21-xpro/Makefile.features b/boards/samr21-xpro/Makefile.features index fc8df2c708..3266fbb712 100644 --- a/boards/samr21-xpro/Makefile.features +++ b/boards/samr21-xpro/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver periph_gpio periph_spi cpp periph_timer periph_uart periph_i2c cpp periph_rtc periph_cpuid +FEATURES_MCU_GROUP = cortex_m0 diff --git a/boards/spark-core/Makefile.features b/boards/spark-core/Makefile.features index 4e85a0c0fa..6bc98fbf6f 100644 --- a/boards/spark-core/Makefile.features +++ b/boards/spark-core/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart +FEATURES_MCU_GROUP = cortex_m3_2 diff --git a/boards/stm32f0discovery/Makefile.features b/boards/stm32f0discovery/Makefile.features index 19f1b8ce42..172ca8e8be 100644 --- a/boards/stm32f0discovery/Makefile.features +++ b/boards/stm32f0discovery/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += periph_adc periph_gpio periph_spi periph_uart cpp +FEATURES_MCU_GROUP = cortex_m0 diff --git a/boards/stm32f3discovery/Makefile.features b/boards/stm32f3discovery/Makefile.features index 4dfa4fad14..d81085ab26 100644 --- a/boards/stm32f3discovery/Makefile.features +++ b/boards/stm32f3discovery/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_pwm periph_spi +FEATURES_MCU_GROUP = cortex_m3_2 diff --git a/boards/stm32f4discovery/Makefile.features b/boards/stm32f4discovery/Makefile.features index c2fa3d8542..488ed7842b 100644 --- a/boards/stm32f4discovery/Makefile.features +++ b/boards/stm32f4discovery/Makefile.features @@ -1,3 +1,4 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_i2c periph_pwm periph_random \ periph_adc periph_dac +FEATURES_MCU_GROUP = cortex_m4 diff --git a/boards/telosb/Makefile.features b/boards/telosb/Makefile.features index af23a974c8..b73c21bb32 100644 --- a/boards/telosb/Makefile.features +++ b/boards/telosb/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver +FEATURES_MCU_GROUP = msp430 diff --git a/boards/udoo/Makefile.features b/boards/udoo/Makefile.features index 1cae147202..fb64f1ac0b 100644 --- a/boards/udoo/Makefile.features +++ b/boards/udoo/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_random +FEATURES_MCU_GROUP = cortex_m3_2 diff --git a/boards/wsn430-v1_3b/Makefile.features b/boards/wsn430-v1_3b/Makefile.features index 3f4b26f742..404ff76b5c 100644 --- a/boards/wsn430-v1_3b/Makefile.features +++ b/boards/wsn430-v1_3b/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver config +FEATURES_MCU_GROUP = msp430 diff --git a/boards/wsn430-v1_4/Makefile.features b/boards/wsn430-v1_4/Makefile.features index 3f4b26f742..404ff76b5c 100644 --- a/boards/wsn430-v1_4/Makefile.features +++ b/boards/wsn430-v1_4/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver config +FEATURES_MCU_GROUP = msp430 diff --git a/boards/yunjia-nrf51822/Makefile.features b/boards/yunjia-nrf51822/Makefile.features index 498e6d7eeb..f7dc503f5c 100644 --- a/boards/yunjia-nrf51822/Makefile.features +++ b/boards/yunjia-nrf51822/Makefile.features @@ -1,2 +1,3 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid +FEATURES_MCU_GROUP = cortex_m0 diff --git a/boards/z1/Makefile.features b/boards/z1/Makefile.features index af23a974c8..b73c21bb32 100644 --- a/boards/z1/Makefile.features +++ b/boards/z1/Makefile.features @@ -1 +1,2 @@ FEATURES_PROVIDED += transceiver +FEATURES_MCU_GROUP = msp430 diff --git a/dist/tools/travis-scripts/build_and_test.sh b/dist/tools/travis-scripts/build_and_test.sh new file mode 100755 index 0000000000..0f9763dad1 --- /dev/null +++ b/dist/tools/travis-scripts/build_and_test.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +make -s -C ./examples/default info-concurrency +git rebase riot/master || git rebase --abort + +./dist/tools/whitespacecheck/check.sh master || exit + +./dist/tools/licenses/check.sh master --diff-filter=MR --error-exitcode=0 || exit +./dist/tools/licenses/check.sh master --diff-filter=AC || exit + +./dist/tools/doccheck/check.sh master || exit + +./dist/tools/externc/check.sh master || exit + +# TODO: +# Remove all but `master` parameters to cppcheck (and remove second +# invocation) once all warnings of cppcheck have been taken care of +# in master. +./dist/tools/cppcheck/check.sh master --diff-filter=MR --error-exitcode=0 || exit +./dist/tools/cppcheck/check.sh master --diff-filter=AC || exit + +if [[ $BUILDTEST_MCU_GROUP ]] +then + if [ "$BUILDTEST_MCU_GROUP" == "x86" ] + then + + make -C ./tests/unittests all test BOARD=native || exit + # TODO: + # Reenable once https://github.com/RIOT-OS/RIOT/issues/2300 is + # resolved: + # - make -C ./tests/unittests all test BOARD=qemu-i386 || exit + fi + ./dist/tools/compile_test/compile_test.py + ./dist/tools/pr_check/pr_check.sh riot/master +fi diff --git a/dist/tools/travis-scripts/get-pkg-list.py b/dist/tools/travis-scripts/get-pkg-list.py new file mode 100755 index 0000000000..3f990a96d6 --- /dev/null +++ b/dist/tools/travis-scripts/get-pkg-list.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import os + +arm_mcu_groups = ["arm7", "cortex_m0", "cortex_m3", "cortex_m3_2", "cortex_m4"] +msp_mcu_groups = ["msp430"] +x86_mcu_groups = ["x86"] +avr8_mcu_groups = ["avr8"] +known_mcu_groups = arm_mcu_groups + msp_mcu_groups + x86_mcu_groups + avr8_mcu_groups + +common_pkgs = ["pcregrep", "libpcre3", "python3", "cppcheck", "doxygen"] +arm_pkgs = ["gcc-arm-none-eabi"] +msp_pkgs = ["gcc-msp430"] +x86_pkgs = ["qemu-system-x86", "g++-multilib", "gcc-multilib", \ + "build-essential"] +avr8_pkgs = ["gcc-avr", "binutils-avr", "avr-libc"] +all_mcu_pkgs = arm_pkgs + msp_pkgs + x86_pkgs + avr8_pkgs + + +pkgs_to_install = common_pkgs +if "BUILDTEST_MCU_GROUP" in os.environ: + mcu_group = os.environ["BUILDTEST_MCU_GROUP"] + if mcu_group not in known_mcu_groups: + pkgs_to_install += all_mcu_pkgs + elif mcu_group in arm_mcu_groups: + pkgs_to_install += arm_pkgs + elif mcu_group in msp_mcu_groups: + pkgs_to_install += msp_pkgs + elif mcu_group in x86_mcu_groups: + pkgs_to_install += x86_pkgs + elif mcu_group in avr8_mcu_groups: + pkgs_to_install += avr8_pkgs +else: + pkgs_to_install += all_mcu_pkgs + +print " ".join(pkgs_to_install)