From 20b2999843b2d446b111ea28b720352dd5a27e7f Mon Sep 17 00:00:00 2001 From: Philipp Rosenkranz Date: Tue, 24 Feb 2015 00:17:28 +0100 Subject: [PATCH 1/3] travis: add static tests as a matrix build target --- .travis.yml | 1 + dist/tools/travis-scripts/build_and_test.sh | 43 +++++++++++---------- dist/tools/travis-scripts/get-pkg-list.py | 11 ++++-- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index a82a62975a..6324157da1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: c cache: apt env: + - NPROC_MAX=8 BUILDTEST_MCU_GROUP=static-tests - NPROC_MAX=8 BUILDTEST_MCU_GROUP=avr8 - NPROC_MAX=8 BUILDTEST_MCU_GROUP=msp430 - NPROC_MAX=8 BUILDTEST_MCU_GROUP=x86 diff --git a/dist/tools/travis-scripts/build_and_test.sh b/dist/tools/travis-scripts/build_and_test.sh index 0f9763dad1..8e6b67c61b 100755 --- a/dist/tools/travis-scripts/build_and_test.sh +++ b/dist/tools/travis-scripts/build_and_test.sh @@ -1,27 +1,31 @@ #!/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" == "static-tests" ] + then + 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 + ./dist/tools/pr_check/pr_check.sh riot/master + exit 0 + fi if [ "$BUILDTEST_MCU_GROUP" == "x86" ] then @@ -32,5 +36,4 @@ then # - 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 index 3f990a96d6..fce3f7bd8d 100755 --- a/dist/tools/travis-scripts/get-pkg-list.py +++ b/dist/tools/travis-scripts/get-pkg-list.py @@ -6,15 +6,18 @@ 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 +static_tests_groups = ["static-tests"] +known_mcu_groups = arm_mcu_groups + msp_mcu_groups + x86_mcu_groups + avr8_mcu_groups + \ + static_tests_groups -common_pkgs = ["pcregrep", "libpcre3", "python3", "cppcheck", "doxygen"] +common_pkgs = ["pcregrep", "libpcre3", "python3"] 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 +static_tests_pkgs = ["doxygen", "cppcheck"] +all_mcu_pkgs = arm_pkgs + msp_pkgs + x86_pkgs + avr8_pkgs + static_tests_pkgs pkgs_to_install = common_pkgs @@ -30,6 +33,8 @@ if "BUILDTEST_MCU_GROUP" in os.environ: pkgs_to_install += x86_pkgs elif mcu_group in avr8_mcu_groups: pkgs_to_install += avr8_pkgs + elif mcu_group in static_tests_groups: + pkgs_to_install += static_tests_pkgs else: pkgs_to_install += all_mcu_pkgs From 0f0f291dde9c413d972c46c258d81a0d7cbda88b Mon Sep 17 00:00:00 2001 From: Philipp Rosenkranz Date: Tue, 24 Feb 2015 00:23:34 +0100 Subject: [PATCH 2/3] travis: added license header for travis scripts --- dist/tools/travis-scripts/build_and_test.sh | 8 ++++++++ dist/tools/travis-scripts/get-pkg-list.py | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/dist/tools/travis-scripts/build_and_test.sh b/dist/tools/travis-scripts/build_and_test.sh index 8e6b67c61b..608015404d 100755 --- a/dist/tools/travis-scripts/build_and_test.sh +++ b/dist/tools/travis-scripts/build_and_test.sh @@ -1,4 +1,12 @@ #!/bin/bash +# +# Copyright (C) 2015 Philipp Rosenkranz +# +# 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. +# + set -e if [[ $BUILDTEST_MCU_GROUP ]] diff --git a/dist/tools/travis-scripts/get-pkg-list.py b/dist/tools/travis-scripts/get-pkg-list.py index fce3f7bd8d..595d57ce44 100755 --- a/dist/tools/travis-scripts/get-pkg-list.py +++ b/dist/tools/travis-scripts/get-pkg-list.py @@ -1,4 +1,22 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2015 Philipp Rosenkranz +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA import os From e9e9a1c01c55f075ef1fd26ba88fd69e22e64c12 Mon Sep 17 00:00:00 2001 From: Philipp Rosenkranz Date: Tue, 24 Feb 2015 00:27:58 +0100 Subject: [PATCH 3/3] travis: fixed pep8 code style issues in python support script --- dist/tools/travis-scripts/get-pkg-list.py | 45 ++++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/dist/tools/travis-scripts/get-pkg-list.py b/dist/tools/travis-scripts/get-pkg-list.py index 595d57ce44..16eb20847d 100755 --- a/dist/tools/travis-scripts/get-pkg-list.py +++ b/dist/tools/travis-scripts/get-pkg-list.py @@ -25,35 +25,36 @@ msp_mcu_groups = ["msp430"] x86_mcu_groups = ["x86"] avr8_mcu_groups = ["avr8"] static_tests_groups = ["static-tests"] -known_mcu_groups = arm_mcu_groups + msp_mcu_groups + x86_mcu_groups + avr8_mcu_groups + \ - static_tests_groups +known_mcu_groups = arm_mcu_groups + msp_mcu_groups + x86_mcu_groups + \ + avr8_mcu_groups + static_tests_groups common_pkgs = ["pcregrep", "libpcre3", "python3"] -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"] +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"] static_tests_pkgs = ["doxygen", "cppcheck"] -all_mcu_pkgs = arm_pkgs + msp_pkgs + x86_pkgs + avr8_pkgs + static_tests_pkgs +all_mcu_pkgs = arm_pkgs + msp_pkgs + \ + x86_pkgs + avr8_pkgs + static_tests_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 - elif mcu_group in static_tests_groups: - pkgs_to_install += static_tests_pkgs + 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 + elif mcu_group in static_tests_groups: + pkgs_to_install += static_tests_pkgs else: - pkgs_to_install += all_mcu_pkgs + pkgs_to_install += all_mcu_pkgs print " ".join(pkgs_to_install)