1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/turo: Allow default selection of json

This commit is contained in:
MrKevinWeiss 2021-10-22 17:14:57 +02:00
parent 5f119e3b6c
commit 5a66307314
No known key found for this signature in database
GPG Key ID: 3514539D7808D123
4 changed files with 36 additions and 14 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