From 32e1057ae480d359a9feba1aa2e1a9f3de500780 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 18 Jun 2024 23:40:50 +0200 Subject: [PATCH] Try to create bin directory. --- tests/unit/GHDL.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/unit/GHDL.py b/tests/unit/GHDL.py index 85f3fc4b..9d9acf45 100644 --- a/tests/unit/GHDL.py +++ b/tests/unit/GHDL.py @@ -45,10 +45,14 @@ class CommonOptions(TestCase, Helper): def setUpClass(cls) -> None: # print(f"\nPlatform: {sys_platform}") if sys_platform in ("linux", "darwin"): + if not cls._binaryDirectoryPath.exists(): + print(f"Creating bin directory '{cls._binaryDirectoryPath}': ", end="") + cls._binaryDirectoryPath.mkdir(parents=True) + print(f"DONE" if cls._binaryDirectoryPath.exists() and cls._binaryDirectoryPath.is_dir() else f"FAILED") ghdlBinaryPath: Path = cls._binaryDirectoryPath / "ghdl" print(f"Creating dummy file '{ghdlBinaryPath}': ", end="") ghdlBinaryPath.touch() - print(f"DONE" if ghdlBinaryPath.exists() else f"FAILED") + print(f"DONE" if ghdlBinaryPath.exists() and ghdlBinaryPath.is_file() else f"FAILED") def test_Help(self) -> None: print() @@ -83,10 +87,14 @@ class Analyze(TestCase, Helper): def setUpClass(cls) -> None: # print(f"\nPlatform: {sys_platform}") if sys_platform in ("linux", "darwin"): + if not cls._binaryDirectoryPath.exists(): + print(f"Creating bin directory '{cls._binaryDirectoryPath}': ", end="") + cls._binaryDirectoryPath.mkdir(parents=True) + print(f"DONE" if cls._binaryDirectoryPath.exists() and cls._binaryDirectoryPath.is_dir() else f"FAILED") ghdlBinaryPath: Path = cls._binaryDirectoryPath / "ghdl" print(f"Creating dummy file '{ghdlBinaryPath}': ", end="") ghdlBinaryPath.touch() - print(f"DONE" if ghdlBinaryPath.exists() else f"FAILED") + print(f"DONE" if ghdlBinaryPath.exists() and ghdlBinaryPath.is_file() else f"FAILED") def test_Analyze(self) -> None: print()