22import logging
33import os
44import typing as t
5+ from pathlib import Path
56
67from packaging .version import Version
78from pytest_embedded .log import DuplicateStdoutPopen , MessageQueue
@@ -47,7 +48,6 @@ def __init__(
4748 ** kwargs ,
4849 ):
4950 self .app = app
50- self .firmware_resolver = firmware_resolver
5151
5252 # Get Wokwi API token
5353 token = os .getenv ('WOKWI_CLI_TOKEN' )
@@ -76,8 +76,11 @@ def __init__(
7676
7777 # Connect and start simulation
7878 try :
79- firmware_path = self .firmware_resolver .resolve_firmware (app )
80- self ._setup_simulation (wokwi_diagram , firmware_path , app .elf_file )
79+ flasher_args = firmware_resolver .resolve_firmware (app )
80+ firmware_path = Path (flasher_args ).as_posix ()
81+ elf_path = Path (app .elf_file ).as_posix ()
82+
83+ self ._setup_simulation (wokwi_diagram , firmware_path , elf_path )
8184 self ._start_serial_monitoring ()
8285 except Exception as e :
8386 self .close ()
@@ -90,13 +93,14 @@ def _setup_simulation(self, diagram: str, firmware_path: str, elf_path: str):
9093
9194 # Upload files
9295 self .client .upload_file ('diagram.json' , diagram )
93- self .client .upload_file ('pytest.bin' , firmware_path )
96+ firmware = self .client .upload_file ('pytest.bin' , firmware_path )
97+
9498 self .client .upload_file ('pytest.elf' , elf_path )
9599
96100 logging .info ('Uploaded diagram and firmware to Wokwi. Starting simulation...' )
97101
98102 # Start simulation
99- self .client .start_simulation (firmware = 'pytest.bin' , elf = 'pytest.elf' )
103+ self .client .start_simulation (firmware , elf = 'pytest.elf' )
100104
101105 def _start_serial_monitoring (self ):
102106 """Start monitoring serial output and forward to stdout and message queue."""
0 commit comments