From ba86f51b262b7cf97f7732e6f92e66fc2efbbab0 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Fri, 25 Mar 2022 09:37:25 +0100 Subject: [PATCH] sys/test_utils/print_stack_usage: add Kconfig support --- sys/test_utils/Kconfig | 1 + sys/test_utils/print_stack_usage/Kconfig | 10 ++++++++++ tests/Makefile.tests_common | 12 +++++++----- tests/test_interactive.config | 1 - tests/test_print_stack_usage.config | 1 + tests/test_utils.config | 2 ++ 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 sys/test_utils/print_stack_usage/Kconfig delete mode 100644 tests/test_interactive.config create mode 100644 tests/test_print_stack_usage.config create mode 100644 tests/test_utils.config diff --git a/sys/test_utils/Kconfig b/sys/test_utils/Kconfig index 8d37a0250c..099849fb47 100644 --- a/sys/test_utils/Kconfig +++ b/sys/test_utils/Kconfig @@ -10,5 +10,6 @@ menu "Test utilities" rsource "dummy_thread/Kconfig" rsource "interactive_sync/Kconfig" +rsource "print_stack_usage/Kconfig" rsource "result_output/Kconfig" endmenu # Test utilities diff --git a/sys/test_utils/print_stack_usage/Kconfig b/sys/test_utils/print_stack_usage/Kconfig new file mode 100644 index 0000000000..5dab13bf78 --- /dev/null +++ b/sys/test_utils/print_stack_usage/Kconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2022 Freie Universität Berlin +# 2022 Inria +# +# 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 MODULE_TEST_UTILS_PRINT_STACK_USAGE + bool "Print stack usage metrics on stack exit" diff --git a/tests/Makefile.tests_common b/tests/Makefile.tests_common index 64d7ac453c..bb243d12a5 100644 --- a/tests/Makefile.tests_common +++ b/tests/Makefile.tests_common @@ -1,13 +1,15 @@ APPLICATION ?= tests_$(notdir $(patsubst %/,%,$(CURDIR))) ifneq (,$(wildcard $(CURDIR)/tests*/.)) - DEFAULT_MODULE += test_utils_interactive_sync # add interactive test configuration when testing Kconfig - ifeq (1,$(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(RIOTBASE)/tests/test_interactive.config - endif - + DEFAULT_MODULE += test_utils_interactive_sync + # add stack metric printing configuration when testing Kconfig DEFAULT_MODULE += test_utils_print_stack_usage + + # do the same for Kconfig builds + ifeq (1,$(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTBASE)/tests/test_utils.config + endif endif ifneq (,$(filter tests_driver_%,$(APPLICATION))) diff --git a/tests/test_interactive.config b/tests/test_interactive.config deleted file mode 100644 index 40bed26ef6..0000000000 --- a/tests/test_interactive.config +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y diff --git a/tests/test_print_stack_usage.config b/tests/test_print_stack_usage.config new file mode 100644 index 0000000000..dac31232ed --- /dev/null +++ b/tests/test_print_stack_usage.config @@ -0,0 +1 @@ +CONFIG_MODULE_TEST_UTILS_PRINT_STACK_USAGE=y diff --git a/tests/test_utils.config b/tests/test_utils.config new file mode 100644 index 0000000000..001c82ce97 --- /dev/null +++ b/tests/test_utils.config @@ -0,0 +1,2 @@ +CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y +CONFIG_MODULE_TEST_UTILS_PRINT_STACK_USAGE=y