Skip to content

Commit aa08e0d

Browse files
JordanYatescfriedt
authored andcommitted
testsuite: coverage: convert dump method to choice
To support future coverage dump methods (semihosting) move `COVERAGE_DUMP` inside a choice symbol. Signed-off-by: Jordan Yates <[email protected]>
1 parent f8e183c commit aa08e0d

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

scripts/pylib/twister/twisterlib/testinstance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ def create_overlay(
398398
for cp in coverage_platform:
399399
if cp in platform.aliases:
400400
content = content + "\nCONFIG_COVERAGE=y"
401-
content = content + "\nCONFIG_COVERAGE_DUMP=y"
402401

403402
if platform.type == "native":
404403
if enable_asan:

scripts/tests/twister/test_testinstance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def test_check_build_or_run(
9696

9797
TESTDATA_PART_2 = [
9898
(True, True, True, ["demo_board_2/unit_testing"], "native",
99-
None, '\nCONFIG_COVERAGE=y\nCONFIG_COVERAGE_DUMP=y\nCONFIG_ASAN=y\nCONFIG_UBSAN=y'),
99+
None, '\nCONFIG_COVERAGE=y\nCONFIG_ASAN=y\nCONFIG_UBSAN=y'),
100100
(True, False, True, ["demo_board_2/unit_testing"], "native",
101-
None, '\nCONFIG_COVERAGE=y\nCONFIG_COVERAGE_DUMP=y\nCONFIG_ASAN=y'),
101+
None, '\nCONFIG_COVERAGE=y\nCONFIG_ASAN=y'),
102102
(False, False, True, ["demo_board_2/unit_testing"], 'native',
103-
None, '\nCONFIG_COVERAGE=y\nCONFIG_COVERAGE_DUMP=y'),
103+
None, '\nCONFIG_COVERAGE=y'),
104104
(True, False, True, ["demo_board_2/unit_testing"], 'mcu',
105-
None, '\nCONFIG_COVERAGE=y\nCONFIG_COVERAGE_DUMP=y'),
105+
None, '\nCONFIG_COVERAGE=y'),
106106
(False, False, False, ["demo_board_2/unit_testing"], 'native', None, ''),
107107
(False, False, True, ['demo_board_1'], 'native', None, ''),
108108
(True, False, False, ["demo_board_2"], 'native', None, '\nCONFIG_ASAN=y'),

subsys/testsuite/Kconfig

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ config COVERAGE_GCOV
7272

7373
endchoice
7474

75+
if COVERAGE_GCOV
76+
7577
config COVERAGE_GCOV_HEAP_SIZE
7678
int "Size of heap allocated for gcov coverage data dump"
7779
depends on COVERAGE_GCOV
@@ -82,12 +84,19 @@ config COVERAGE_GCOV_HEAP_SIZE
8284
data to be dumped over serial. If the value is 0, no buffer will be used,
8385
data will be dumped directly over serial.
8486

87+
choice COVERAGE_DUMP_METHOD
88+
prompt "Method to dump coverage data"
89+
default COVERAGE_DUMP
90+
8591
config COVERAGE_DUMP
86-
bool "Dump coverage data on exit"
87-
depends on COVERAGE_GCOV
92+
bool "Dump coverage data to console on exit"
8893
help
8994
Dump collected coverage information to console on exit.
9095

96+
endchoice
97+
98+
endif # COVERAGE_GCOV
99+
91100
config FORCE_COVERAGE
92101
bool "Force coverage"
93102
select HAS_COVERAGE_SUPPORT

0 commit comments

Comments
 (0)