diff --git a/Makefile.sparcv8leon3 b/Makefile.sparcv8leon3 index 98114b59..7e50dd07 100644 --- a/Makefile.sparcv8leon3 +++ b/Makefile.sparcv8leon3 @@ -1 +1,3 @@ +ifneq ($(TARGET), sparcv8leon3-generic-qemu) DEFAULT_COMPONENTS += test-grlib-multi +endif \ No newline at end of file diff --git a/psh/test.yaml b/psh/test.yaml index 9c0254e9..cd4b0886 100644 --- a/psh/test.yaml +++ b/psh/test.yaml @@ -1,4 +1,7 @@ test: + targets: + value: [sparcv8leon3-generic-qemu] + tests: - name: gibber harness: test-gibber.py @@ -13,7 +16,7 @@ test: - name: pshlogin harness: test-pshlogin.py targets: - exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo] + exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, sparcv8leon3-generic-qemu] - name: echo harness: test-echo.py @@ -36,7 +39,7 @@ test: - name: cat-shells harness: test-cat-shells.py targets: - exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo] + exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, sparcv8leon3-generic-qemu] - name: kill harness: test-kill.py @@ -50,7 +53,7 @@ test: - name: touch-rootfs harness: test-touch-rootfs.py targets: - exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo] + exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, sparcv8leon3-generic-qemu] - name: ls harness: test-ls.py @@ -58,13 +61,13 @@ test: - name: ls-rootfs harness: test-ls-rootfs.py targets: - exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo] + exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, sparcv8leon3-generic-qemu] - name: runfile harness: test-runfile.py targets: # runfile applet is not intended for non-rootfs targets - exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo] + exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, sparcv8leon3-generic-qemu] - name: history harness: test-history.py diff --git a/runner.py b/runner.py index 731feed3..8386a884 100755 --- a/runner.py +++ b/runner.py @@ -18,6 +18,7 @@ HostPCGenericTarget, IA32GenericQemuTarget, RISCV64GenericQemuTarget, + SPARCV8Leon3GenericQemuTarget, ARMv7A9Zynq7000QemuTarget, STM32L4x6Target, Zynq7000ZedboardTarget, @@ -236,6 +237,7 @@ def resolve_targets_and_hosts() -> Tuple[Dict[str, Type[TargetBase]], Dict[str, IMXRT117xEvkTarget, Zynq7000ZedboardTarget, IMX6ULLEvkTarget, + SPARCV8Leon3GenericQemuTarget, ] hosts: List[Type[Host]] = [EmulatorHost, RpiHost] diff --git a/trunner/target/__init__.py b/trunner/target/__init__.py index 096c953d..a757d1a0 100644 --- a/trunner/target/__init__.py +++ b/trunner/target/__init__.py @@ -7,6 +7,7 @@ IA32GenericQemuTarget, RISCV64GenericQemuTarget, ARMv7A9Zynq7000QemuTarget, + SPARCV8Leon3GenericQemuTarget, ) from .host import HostPCGenericTarget @@ -16,6 +17,7 @@ "ARMv7M7Target", "IA32GenericQemuTarget", "RISCV64GenericQemuTarget", + "SPARCV8Leon3GenericQemuTarget", "ARMv7A9Zynq7000QemuTarget", "HostPCGenericTarget", "STM32L4x6Target", diff --git a/trunner/target/emulated.py b/trunner/target/emulated.py index 25c92717..75ebcf96 100644 --- a/trunner/target/emulated.py +++ b/trunner/target/emulated.py @@ -3,7 +3,12 @@ from trunner.ctx import TestContext from trunner.dut import QemuDut -from trunner.harness import HarnessBuilder, RebooterHarness, ShellHarness, TestStartRunningHarness +from trunner.harness import ( + HarnessBuilder, + RebooterHarness, + ShellHarness, + TestStartRunningHarness, +) from trunner.types import TestOptions, TestResult from .base import TargetBase @@ -22,7 +27,9 @@ def __init__(self, script: str): super().__init__() self.script = script # TODO Make sure that script path exists - self.dut = QemuDut(f"{self.project_dir}/scripts/{self.script}", encoding="utf-8") + self.dut = QemuDut( + f"{self.project_dir}/scripts/{self.script}", encoding="utf-8" + ) self.rebooter = QemuDutRebooter(self.dut) @classmethod @@ -80,6 +87,19 @@ def from_context(cls, _: TestContext): return cls() +class SPARCV8Leon3GenericQemuTarget(QemuTarget): + name = "sparcv8leon3-generic-qemu" + rootfs = False + experimental = True + + def __init__(self): + super().__init__("sparcv8leon3-generic-qemu-test.sh") + + @classmethod + def from_context(cls, _: TestContext): + return cls() + + class ARMv7A9Zynq7000QemuTarget(QemuTarget): name = "armv7a9-zynq7000-qemu" rootfs = True