diff --git a/makefiles/kconfig.mk b/makefiles/kconfig.mk index c7bc3ea043..2027c71b51 100644 --- a/makefiles/kconfig.mk +++ b/makefiles/kconfig.mk @@ -54,7 +54,15 @@ KCONFIG_OUT_DEP = $(KCONFIG_OUT_CONFIG).d # KCONFIG_ADD_CONFIG holds a list of .config files that are merged for the # initial configuration. This allows to split configurations in common files # and share them among boards or cpus. +# This file will contain application default configurations used for Kconfig Test MERGE_SOURCES += $(KCONFIG_ADD_CONFIG) + +# Add configurations that only work when running the Kconfig test so far, +# because they activate modules. +ifeq (1,$(TEST_KCONFIG)) + MERGE_SOURCES += $(wildcard $(APPDIR)/app.config.test) +endif + MERGE_SOURCES += $(wildcard $(KCONFIG_APP_CONFIG)) MERGE_SOURCES += $(wildcard $(KCONFIG_USER_CONFIG)) @@ -80,6 +88,11 @@ SHOULD_RUN_KCONFIG ?= $(or $(wildcard $(APPDIR)/*.config), \ $(if $(CLEAN),,$(wildcard $(KCONFIG_OUT_CONFIG))), \ $(filter menuconfig, $(MAKECMDGOALS))) +# When testing Kconfig we should always run it +ifeq (1,$(TEST_KCONFIG)) + SHOULD_RUN_KCONFIG := 1 +endif + # export variable to make it visible in other Makefiles export SHOULD_RUN_KCONFIG diff --git a/tests/periph_adc/app.config.test b/tests/periph_adc/app.config.test new file mode 100644 index 0000000000..d73989b77d --- /dev/null +++ b/tests/periph_adc/app.config.test @@ -0,0 +1,7 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +# enable ADC peripheral driver +CONFIG_MODULE_PERIPH_ADC=y + +# enable xtimer to wake up periodically +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_backup_ram/Kconfig b/tests/periph_backup_ram/Kconfig new file mode 100644 index 0000000000..3446b5546a --- /dev/null +++ b/tests/periph_backup_ram/Kconfig @@ -0,0 +1,12 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + depends on HAS_BACKUP_RAM + depends on TEST_KCONFIG diff --git a/tests/periph_backup_ram/Makefile b/tests/periph_backup_ram/Makefile index 81c22443be..b307906bd0 100644 --- a/tests/periph_backup_ram/Makefile +++ b/tests/periph_backup_ram/Makefile @@ -10,4 +10,7 @@ DISABLE_MODULE += test_utils_interactive_sync CFLAGS += -DLOG_LEVEL=LOG_WARNING +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_backup_ram/app.config.test b/tests/periph_backup_ram/app.config.test new file mode 100644 index 0000000000..908a05dae5 --- /dev/null +++ b/tests/periph_backup_ram/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PM_LAYERED=y +CONFIG_MODULE_PERIPH_RTC=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_cpuid/app.config.test b/tests/periph_cpuid/app.config.test new file mode 100644 index 0000000000..62787b3685 --- /dev/null +++ b/tests/periph_cpuid/app.config.test @@ -0,0 +1,4 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_CPUID=y +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y diff --git a/tests/periph_dac/app.config.test b/tests/periph_dac/app.config.test new file mode 100644 index 0000000000..7b1b45ec0a --- /dev/null +++ b/tests/periph_dac/app.config.test @@ -0,0 +1,4 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_DAC=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_dma/app.config.test b/tests/periph_dma/app.config.test new file mode 100644 index 0000000000..7c61855c25 --- /dev/null +++ b/tests/periph_dma/app.config.test @@ -0,0 +1,4 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_DMA=y +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y diff --git a/tests/periph_eeprom/app.config.test b/tests/periph_eeprom/app.config.test new file mode 100644 index 0000000000..6fbf945536 --- /dev/null +++ b/tests/periph_eeprom/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_EEPROM=y +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_SHELL_COMMANDS=y # provides reboot command diff --git a/tests/periph_flashpage/Kconfig b/tests/periph_flashpage/Kconfig new file mode 100644 index 0000000000..686f130b1b --- /dev/null +++ b/tests/periph_flashpage/Kconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_FLASHPAGE_RAW + imply MODULE_PERIPH_FLASHPAGE_RWEE + depends on TEST_KCONFIG diff --git a/tests/periph_flashpage/Makefile b/tests/periph_flashpage/Makefile index 7c21e1b154..cb1a1bfa78 100644 --- a/tests/periph_flashpage/Makefile +++ b/tests/periph_flashpage/Makefile @@ -7,4 +7,7 @@ FEATURES_OPTIONAL += periph_flashpage_rwee USEMODULE += shell +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_flashpage/app.config.test b/tests/periph_flashpage/app.config.test new file mode 100644 index 0000000000..7629aaf119 --- /dev/null +++ b/tests/periph_flashpage/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_FLASHPAGE=y +CONFIG_MODULE_SHELL=y diff --git a/tests/periph_gpio/Kconfig b/tests/periph_gpio/Kconfig new file mode 100644 index 0000000000..7bb0ceb3d3 --- /dev/null +++ b/tests/periph_gpio/Kconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_GPIO_IRQ + imply MODULE_PERIPH_GPIO_FAST_READ + depends on TEST_KCONFIG diff --git a/tests/periph_gpio/Makefile b/tests/periph_gpio/Makefile index 2b640f9097..10b85c91c4 100644 --- a/tests/periph_gpio/Makefile +++ b/tests/periph_gpio/Makefile @@ -28,6 +28,9 @@ else PORT_UNDER_TEST ?= 0 endif +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include $(call target-export-variables,test,PORT_UNDER_TEST) diff --git a/tests/periph_gpio/app.config.test b/tests/periph_gpio/app.config.test new file mode 100644 index 0000000000..dd9e273093 --- /dev/null +++ b/tests/periph_gpio/app.config.test @@ -0,0 +1,9 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_GPIO=y + +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_SHELL_COMMANDS=y +CONFIG_MODULE_BENCHMARK=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_gpio_arduino/app.config.test b/tests/periph_gpio_arduino/app.config.test new file mode 100644 index 0000000000..8aa13b683f --- /dev/null +++ b/tests/periph_gpio_arduino/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_GPIO=y +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_ARDUINO=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_hwrng/app.config.test b/tests/periph_hwrng/app.config.test new file mode 100644 index 0000000000..518111e68d --- /dev/null +++ b/tests/periph_hwrng/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_HWRNG=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_i2c/Kconfig b/tests/periph_i2c/Kconfig new file mode 100644 index 0000000000..69fcb29cf3 --- /dev/null +++ b/tests/periph_i2c/Kconfig @@ -0,0 +1,12 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_I2C_RECONFIGURE + depends on TEST_KCONFIG diff --git a/tests/periph_i2c/Makefile b/tests/periph_i2c/Makefile index 77e10cbeac..868bad2427 100644 --- a/tests/periph_i2c/Makefile +++ b/tests/periph_i2c/Makefile @@ -7,4 +7,7 @@ FEATURES_OPTIONAL = periph_i2c_reconfigure USEMODULE += shell USEMODULE += xtimer +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_i2c/app.config.test b/tests/periph_i2c/app.config.test new file mode 100644 index 0000000000..e3da3e8e15 --- /dev/null +++ b/tests/periph_i2c/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_I2C=y +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_pm/Kconfig b/tests/periph_pm/Kconfig new file mode 100644 index 0000000000..021a1e6040 --- /dev/null +++ b/tests/periph_pm/Kconfig @@ -0,0 +1,14 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_RTC + imply MODULE_PERIPH_GPIO + imply MODULE_PERIPH_GPIO_IRQ + depends on TEST_KCONFIG diff --git a/tests/periph_pm/Makefile b/tests/periph_pm/Makefile index 31c97a6099..22823dafd7 100644 --- a/tests/periph_pm/Makefile +++ b/tests/periph_pm/Makefile @@ -7,4 +7,7 @@ FEATURES_OPTIONAL += periph_gpio_irq USEMODULE += shell USEMODULE += shell_commands +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_pm/app.config.test b/tests/periph_pm/app.config.test new file mode 100644 index 0000000000..31ed3d3685 --- /dev/null +++ b/tests/periph_pm/app.config.test @@ -0,0 +1,4 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_SHELL_COMMANDS=y diff --git a/tests/periph_pwm/app.config.test b/tests/periph_pwm/app.config.test new file mode 100644 index 0000000000..ba20222067 --- /dev/null +++ b/tests/periph_pwm/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_PWM=y +CONFIG_MODULE_XTIMER=y +CONFIG_MODULE_SHELL=y diff --git a/tests/periph_qdec/app.config.test b/tests/periph_qdec/app.config.test new file mode 100644 index 0000000000..aedaab298b --- /dev/null +++ b/tests/periph_qdec/app.config.test @@ -0,0 +1,4 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_QDEC=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_rtc/app.config.test b/tests/periph_rtc/app.config.test new file mode 100644 index 0000000000..e6772e5271 --- /dev/null +++ b/tests/periph_rtc/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_RTC=y +CONFIG_MODULE_PERIPH_INIT_RTC=n +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_rtt/app.config.test b/tests/periph_rtt/app.config.test new file mode 100644 index 0000000000..230b2d3d26 --- /dev/null +++ b/tests/periph_rtt/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_RTT=y +CONFIG_MODULE_PERIPH_INIT_RTT=n diff --git a/tests/periph_rtt_min/app.config.test b/tests/periph_rtt_min/app.config.test new file mode 100644 index 0000000000..aa27a8c2b7 --- /dev/null +++ b/tests/periph_rtt_min/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_RTT=y +CONFIG_MODULE_PERIPH_INIT_RTT=n +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_spi/Kconfig b/tests/periph_spi/Kconfig new file mode 100644 index 0000000000..8e259953d9 --- /dev/null +++ b/tests/periph_spi/Kconfig @@ -0,0 +1,12 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_SPI_RECONFIGURE + depends on TEST_KCONFIG diff --git a/tests/periph_spi/Makefile b/tests/periph_spi/Makefile index 45352ab075..87acbb3d09 100644 --- a/tests/periph_spi/Makefile +++ b/tests/periph_spi/Makefile @@ -9,4 +9,7 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += schedstatistics +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_spi/app.config.test b/tests/periph_spi/app.config.test new file mode 100644 index 0000000000..81f400d92b --- /dev/null +++ b/tests/periph_spi/app.config.test @@ -0,0 +1,8 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_SPI=y + +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_SHELL_COMMANDS=y +CONFIG_MODULE_SCHEDSTATISTICS=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_spi_dma/Kconfig b/tests/periph_spi_dma/Kconfig new file mode 100644 index 0000000000..8e259953d9 --- /dev/null +++ b/tests/periph_spi_dma/Kconfig @@ -0,0 +1,12 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_SPI_RECONFIGURE + depends on TEST_KCONFIG diff --git a/tests/periph_spi_dma/app.config.test b/tests/periph_spi_dma/app.config.test new file mode 100644 index 0000000000..29981de4c5 --- /dev/null +++ b/tests/periph_spi_dma/app.config.test @@ -0,0 +1,9 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_DMA=y +CONFIG_MODULE_PERIPH_SPI=y + +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_SHELL_COMMANDS=y +CONFIG_MODULE_SCHEDSTATISTICS=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_timer/app.config.test b/tests/periph_timer/app.config.test new file mode 100644 index 0000000000..2ffd8272eb --- /dev/null +++ b/tests/periph_timer/app.config.test @@ -0,0 +1,4 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_TIMER=y diff --git a/tests/periph_timer_periodic/app.config.test b/tests/periph_timer_periodic/app.config.test new file mode 100644 index 0000000000..357519491a --- /dev/null +++ b/tests/periph_timer_periodic/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_TIMER=y +CONFIG_MODULE_PERIPH_TIMER_PERIODIC=y +CONFIG_MODULE_FMT=y diff --git a/tests/periph_timer_short_relative_set/app.config.test b/tests/periph_timer_short_relative_set/app.config.test new file mode 100644 index 0000000000..5915503772 --- /dev/null +++ b/tests/periph_timer_short_relative_set/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_TIMER=y +CONFIG_MODULE_CORE_THREAD_FLAGS=y diff --git a/tests/periph_uart/Kconfig b/tests/periph_uart/Kconfig new file mode 100644 index 0000000000..e43f5f8de8 --- /dev/null +++ b/tests/periph_uart/Kconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_UART_MODECFG + imply MODULE_PERIPH_LPUART + depends on TEST_KCONFIG diff --git a/tests/periph_uart/Makefile b/tests/periph_uart/Makefile index 81e6f93dfd..c7fa83da21 100644 --- a/tests/periph_uart/Makefile +++ b/tests/periph_uart/Makefile @@ -7,4 +7,7 @@ FEATURES_OPTIONAL += periph_uart_modecfg USEMODULE += shell USEMODULE += xtimer +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_uart/app.config.test b/tests/periph_uart/app.config.test new file mode 100644 index 0000000000..5538b7fa95 --- /dev/null +++ b/tests/periph_uart/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_UART=y +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_uart_mode/app.config.test b/tests/periph_uart_mode/app.config.test new file mode 100644 index 0000000000..bd1543082b --- /dev/null +++ b/tests/periph_uart_mode/app.config.test @@ -0,0 +1,5 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_PERIPH_UART=y +CONFIG_MODULE_PERIPH_UART_MODECFG=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_uart_nonblocking/app.config.test b/tests/periph_uart_nonblocking/app.config.test new file mode 100644 index 0000000000..4dda0331c6 --- /dev/null +++ b/tests/periph_uart_nonblocking/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_UART=y +CONFIG_MODULE_PERIPH_UART_NONBLOCKING=y +CONFIG_MODULE_XTIMER=y diff --git a/tests/periph_wdt/app.config.test b/tests/periph_wdt/app.config.test new file mode 100644 index 0000000000..45011daaaa --- /dev/null +++ b/tests/periph_wdt/app.config.test @@ -0,0 +1,6 @@ +# this file enables modules defined in Kconfig. Do not use this file for +# application configuration. This is only needed during migration. +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_PERIPH_WDT=y +CONFIG_MODULE_XTIMER=y +CONFIG_MODULE_SHELL=y