Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/test_fmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import xml.etree.ElementTree as ET
import re
import platform
from packaging import version

from pyfmi.fmi import (
FMUException,
Expand Down Expand Up @@ -88,6 +89,14 @@ def solve(self):
TEST_FMU_PATH = Path(file_path) / 'files' / 'test_fmus'
TEST_FMU_FMI2_ME_PATH = TEST_FMU_PATH / '2.0' / 'me'

GLIBC_VERSION = platform.libc_ver()[1]

uses_test_fmus = pytest.mark.skipif(
(platform.system() != "Linux") or
(version.parse(GLIBC_VERSION) < version.parse("2.33")),
reason = "Linux only binaries & requires glibc >= 2.33"
)

# TODO: Many tests here could be parameterized
# However, in many cases this relies on having FMUs with the same functionality
# available for different FMI versions.
Expand Down Expand Up @@ -1667,7 +1676,7 @@ def test_load_xml(self, fmu_path, test_class):
model = test_class(fmu_path, _connect_dll=False)
assert model.get_name() == "CoupledClutches"

@pytest.mark.skipif(platform.system() != "Linux", reason = "Only Linux binaries")
@uses_test_fmus
@pytest.mark.parametrize("fmu_path",
[
TEST_FMU_FMI2_ME_PATH / "testModels_noStateAssertFailureFunctionLocalVariable.fmu",
Expand Down