From d69254b9dfd2256920f99f5cb62e94e232bd6075 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 1 Nov 2019 14:10:01 +0100 Subject: [PATCH] tools/buildsystem_sanity_check: add check for APPLICATION in tests This check verifies the APPLICATION variable is not set by tests application Makefiles. These applications should include the common test Makefile, where this variable is automatically set --- dist/tools/buildsystem_sanity_check/check.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index ba9b88d97b..7e5b4bedff 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -188,6 +188,19 @@ check_board_insufficient_memory_not_in_makefile() { | error_with_message 'Move BOARD_INSUFFICIENT_MEMORY to Makefile.ci' } +# Test applications must not define the APPLICATION variable +checks_tests_application_not_defined_in_makefile() { + local patterns=() + local pathspec=() + + patterns+=(-e '^[[:space:]]*APPLICATION[[:space:]:+]=') + + pathspec+=('tests/**/Makefile') + + git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \ + | error_with_message "Don't define APPLICATION in test Makefile" +} + error_on_input() { ! grep '' } @@ -200,6 +213,7 @@ all_checks() { check_cpu_cpu_model_defined_in_makefile_features check_not_setting_board_equal check_board_insufficient_memory_not_in_makefile + checks_tests_application_not_defined_in_makefile } main() {