test_targets: adjust to enumerate litex_boards module

This commit is contained in:
Andrew Dennison 2023-10-20 10:41:29 +11:00
parent 31bc03d79b
commit 3ca6bd3340
1 changed files with 7 additions and 2 deletions

View File

@ -13,6 +13,11 @@ from migen import *
from litex.soc.integration.builder import *
import os
import inspect
import litex_boards
litex_boards_path = os.path.dirname(inspect.getfile(litex_boards))
class TestTargets(unittest.TestCase):
excluded_platforms = [
"qmtech_daughterboard", # Reason: Not a real platform.
@ -46,7 +51,7 @@ class TestTargets(unittest.TestCase):
def test_platforms(self):
# Collect platforms.
platforms = []
for file in os.listdir("./litex_boards/platforms/"):
for file in os.listdir(f"{litex_boards_path}/platforms/"):
if file.endswith(".py"):
file = file.replace(".py", "")
if file not in ["__init__"] + self.excluded_platforms:
@ -68,7 +73,7 @@ python3 -m litex_boards.targets.simple litex_boards.platforms.{} \
def test_targets(self):
# Collect targets.
targets = []
for file in os.listdir("./litex_boards/targets/"):
for file in os.listdir(f"{litex_boards_path}/targets/"):
if file.endswith(".py"):
file = file.replace(".py", "")
if file not in ["__init__"] + self.excluded_targets: