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() {