Skip to content
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
90 changes: 90 additions & 0 deletions .covdbg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Coverage settings for covdbg
# Format version: 1

version: 1
source_root: "."
coverage:
default:
files:
# Select which source files are included in the coverage report.
#
# The patterns are glob-style:
# - '*' matches any characters within a single path segment (no directory separators)
# - '**' matches across directory boundaries (recursive)
#
# Files matched by 'include' are added to the coverage database even if they are
# not discovered via linked debug info (PDB). If they are never executed, they
# will appear as 0% coverage (LCOV-like behavior).
include:
- "include/**/*.h"

# Exclude specific files or directories from the report.
# Exclude rules always take precedence over include rules.
exclude:
# =====================================================================
# Windows SDK and Universal CRT (installed paths)
# "C:/Program Files*/Windows Kits/**"
# =====================================================================
- "**/Windows Kits/**"

# =====================================================================
# MSVC Toolchain (installed paths)
# "C:/Program Files*/Microsoft Visual Studio/**/VC/Tools/**"
# =====================================================================
- "**/VC/Tools/MSVC/**"

# =====================================================================
# MSVC CRT/STL Source (build server paths from PDBs)
# These patterns match paths embedded in Microsoft's pre-built binaries
# from their internal build systems (D:\a\_work\1\s\src\...)
# =====================================================================
- "**/vctools/crt/**" # CRT runtime, startup, vcruntime
- "**/vctools/langapi/**" # Language API (undname, etc.)
- "**/stl/inc/**" # STL headers
- "**/stl/src/**" # STL source

# =====================================================================
# Universal CRT (UCRT) - minkernel paths from Windows PDBs
# =====================================================================
- "**/minkernel/crts/ucrt/**" # UCRT implementation
- "**/minkernel/crts/crtw32/**" # Legacy CRT components

# =====================================================================
# Windows SDK internals (onecore paths from Windows PDBs)
# =====================================================================
- "**/onecore/**" # OneCore SDK internals

# =====================================================================
# External SDK includes embedded in PDBs
# =====================================================================
- "**/ExternalAPIs/**" # External API headers
- "**/binaries/amd64ret/inc/**" # Binary distribution includes

# =====================================================================
# Project-specific exclusions
# =====================================================================
# Build dependencies (CMake FetchContent, etc.)
- "build/**/_deps/**"

# Test files (exclude from coverage report)
- "src/**/*Tests.cpp"

functions:
# Control which functions are included in function-level coverage.
#
# Patterns can be fully qualified names (e.g. Namespace::Class::Method) or
# wildcard expressions using '*'.
include:
- "*" # Include all functions by default

# Exclude specific functions (or patterns) from function-level coverage.
# These are compiler-generated or runtime functions that add noise.
exclude:
# MSVC empty global delete (generated by compiler)
- "__empty_global_delete"

# CRT startup/initialization functions
- "__scrt_*"
- "_RTC_*"
- "__security_*"
- "__GSHandler*"
26 changes: 20 additions & 6 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ ubuntu-latest, windows-latest ]
build_type: [ Release ]
build_type: [ Release, Debug ]
c_compiler: [ gcc, clang, cl ]
include:
- os: windows-latest
Expand Down Expand Up @@ -54,16 +54,11 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="conan_provider.cmake"
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
Expand All @@ -78,3 +73,22 @@ jobs:
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }}

- name: Setup covdbg
if: matrix.os == 'windows-latest' && matrix.build_type == 'Debug'
uses: covdbg/setup-covdbg@v0
with:
version: 'latest'

- name: Run Coverage
if: matrix.os == 'windows-latest' && matrix.build_type == 'Debug'
shell: pwsh
run: |
covdbg --fetch-license --config .covdbg.yaml --output ${{ steps.strings.outputs.build-output-dir }}\tests\${{ matrix.build_type }}\msgpack23_tests.covdb ${{ steps.strings.outputs.build-output-dir }}\tests\${{ matrix.build_type }}\msgpack23_tests.exe
covdbg convert --format LCOV --input ${{ steps.strings.outputs.build-output-dir }}\tests\${{ matrix.build_type }}\msgpack23_tests.covdb --output ${{ steps.strings.outputs.build-output-dir }}\tests\${{ matrix.build_type }}\msgpack23_tests.lcov

- name: Upload coverage reports to Codecov
if: matrix.os == 'windows-latest' && matrix.build_type == 'Debug'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ add_library(
)
add_library(msgpack23::msgpack23 ALIAS msgpack23)

# download CPM.cmake
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.8/CPM.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake
EXPECTED_HASH SHA256=78ba32abdf798bc616bab7c73aac32a17bbd7b06ad9e26a6add69de8f3ae4791
)
include(${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake)

target_compile_features(msgpack23 INTERFACE cxx_std_23)

target_include_directories(
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# msgpack23
[![Conan Center](https://img.shields.io/conan/v/msgpack23)](https://conan.io/center/recipes/msgpack23)
[![codecov](https://codecov.io/gh/rwindegger/msgpack23/graph/badge.svg?token=9JINA61YG2)](https://codecov.io/gh/rwindegger/msgpack23)
[![covdbg](https://covdbg.com/badge.svg/)](https://covdbg.com/)

A modern, header-only C++ library for MessagePack serialization and deserialization.

Expand Down
Loading