Skip to content

Commit ab0e236

Browse files
committed
Make tests using binary files optional, disable on Fedora 40
Because they don't work with zlib-ng that they use. See #274
1 parent 9335743 commit ab0e236

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

.github/actions/cmake/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ runs:
88
shell: bash
99
- name: Configure
1010
run: |
11-
cmake -LA .. \
12-
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
11+
cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_OPTS}
1312
shell: bash
1413
working-directory: build
1514

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,13 @@ jobs:
8484
- image: "fedora:39"
8585
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
8686
- image: "fedora:40"
87+
CMAKE_OPTS: -DRUN_TESTS_WITH_BINARY_COMPARE=OFF
8788
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
8889
container:
8990
image: ${{ matrix.image }}
9091
env:
9192
BUILD_TYPE: ${{ matrix.build_type }}
93+
CMAKE_OPTS: ${{ matrix.CMAKE_OPTS }}
9294
CC: ${{ matrix.c_compiler }}
9395
CXX: ${{ matrix.cpp_compiler }}
9496
CXXFLAGS: ${{ matrix.CXXFLAGS }}

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ option(WITH_LZ4 "Build with lz4 support for PBF files" ON)
3333

3434
option(BUILD_TESTING "Build the tests" ON)
3535

36+
# Some tests compare with binary files which might be different on your
37+
# setup. Setting this to OFF disables those test.
38+
# See https://github.com/osmcode/osmium-tool/issues/274
39+
option(RUN_TESTS_WITH_BINARY_COMPARE "Run tests that do binary comparisons" ON)
40+
3641

3742
#-----------------------------------------------------------------------------
3843
#

test/formats/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,29 @@ check_formats(emptyppc empty-nocompression.osm.pbf pbf empty.osm.pbf)
3636
# normal file
3737
check_formats(f1xx f1.osm xml f1.osm)
3838
check_formats(f1xo f1.osm opl f1.osm.opl)
39-
check_formats(f1xp f1.osm pbf f1.osm.pbf)
40-
check_formats(f1xpd f1.osm pbf,pbf_dense_nodes=false f1-nodensenodes.osm.pbf)
41-
check_formats(f1xpc f1.osm pbf,pbf_compression=none f1-nocompression.osm.pbf)
42-
check_formats(f1xpm f1.osm pbf,add_metadata=false f1-nometadata.osm.pbf)
43-
check_formats(f1xpdm f1.osm pbf,pbf_dense_nodes=false,add_metadata=false f1-nodensenodes-nometadata.osm.pbf)
39+
40+
if(RUN_TESTS_WITH_BINARY_COMPARE)
41+
check_formats(f1xp f1.osm pbf f1.osm.pbf)
42+
check_formats(f1xpd f1.osm pbf,pbf_dense_nodes=false f1-nodensenodes.osm.pbf)
43+
check_formats(f1xpm f1.osm pbf,add_metadata=false f1-nometadata.osm.pbf)
44+
check_formats(f1xpdm f1.osm pbf,pbf_dense_nodes=false,add_metadata=false f1-nodensenodes-nometadata.osm.pbf)
45+
endif()
46+
47+
check_formats(f1xpc f1.osm pbf,pbf_compression=none f1-nocompression.osm.pbf)
4448

4549
check_formats(f1px f1.osm.pbf xml f1.osm)
4650
check_formats(f1po f1.osm.pbf opl f1.osm.opl)
47-
check_formats(f1pp f1.osm.pbf pbf f1.osm.pbf)
4851

4952
check_formats(f1pxd f1-nodensenodes.osm.pbf xml f1.osm)
5053
check_formats(f1pod f1-nodensenodes.osm.pbf opl f1.osm.opl)
51-
check_formats(f1ppd f1-nodensenodes.osm.pbf pbf f1.osm.pbf)
5254

5355
check_formats(f1pxc f1-nocompression.osm.pbf xml f1.osm)
5456
check_formats(f1poc f1-nocompression.osm.pbf opl f1.osm.opl)
55-
check_formats(f1ppc f1-nocompression.osm.pbf pbf f1.osm.pbf)
5657

58+
if(RUN_TESTS_WITH_BINARY_COMPARE)
59+
check_formats(f1pp f1.osm.pbf pbf f1.osm.pbf)
60+
check_formats(f1ppd f1-nodensenodes.osm.pbf pbf f1.osm.pbf)
61+
check_formats(f1ppc f1-nocompression.osm.pbf pbf f1.osm.pbf)
62+
endif()
5763

5864
#-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)