Skip to content

Commit

Permalink
Make tests succeed on Linux (#930)
Browse files Browse the repository at this point in the history
Fixes #93
  • Loading branch information
deltamarnix authored Jan 9, 2024
1 parent eec4eda commit 7bef5bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion build/ribasim_cli/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
import subprocess
from pathlib import Path

Expand All @@ -15,12 +16,14 @@ def test_ribasim_cli(model_constructor, tmp_path):
assert isinstance(model, ribasim.Model)
model.write(tmp_path / "ribasim.toml")

extension = ".exe" if platform.system() == "Windows" else ""

executable = (
Path(__file__).parents[2]
/ "create_binaries"
/ "ribasim_cli"
/ "bin"
/ "ribasim.exe"
/ f"ribasim{extension}"
)
result = subprocess.run([executable, tmp_path / "ribasim.toml"])

Expand Down
7 changes: 5 additions & 2 deletions python/ribasim_api/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import platform
from pathlib import Path

import pytest
Expand All @@ -9,8 +10,10 @@
@pytest.fixture(scope="session")
def libribasim_paths() -> tuple[Path, Path]:
repo_root = Path(__file__).parents[3].resolve()
lib_folder = repo_root / "build" / "create_binaries" / "libribasim" / "bin"
lib_path = lib_folder / "libribasim"
lib_or_bin = "bin" if platform.system() == "Windows" else "lib"
extension = ".dll" if platform.system() == "Windows" else ".so"
lib_folder = repo_root / "build" / "create_binaries" / "libribasim" / lib_or_bin
lib_path = lib_folder / f"libribasim{extension}"
return lib_path, lib_folder


Expand Down

0 comments on commit 7bef5bf

Please sign in to comment.