Skip to content

Commit

Permalink
Make tests using binary files optional, disable on Fedora 40
Browse files Browse the repository at this point in the history
Because they don't work with zlib-ng that they use.

See #274
  • Loading branch information
joto committed Oct 31, 2024
1 parent 9335743 commit ab0e236
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/actions/cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ runs:
shell: bash
- name: Configure
run: |
cmake -LA .. \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_OPTS}
shell: bash
working-directory: build

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ jobs:
- image: "fedora:39"
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
- image: "fedora:40"
CMAKE_OPTS: -DRUN_TESTS_WITH_BINARY_COMPARE=OFF
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
container:
image: ${{ matrix.image }}
env:
BUILD_TYPE: ${{ matrix.build_type }}
CMAKE_OPTS: ${{ matrix.CMAKE_OPTS }}
CC: ${{ matrix.c_compiler }}
CXX: ${{ matrix.cpp_compiler }}
CXXFLAGS: ${{ matrix.CXXFLAGS }}
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ option(WITH_LZ4 "Build with lz4 support for PBF files" ON)

option(BUILD_TESTING "Build the tests" ON)

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


#-----------------------------------------------------------------------------
#
Expand Down
22 changes: 14 additions & 8 deletions test/formats/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,29 @@ check_formats(emptyppc empty-nocompression.osm.pbf pbf empty.osm.pbf)
# normal file
check_formats(f1xx f1.osm xml f1.osm)
check_formats(f1xo f1.osm opl f1.osm.opl)
check_formats(f1xp f1.osm pbf f1.osm.pbf)
check_formats(f1xpd f1.osm pbf,pbf_dense_nodes=false f1-nodensenodes.osm.pbf)
check_formats(f1xpc f1.osm pbf,pbf_compression=none f1-nocompression.osm.pbf)
check_formats(f1xpm f1.osm pbf,add_metadata=false f1-nometadata.osm.pbf)
check_formats(f1xpdm f1.osm pbf,pbf_dense_nodes=false,add_metadata=false f1-nodensenodes-nometadata.osm.pbf)

if(RUN_TESTS_WITH_BINARY_COMPARE)
check_formats(f1xp f1.osm pbf f1.osm.pbf)
check_formats(f1xpd f1.osm pbf,pbf_dense_nodes=false f1-nodensenodes.osm.pbf)
check_formats(f1xpm f1.osm pbf,add_metadata=false f1-nometadata.osm.pbf)
check_formats(f1xpdm f1.osm pbf,pbf_dense_nodes=false,add_metadata=false f1-nodensenodes-nometadata.osm.pbf)
endif()

check_formats(f1xpc f1.osm pbf,pbf_compression=none f1-nocompression.osm.pbf)

check_formats(f1px f1.osm.pbf xml f1.osm)
check_formats(f1po f1.osm.pbf opl f1.osm.opl)
check_formats(f1pp f1.osm.pbf pbf f1.osm.pbf)

check_formats(f1pxd f1-nodensenodes.osm.pbf xml f1.osm)
check_formats(f1pod f1-nodensenodes.osm.pbf opl f1.osm.opl)
check_formats(f1ppd f1-nodensenodes.osm.pbf pbf f1.osm.pbf)

check_formats(f1pxc f1-nocompression.osm.pbf xml f1.osm)
check_formats(f1poc f1-nocompression.osm.pbf opl f1.osm.opl)
check_formats(f1ppc f1-nocompression.osm.pbf pbf f1.osm.pbf)

if(RUN_TESTS_WITH_BINARY_COMPARE)
check_formats(f1pp f1.osm.pbf pbf f1.osm.pbf)
check_formats(f1ppd f1-nodensenodes.osm.pbf pbf f1.osm.pbf)
check_formats(f1ppc f1-nocompression.osm.pbf pbf f1.osm.pbf)
endif()

#-----------------------------------------------------------------------------

0 comments on commit ab0e236

Please sign in to comment.