Skip to content

Commit

Permalink
Merge pull request #11352 from rouault/ci_workaround_exr_3_3_2_crashes
Browse files Browse the repository at this point in the history
tests: skip tests that crash with OpenEXR 3.3.2
  • Loading branch information
rouault authored Nov 25, 2024
2 parents b914d9b + 22d2437 commit d66e4db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions autotest/gdrivers/exr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
pytestmark = pytest.mark.require_driver("EXR")


def exr_is_gte(x, y):
drv = gdal.GetDriverByName("EXR")
if drv is None:
return False
return [
int(i) for i in drv.GetMetadataItem("OPENEXR_VERSION", "EXR").split(".")[0:2]
] >= [x, y]


def test_exr_byte_createcopy():
tst = gdaltest.GDALTest("EXR", "byte.tif", 1, 4672)
tst.testCreateCopy(vsimem=1)
Expand Down Expand Up @@ -114,6 +123,7 @@ def test_exr_compression_create():
gdal.Unlink(tmpfilename)


@pytest.mark.skipif(exr_is_gte(3, 3), reason="test crashes with OpenEXR 3.3.2")
def test_exr_compression_dwa_compression_level():
src_ds = gdal.Open("data/small_world.tif")
tmpfilename = "/vsimem/temp.exr"
Expand Down Expand Up @@ -157,6 +167,7 @@ def test_exr_tiling_custom_tile_size():
gdal.Unlink(tmpfilename)


@pytest.mark.skipif(exr_is_gte(3, 3), reason="test crashes with OpenEXR 3.3.2")
def test_exr_rgb_byte_tiled():
src_ds = gdal.Open("data/small_world.tif")
tmpfilename = "/vsimem/temp.exr"
Expand All @@ -170,6 +181,7 @@ def test_exr_rgb_byte_tiled():
gdal.Unlink(tmpfilename)


@pytest.mark.skipif(exr_is_gte(3, 3), reason="test crashes with OpenEXR 3.3.2")
def test_exr_rgb_byte_strip_no_auto_rescale():
src_ds = gdal.Open("data/small_world.tif")
tmpfilename = "/vsimem/temp.exr"
Expand All @@ -183,6 +195,7 @@ def test_exr_rgb_byte_strip_no_auto_rescale():
gdal.Unlink(tmpfilename)


@pytest.mark.skipif(exr_is_gte(3, 3), reason="test crashes with OpenEXR 3.3.2")
def test_exr_overviews():
src_ds = gdal.Open("data/small_world.tif")
tmpfilename = "/vsimem/temp.exr"
Expand Down
2 changes: 2 additions & 0 deletions frmts/exr/exrdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2039,5 +2039,7 @@ void GDALRegister_EXR()
poDriver->pfnCreateCopy = GDALEXRDataset::CreateCopy;
poDriver->pfnCreate = GDALEXRDataset::Create;

poDriver->SetMetadataItem("OPENEXR_VERSION", OPENEXR_VERSION_STRING, "EXR");

GetGDALDriverManager()->RegisterDriver(poDriver);
}

0 comments on commit d66e4db

Please sign in to comment.