Skip to content

Fix CI errors #962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
cd build/examples
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../../examples
make
make test
env CTEST_OUTPUT_ON_FAILURE=1 make test

clang-tests:
name: Test Compile clang ${{ matrix.build_type }} ${{ matrix.compile_opt }}
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
cd build/examples
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_C_FLAGS="${{ matrix.compile_opt }}" ../../examples
make
make test
env CTEST_OUTPUT_ON_FAILURE=1 make test

valgrind-tests:
name: Test Valgrind
Expand Down
2 changes: 1 addition & 1 deletion CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(ENABLE_COVERAGE)
add_custom_target(
clean-coverage
# Before running coverage, clear all counters
COMMAND lcov --rc lcov_branch_coverage=1 --directory
COMMAND lcov --rc branch_coverage=1 --directory
'${CMAKE_CURRENT_BINARY_DIR}' --zerocounters
COMMENT "Zeroing counters")
endif()
Expand Down
15 changes: 9 additions & 6 deletions examples/distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <assert.h>
#include <h3/h3api.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>

Expand All @@ -49,23 +50,25 @@ double haversineDistance(double th1, double ph1, double th2, double ph2) {

int main(int argc, char *argv[]) {
// 1455 Market St @ resolution 15
H3Index h3HQ1;
H3Index h3HQ1 = 0;
stringToH3("8f2830828052d25", &h3HQ1);
// 555 Market St @ resolution 15
H3Index h3HQ2;
H3Index h3HQ2 = 0;
stringToH3("8f283082a30e623", &h3HQ2);

LatLng geoHQ1, geoHQ2;
LatLng geoHQ1 = {0};
LatLng geoHQ2 = {0};
cellToLatLng(h3HQ1, &geoHQ1);
cellToLatLng(h3HQ2, &geoHQ2);

int64_t distance;
int64_t distance = 0;
assert(gridDistance(h3HQ1, h3HQ2, &distance) == E_SUCCESS);

printf(
"origin: (%lf, %lf)\n"
"destination: (%lf, %lf)\n"
"grid distance: %d\n"
"grid distance: %" PRId64
"\n"
"distance in km: %lfkm\n",
radsToDegs(geoHQ1.lat), radsToDegs(geoHQ1.lng), radsToDegs(geoHQ2.lat),
radsToDegs(geoHQ2.lng), distance,
Expand All @@ -75,4 +78,4 @@ int main(int argc, char *argv[]) {
// destination: (37.789991, -122.402121)
// grid distance: 2340
// distance in km: 2.256853km
}
}
4 changes: 2 additions & 2 deletions scripts/coverage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ binary_dir=${2:-"Missing binary directory"}
br_exclusion='LCOV_EXCL_BR_LINE|assert\('

cd "${binary_dir}"
lcov --rc lcov_branch_coverage=1 --rc "lcov_excl_br_line=$br_exclusion" --directory . --capture --output-file coverage.info
lcov --rc lcov_branch_coverage=1 --rc "lcov_excl_br_line=$br_exclusion" --extract coverage.info "${src_dir}/src/h3lib/*" --output-file coverage.cleaned.info
lcov --ignore-errors mismatch --rc branch_coverage=1 --rc "lcov_excl_br_line=$br_exclusion" --directory . --capture --output-file coverage.info
lcov --ignore-errors mismatch --rc branch_coverage=1 --rc "lcov_excl_br_line=$br_exclusion" --extract coverage.info "${src_dir}/src/h3lib/*" --output-file coverage.cleaned.info
genhtml --branch-coverage -o coverage coverage.cleaned.info --title 'h3 coverage'
Loading