From 1ff2a8c2a731b6c80137d8e3971577a823be7a8b Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 10 Nov 2020 14:07:01 +0100 Subject: [PATCH 1/2] .murdock: run Kconfig compilation first when needed This allows to run the tests with the normal binary and avoids having to test the TEST_KCONFIG flag during the test stage. --- .murdock | 59 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/.murdock b/.murdock index bf31b8f2ff..b857a9f6bc 100755 --- a/.murdock +++ b/.murdock @@ -240,37 +240,46 @@ compile() { [ $# -ne 2 ] && error "$0: compile: invalid parameters (expected \$appdir \$board:\$toolchain)" [ ! -d "$appdir" ] && error "$0: compile: error: application directory \"$appdir\" doesn't exist" - # compile + # We compile a first time with Kconfig based dependency + # resolution for regression purposes. $TEST_KCONFIG contains a + # list of board-application tuples that are currently modeled to + # run with Kconfig + + # we can't use '-' in variable names + _board=$(echo ${board} | tr '-' '_') + + should_check_kconfig_hash=0 + + for app in $(get_kconfig_test_apps "${_board}") + do + if [ "${appdir}" = "${app}" ]; then + should_check_kconfig_hash=1 + BOARD=${board} make -C${appdir} clean + CCACHE_BASEDIR="$(pwd)" BOARD=${board} TOOLCHAIN=${toolchain} RIOT_CI_BUILD=1 TEST_KCONFIG=1 \ + make -C${appdir} all test-input-hash -j${JOBS:-4} + RES=$? + if [ $RES -eq 0 ]; then + kconfig_test_hash=$(test_hash_calc "${BINDIR}") + else + kconfig_test_hash=0 + echo "An error occurred while compiling using Kconfig"; + fi + fi + done + + # compile without Kconfig CCACHE_BASEDIR="$(pwd)" BOARD=$board TOOLCHAIN=$toolchain RIOT_CI_BUILD=1 \ make -C${appdir} clean all test-input-hash -j${JOBS:-4} RES=$? test_hash=$(test_hash_calc "$BINDIR") - # We compile a second time with Kconfig based dependency - # resolution for regression purposes. $TEST_KCONFIG contains a - # list of board-application tuples that are currently modeled to - # run with Kconfig - if [ $RES -eq 0 ]; then - # we can't use '-' in variable names - _board=$(echo ${board} | tr '-' '_') - - for app in $(get_kconfig_test_apps "${_board}") - do - if [ "${appdir}" = "${app}" ]; then - BOARD=$board make -C${appdir} clean - CCACHE_BASEDIR="$(pwd)" BOARD=$board TOOLCHAIN=$toolchain RIOT_CI_BUILD=1 TEST_KCONFIG=1 \ - make -C${appdir} all test-input-hash -j${JOBS:-4} - RES=$? - if [ $RES -eq 0 ]; then - new_test_hash=$(test_hash_calc "$BINDIR") - if [ ${new_test_hash} != ${test_hash} ]; then - echo "Hashes of binaries mismatch for ${app}"; - RES=1 - fi - fi - fi - done + if [ ${should_check_kconfig_hash} != 0 ]; then + if [ ${kconfig_test_hash} != ${test_hash} ]; then + echo "Hashes of binaries with and without Kconfig mismatch for ${app}"; + echo "Please check that all used modules are modelled in Kconfig and enabled"; + RES=1 + fi fi # run tests From 3d3d22c2fb57c2351239658a0f17ce42eab02737 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Mon, 16 Nov 2020 10:02:29 +0100 Subject: [PATCH 2/2] .murdock: remove unneeded board name conversion --- .murdock | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.murdock b/.murdock index b857a9f6bc..79d004cb2d 100755 --- a/.murdock +++ b/.murdock @@ -2,7 +2,6 @@ : ${TEST_BOARDS_AVAILABLE:="esp32-wroom-32 samr21-xpro"} : ${TEST_BOARDS_LLVM_COMPILE:="iotlab-m3 native nrf52dk mulle nucleo-f401re samr21-xpro slstk3402a"} -# we can't use '-' in the variable names, convert them to '_' to add new boards : ${TEST_KCONFIG_samr21_xpro:="examples/hello-world tests/periph_*"} export RIOT_CI_BUILD=1 @@ -37,7 +36,7 @@ DWQ_ENV="-E BOARDS -E APPS -E NIGHTLY -E RUN_TESTS -E ENABLE_TEST_CACHE get_kconfig_test_apps() { case "$1" in - "samr21_xpro") echo "${TEST_KCONFIG_samr21_xpro}" ;; + "samr21-xpro") echo "${TEST_KCONFIG_samr21_xpro}" ;; esac } @@ -245,12 +244,9 @@ compile() { # list of board-application tuples that are currently modeled to # run with Kconfig - # we can't use '-' in variable names - _board=$(echo ${board} | tr '-' '_') - should_check_kconfig_hash=0 - for app in $(get_kconfig_test_apps "${_board}") + for app in $(get_kconfig_test_apps "${board}") do if [ "${appdir}" = "${app}" ]; then should_check_kconfig_hash=1