Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/x86/ehl_crb/Kconfig.board
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config BOARD_EHL_CRB
bool "Elkhart Lake CRB"
depends on SOC_ELKHART_LAKE
select X86_64
select HAS_COVERAGE_SUPPORT

config BOARD_EHL_CRB_SBL
bool "Elkhart Lake CRB (with Slim Bootloader)"
Expand Down
14 changes: 12 additions & 2 deletions scripts/pylib/twister/twisterlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,14 @@ def monitor_serial(self, ser, halt_fileno, harness):
ser_fileno = ser.fileno()
readlist = [halt_fileno, ser_fileno]

if self.coverage:
# Set capture_coverage to True to indicate that right after
# test results we should get coverage data, otherwise we exit
# from the test.
harness.capture_coverage = True

ser.flush()

while ser.isOpen():
readable, _, _ = select.select(readlist, [], [], self.timeout)

Expand Down Expand Up @@ -634,8 +642,9 @@ def monitor_serial(self, ser, halt_fileno, harness):
harness.handle(sl.rstrip())

if harness.state:
ser.close()
break
if not harness.capture_coverage:
ser.close()
break

log_out_fp.close()

Expand Down Expand Up @@ -2202,6 +2211,7 @@ def setup_handler(self):
instance.handler.call_make_run = True
elif self.device_testing:
instance.handler = DeviceHandler(instance, "device")
instance.handler.coverage = self.coverage
elif instance.platform.simulation == "nsim":
if find_executable("nsimdrv"):
instance.handler = BinaryHandler(instance, "nsim")
Expand Down