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
This commit is contained in:
Alexandre Abadie 2019-11-01 14:10:01 +01:00
parent 3b42755d84
commit d69254b9df
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -188,6 +188,19 @@ check_board_insufficient_memory_not_in_makefile() {
| error_with_message 'Move BOARD_INSUFFICIENT_MEMORY to Makefile.ci' | 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() { error_on_input() {
! grep '' ! grep ''
} }
@ -200,6 +213,7 @@ all_checks() {
check_cpu_cpu_model_defined_in_makefile_features check_cpu_cpu_model_defined_in_makefile_features
check_not_setting_board_equal check_not_setting_board_equal
check_board_insufficient_memory_not_in_makefile check_board_insufficient_memory_not_in_makefile
checks_tests_application_not_defined_in_makefile
} }
main() { main() {