1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #17039 from MrKevinWeiss/pr/turodefault

sys/turo: Allow default selection of json
This commit is contained in:
Leandro Lanzieri 2021-11-16 18:22:55 +01:00 committed by GitHub
commit b0c380a9a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 18 deletions

View File

@ -742,10 +742,6 @@ ifneq (,$(filter suit_%,$(USEMODULE)))
USEMODULE += suit
endif
ifneq (,$(filter test_utils_result_output_%,$(USEMODULE)))
USEMODULE += test_utils_result_output
endif
# include ztimer dependencies
ifneq (,$(filter ztimer% %ztimer,$(USEMODULE)))
include $(RIOTBASE)/sys/ztimer/Makefile.dep

View File

@ -1,9 +1,9 @@
ifneq (,$(filter test_utils_result_output,$(USEMODULE)))
include $(RIOTBASE)/sys/test_utils/result_output/Makefile.dep
endif
ifneq (,$(filter test_utils_interactive_sync,$(USEMODULE)))
USEMODULE += stdin
endif
ifneq (,$(filter test_utils_result_output_%,$(USEMODULE)))
USEMODULE += fmt
endif
ifneq (,$(filter benchmark_udp,$(USEMODULE)))
USEMODULE += netutils
USEMODULE += sema_inv

View File

@ -5,11 +5,14 @@
# directory for more details.
#
menuconfig MODULE_TEST_UTILS_RESULT_OUTPUT
bool "Use result output abstraction"
depends on TEST_KCONFIG
if MODULE_TEST_UTILS_RESULT_OUTPUT
choice
bool "Test utils result output"
depends on TEST_KCONFIG
optional
default MODULE_TEST_UTILS_RESULT_OUTPUT_JSON
help
A common API that can format result output depending on the module
@ -18,7 +21,6 @@ choice
config MODULE_TEST_UTILS_RESULT_OUTPUT_TXT
bool "Text"
select MODULE_FMT
select MODULE_TEST_UTILS_RESULT_OUTPUT
help
Output results in plain text. Intended for developer friendly console
output.
@ -26,19 +28,16 @@ config MODULE_TEST_UTILS_RESULT_OUTPUT_TXT
config MODULE_TEST_UTILS_RESULT_OUTPUT_JSON
bool "JSON"
select MODULE_FMT
select MODULE_TEST_UTILS_RESULT_OUTPUT
help
Output results json formatted results. This allows generic json parsers
to be used. Trailing commas may be present.
config MODULE_TEST_UTILS_RESULT_OUTPUT_CHECK
bool "Check"
select MODULE_TEST_UTILS_RESULT_OUTPUT
help
Asserts that the structure of the result output are correct. No output
is given.
endchoice
config MODULE_TEST_UTILS_RESULT_OUTPUT
bool
endif # MODULE_TEST_UTILS_RESULT_OUTPUT

View File

@ -0,0 +1,27 @@
TURO_OUTPUT_FORMAT := \
test_utils_result_output_check \
test_utils_result_output_json \
test_utils_result_output_txt
USED_TURO_OUTPUT_FORMAT := $(filter test_utils_result_output_%,$(USEMODULE))
ifeq (0,$(words $(USED_TURO_OUTPUT_FORMAT)))
USEMODULE += test_utils_result_output_json
else ifeq (1,$(words $(USED_TURO_OUTPUT_FORMAT)))
ifeq (,$(filter $(USED_TURO_OUTPUT_FORMAT), $(TURO_OUTPUT_FORMAT)))
$(info Currently using: $(USED_TURO_OUTPUT_FORMAT))
$(error Please use one of: $(TURO_OUTPUT_FORMAT))
endif
else
$(info Only one test_utils_result_output format can be used at a time.)
$(info Currently selecting: $(USED_TURO_OUTPUT_FORMAT))
$(error Please use one of: $(TURO_OUTPUT_FORMAT))
endif
TURO_OUTPUT_FORMAT_USES_FMT := \
test_utils_result_output_json \
test_utils_result_output_txt
ifneq (,$(filter $(TURO_OUTPUT_FORMAT_USES_FMT),$(USEMODULE)))
USEMODULE += fmt
endif

View File

@ -1,9 +1,7 @@
include ../Makefile.tests_common
OUTPUT_FORMAT ?= json
USEMODULE += test_utils_result_output_${OUTPUT_FORMAT}
USEMODULE += test_utils_result_output
USEMODULE += shell
USEMODULE += fmt
# Use a terminal that does not introduce extra characters into the stream.
RIOT_TERMINAL ?= socat

View File

@ -1,3 +1,3 @@
CONFIG_MODULE_FMT=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_TEST_UTILS_RESULT_OUTPUT_JSON=y
CONFIG_MODULE_TEST_UTILS_RESULT_OUTPUT=y

View File

@ -1 +1,2 @@
USEMODULE += test_utils_result_output_check
USEMODULE += test_utils_result_output