Merge pull request #1152 from redboltz/update_codecov

Updated codecov.
This commit is contained in:
Takatoshi Kondo 2025-02-21 22:39:02 +09:00 committed by GitHub
commit 306d59d52f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 15 deletions

View File

@ -42,12 +42,14 @@ jobs:
CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_32BIT=OFF -DBUILD_SHARED_LIBS=ON -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON ..
make -j4
make test
- name: Upload coverage to Codecov
working-directory: build
- name: Generate coverage
run: |
# Create lcov report
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --list coverage.info # debug info
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: build/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -2,7 +2,7 @@
===================
Version 6.1.0 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=c_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/c_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/c_master)
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/c_master/graph/badge.svg)](https://codecov.io/gh/msgpack/msgpack-c/branch/c_master)
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/c_master/graph/badge.svg)](https://app.codecov.io/gh/msgpack/msgpack-c/tree/c_master)
It's like JSON but smaller and faster.

View File

@ -27,10 +27,6 @@ comment:
ignore:
- "test"
- "fuzz"
- "erb"
- "ci"
- "cmake"
- "examle"
- "external"
- "usr"
- "example"

View File

@ -1688,17 +1688,17 @@ TEST(MSGPACKC, init_msgpack_obj_ext) {
EXPECT_STREQ(buffer, obj.via.ext.ptr);
}
#define BUFFER_SIZE 4
TEST(MSGPACKC, init_msgpack_obj_array) {
msgpack_object obj;
char buffer[][7] = {"test_1", "test_2", "test_3", "test_4"};
uint32_t buffer_size = 4;
msgpack_object array[buffer_size];
for(size_t i = 0; i < buffer_size; i++) {
msgpack_object array[BUFFER_SIZE];
for(size_t i = 0; i < BUFFER_SIZE; i++) {
msgpack_object_init_str(&array[i], buffer[i], (uint32_t)strlen(buffer[i]));
}
msgpack_object_init_array(&obj, array, buffer_size);
msgpack_object_init_array(&obj, array, BUFFER_SIZE);
EXPECT_EQ(MSGPACK_OBJECT_ARRAY, obj.type);
for(size_t i = 0; i < buffer_size; i++) {
for(size_t i = 0; i < BUFFER_SIZE; i++) {
EXPECT_STREQ(buffer[i], obj.via.array.ptr[i].via.str.ptr);
}
}