Skip to content

Commit

Permalink
XD
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-bloch committed Nov 9, 2023
1 parent 6ab5712 commit 032b148
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
7 changes: 5 additions & 2 deletions trunner/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,19 @@ def _parse_shell_command(self, config: dict):
prefix = "" if cmd[0].startswith("/") else self.ctx.target.exec_dir() + "/"
else:
prefix = "sysexec "

Check warning on line 164 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.9)

W293 blank line contains whitespace

Check warning on line 164 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.10)

W293 blank line contains whitespace

Check warning on line 164 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.11)

W293 blank line contains whitespace
parsed_cmd = shlex.split(prefix + cmd[0]) + cmd[1:] if self.ctx.target.rootfs else shlex.split(prefix + cmd[0].split("/")[-1]) + cmd[1:]

Check failure on line 165 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.9)

E501 line too long (148 > 120 characters)

Check failure on line 165 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.10)

E501 line too long (148 > 120 characters)

Check failure on line 165 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.11)

E501 line too long (148 > 120 characters)
binary = cmd[0]
binary = cmd[0] if self.ctx.target.rootfs else cmd[0].split("/")[-1]
path = cmd[0].replace(cmd[0].split("/")[-1], "") if cmd[0].startswith("/") else self.ctx.target.exec_dir() + "/"

Check failure on line 167 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.9)

E501 line too long (124 > 120 characters)

Check failure on line 167 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.10)

E501 line too long (124 > 120 characters)

Check failure on line 167 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.11)

E501 line too long (124 > 120 characters)
else:
binary = None
parsed_cmd = cmd
path = ""

self.test.shell = ShellOptions(
binary=binary,
cmd=parsed_cmd,
path =path,

Check failure on line 176 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.9)

E251 unexpected spaces around keyword / parameter equals

Check failure on line 176 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.10)

E251 unexpected spaces around keyword / parameter equals

Check failure on line 176 in trunner/config.py

View workflow job for this annotation

GitHub Actions / build (3.11)

E251 unexpected spaces around keyword / parameter equals
)

def _parse_reboot(self, config: dict) -> None:
Expand Down
10 changes: 1 addition & 9 deletions trunner/target/armv7m4.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,10 @@ def build_test(self, test: TestOptions):
app_loader = None

if test.bootloader.apps:
for app in test.bootloader.apps:
if app.file.startswith("/"):
name = app.file.split("/")[-1]
path = app.file.replace(name, "")
app.file = name
path = self.root_dir() + path
else:
path = self.bin_dir()
app_loader = STM32L4x6PloAppLoader(
dut=self.dut,
apps=test.bootloader.apps,
gdb=GdbInteractive(port=3333, cwd=path),
gdb=GdbInteractive(port=3333, cwd=self.root_dir() + test.shell.path),
)

builder.add(PloHarness(self.dut, app_loader=app_loader))
Expand Down
11 changes: 1 addition & 10 deletions trunner/target/armv7m7.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,8 @@ def build_test(self, test: TestOptions) -> Callable[[TestResult], TestResult]:
app_loader = None

if test.bootloader.apps:
for app in test.bootloader.apps:
if app.file.startswith("/"):
name = app.file.split("/")[-1]
path = app.file.replace(name, "")
app.file = name
path = self.root_dir() + path
else:
path = self.bin_dir()

app_loader = PloPhoenixdAppLoader(
dut=self.dut, apps=test.bootloader.apps, phoenixd=Phoenixd(directory=path)
dut=self.dut, apps=test.bootloader.apps, phoenixd=Phoenixd(directory=self.root_dir() + test.shell.path)

Check failure on line 72 in trunner/target/armv7m7.py

View workflow job for this annotation

GitHub Actions / build (3.9)

E501 line too long (123 > 120 characters)

Check failure on line 72 in trunner/target/armv7m7.py

View workflow job for this annotation

GitHub Actions / build (3.10)

E501 line too long (123 > 120 characters)

Check failure on line 72 in trunner/target/armv7m7.py

View workflow job for this annotation

GitHub Actions / build (3.11)

E501 line too long (123 > 120 characters)
)

builder.add(PloHarness(self.dut, app_loader=app_loader))
Expand Down
1 change: 1 addition & 0 deletions trunner/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ class BootloaderOptions:
class ShellOptions:
binary: Optional[str] = None
cmd: Optional[List[str]] = None
path: Optional[str] = "/bin"


def void_harness_fn(result: TestResult) -> TestResult:
Expand Down

0 comments on commit 032b148

Please sign in to comment.