Skip to content

Comments

[DeepTest] Install and compute code coverage for ubuntu#5782

Merged
guhetier merged 15 commits intomainfrom
saikat/cross-platform-coverage
Feb 20, 2026
Merged

[DeepTest] Install and compute code coverage for ubuntu#5782
guhetier merged 15 commits intomainfrom
saikat/cross-platform-coverage

Conversation

@saikat107
Copy link
Contributor

@saikat107 saikat107 commented Feb 6, 2026

Overview

This PR introduces comprehensive code coverage support for Linux builds in MsQuic, complementing the existing Windows coverage capabilities. The implementation uses gcovr to collect and report coverage data from GCC/Clang instrumented builds, producing Cobertura XML reports compatible with CI/CD pipelines.

Use Cases

  1. Developer Code Coverage Analysis on Linux: Developers can now build MsQuic with coverage instrumentation and run tests to identify untested code paths:
   ./scripts/build.ps1 -EnableGCov
   ./scripts/test.ps1 -CodeCoverage
  1. Clang-Based Coverage Collection For builds using Clang instead of GCC, the new -Clang flag ensures proper coverage tool invocation using llvm-cov gcov:
   ./scripts/test.ps1 -CodeCoverage -Clang
  1. Environment Setup: Running prepare-machine.ps1 -InstallCodeCoverage now handles Linux dependencies —installing pip if needed and pinning gcovr to version 8.6 for reproducibility.

Files Modified

  • scripts/build.ps1 — Parameter rename, Linux-only coverage flag injection
  • scripts/prepare-machine.ps1 — Cross-platform coverage tool installation logic
  • scripts/test.ps1 — gcovr invocation, Clang support, improved filtering
  • scripts/run-executable.ps1 — gcovr availability validation
  • scripts/run-gtest.ps1 — gcovr availability validation

Coverage Report Details

The generated report covers:

  • ✅ src/core/* — Core QUIC protocol implementation
  • ✅ src/platform/* — Platform abstraction layer
  • ❌ Excludes any paths containing "test" (case-insensitive)

Output:

artifacts/coverage/msquiccoverage.xml (Cobertura format)

@saikat107 saikat107 requested a review from a team as a code owner February 6, 2026 21:48
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.71%. Comparing base (dbfcce1) to head (a4a5f5d).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5782      +/-   ##
==========================================
- Coverage   86.11%   84.71%   -1.40%     
==========================================
  Files          60       60              
  Lines       18729    18729              
==========================================
- Hits        16128    15866     -262     
- Misses       2601     2863     +262     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@saikat107 saikat107 changed the title [DO NOT MERGE] Install and compute code coverage for ubuntu Install and compute code coverage for ubuntu Feb 9, 2026
@saikat107 saikat107 self-assigned this Feb 9, 2026
elefthei pushed a commit to elefthei/msquic that referenced this pull request Feb 9, 2026
Port of PR microsoft#5782 functionality:
- build.sh: --code-coverage flag passes --coverage to cmake C/CXX flags
- test.sh: --code-coverage and --clang flags; runs gcovr after tests
  to generate cobertura XML from .gcda files
- run-gtest.sh: accepts --code-coverage flag (gcda files auto-generated)

Usage:
  ./scripts/build.sh --code-coverage
  ./scripts/test.sh --code-coverage        # uses gcov
  ./scripts/test.sh --code-coverage --clang # uses llvm-cov gcov
@saikat107 saikat107 changed the title Install and compute code coverage for ubuntu [DeepTest] Install and compute code coverage for ubuntu Feb 13, 2026
@saikat107 saikat107 requested a review from guhetier February 13, 2026 19:09
Copy link
Collaborator

@guhetier guhetier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me except that truncated comment

Co-authored-by: Guillaume Hetier <guhetier@microsoft.com>
@guhetier
Copy link
Collaborator

@saikat107 Can you please rebase the PR?
A github runner change cause builds to fail without an updated version an action that your PR doesn't currently have.

dependabot bot and others added 6 commits February 19, 2026 11:26
…5780)

Bumps the actions group with 1 update:
[github/codeql-action](https://github.com/github/codeql-action).

Updates `github/codeql-action` from 4.32.0 to 4.32.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/github/codeql-action/releases">github/codeql-action's
releases</a>.</em></p>
<blockquote>
<h2>v4.32.2</h2>
<ul>
<li>Update default CodeQL bundle version to <a
href="https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.1">2.24.1</a>.
<a
href="https://redirect.github.com/github/codeql-action/pull/3460">#3460</a></li>
</ul>
<h2>v4.32.1</h2>
<ul>
<li>A warning is now shown in Default Setup workflow logs if a <a
href="https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries">private
package registry is configured</a> using a GitHub Personal Access Token
(PAT), but no username is configured. <a
href="https://redirect.github.com/github/codeql-action/pull/3422">#3422</a></li>
<li>Fixed a bug which caused the CodeQL Action to fail when repository
properties cannot successfully be retrieved. <a
href="https://redirect.github.com/github/codeql-action/pull/3421">#3421</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/github/codeql-action/blob/main/CHANGELOG.md">github/codeql-action's
changelog</a>.</em></p>
<blockquote>
<h1>CodeQL Action Changelog</h1>
<p>See the <a
href="https://github.com/github/codeql-action/releases">releases
page</a> for the relevant changes to the CodeQL CLI and language
packs.</p>
<h2>[UNRELEASED]</h2>
<p>No user facing changes.</p>
<h2>4.32.2 - 05 Feb 2026</h2>
<ul>
<li>Update default CodeQL bundle version to <a
href="https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.1">2.24.1</a>.
<a
href="https://redirect.github.com/github/codeql-action/pull/3460">#3460</a></li>
</ul>
<h2>4.32.1 - 02 Feb 2026</h2>
<ul>
<li>A warning is now shown in Default Setup workflow logs if a <a
href="https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries">private
package registry is configured</a> using a GitHub Personal Access Token
(PAT), but no username is configured. <a
href="https://redirect.github.com/github/codeql-action/pull/3422">#3422</a></li>
<li>Fixed a bug which caused the CodeQL Action to fail when repository
properties cannot successfully be retrieved. <a
href="https://redirect.github.com/github/codeql-action/pull/3421">#3421</a></li>
</ul>
<h2>4.32.0 - 26 Jan 2026</h2>
<ul>
<li>Update default CodeQL bundle version to <a
href="https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.0">2.24.0</a>.
<a
href="https://redirect.github.com/github/codeql-action/pull/3425">#3425</a></li>
</ul>
<h2>4.31.11 - 23 Jan 2026</h2>
<ul>
<li>When running a Default Setup workflow with <a
href="https://docs.github.com/en/actions/how-tos/monitor-workflows/enable-debug-logging">Actions
debugging enabled</a>, the CodeQL Action will now use more unique names
when uploading logs from the Dependabot authentication proxy as workflow
artifacts. This ensures that the artifact names do not clash between
multiple jobs in a build matrix. <a
href="https://redirect.github.com/github/codeql-action/pull/3409">#3409</a></li>
<li>Improved error handling throughout the CodeQL Action. <a
href="https://redirect.github.com/github/codeql-action/pull/3415">#3415</a></li>
<li>Added experimental support for automatically excluding <a
href="https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github">generated
files</a> from the analysis. This feature is not currently enabled for
any analysis. In the future, it may be enabled by default for some
GitHub-managed analyses. <a
href="https://redirect.github.com/github/codeql-action/pull/3318">#3318</a></li>
<li>The changelog extracts that are included with releases of the CodeQL
Action are now shorter to avoid duplicated information from appearing in
Dependabot PRs. <a
href="https://redirect.github.com/github/codeql-action/pull/3403">#3403</a></li>
</ul>
<h2>4.31.10 - 12 Jan 2026</h2>
<ul>
<li>Update default CodeQL bundle version to 2.23.9. <a
href="https://redirect.github.com/github/codeql-action/pull/3393">#3393</a></li>
</ul>
<h2>4.31.9 - 16 Dec 2025</h2>
<p>No user facing changes.</p>
<h2>4.31.8 - 11 Dec 2025</h2>
<ul>
<li>Update default CodeQL bundle version to 2.23.8. <a
href="https://redirect.github.com/github/codeql-action/pull/3354">#3354</a></li>
</ul>
<h2>4.31.7 - 05 Dec 2025</h2>
<ul>
<li>Update default CodeQL bundle version to 2.23.7. <a
href="https://redirect.github.com/github/codeql-action/pull/3343">#3343</a></li>
</ul>
<h2>4.31.6 - 01 Dec 2025</h2>
<p>No user facing changes.</p>
<h2>4.31.5 - 24 Nov 2025</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/github/codeql-action/commit/45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2"><code>45cbd0c</code></a>
Merge pull request <a
href="https://redirect.github.com/github/codeql-action/issues/3461">#3461</a>
from github/update-v4.32.2-7aee93297</li>
<li><a
href="https://github.com/github/codeql-action/commit/cb528be87e3c4226fe0ead29ee5db74127e37ab6"><code>cb528be</code></a>
Update changelog for v4.32.2</li>
<li><a
href="https://github.com/github/codeql-action/commit/7aee93297421a430700f5e81fe681dbc80a0b4f5"><code>7aee932</code></a>
Merge pull request <a
href="https://redirect.github.com/github/codeql-action/issues/3460">#3460</a>
from github/update-bundle/codeql-bundle-v2.24.1</li>
<li><a
href="https://github.com/github/codeql-action/commit/b5f028a984d0af20ea8c4c53f3953cb18bc142c4"><code>b5f028a</code></a>
Merge pull request <a
href="https://redirect.github.com/github/codeql-action/issues/3457">#3457</a>
from github/dependabot/npm_and_yarn/npm-minor-4c1fc3...</li>
<li><a
href="https://github.com/github/codeql-action/commit/9702c27ab946a10a0159e2fe3126cb6605c10c8b"><code>9702c27</code></a>
Merge branch 'main' into
dependabot/npm_and_yarn/npm-minor-4c1fc3d0aa</li>
<li><a
href="https://github.com/github/codeql-action/commit/c36c94846f3257550e884e42a408299a64969407"><code>c36c948</code></a>
Add changelog note</li>
<li><a
href="https://github.com/github/codeql-action/commit/3d0331896c48048637b250518c70ba3138feb437"><code>3d03318</code></a>
Update default bundle to codeql-bundle-v2.24.1</li>
<li><a
href="https://github.com/github/codeql-action/commit/77591e2c4a43bf190ac768983419eb058187e62f"><code>77591e2</code></a>
Merge pull request <a
href="https://redirect.github.com/github/codeql-action/issues/3459">#3459</a>
from github/copilot/fix-github-actions-workflow-again</li>
<li><a
href="https://github.com/github/codeql-action/commit/7a44a9db3f773e2d0f40146c102d01a56721526d"><code>7a44a9d</code></a>
Fix Rebuild Action workflow by adding --no-edit flag to git merge
--continue</li>
<li><a
href="https://github.com/github/codeql-action/commit/e2ac371513fc4422230ee97deafd8392a45d7f0d"><code>e2ac371</code></a>
Initial plan</li>
<li>Additional commits viewable in <a
href="https://github.com/github/codeql-action/compare/b20883b0cd1f46c72ae0ba6d1090936928f9fa30...45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.32.0&new-version=4.32.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [submodules/googletest](https://github.com/google/googletest) from
`56efe39` to `5a9c3f9`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/google/googletest/commit/5a9c3f9e8d9b90bbbe8feb32902146cb8f7c1757"><code>5a9c3f9</code></a>
Upgrade most builds to use Bazel 9.0.0</li>
<li><a
href="https://github.com/google/googletest/commit/32c3dce34bb0d3174a728ff8f9dbb51653b17e1e"><code>32c3dce</code></a>
Display the actual error code when RE::Init() fails</li>
<li><a
href="https://github.com/google/googletest/commit/872d386a87799a9f5ae1a802759b98ac943d2161"><code>872d386</code></a>
Upgrade CI to XCode 26.2</li>
<li><a
href="https://github.com/google/googletest/commit/2151d93c2f1912d84604891459da63de02e465ce"><code>2151d93</code></a>
Update GoogleTest CI to latest tools</li>
<li><a
href="https://github.com/google/googletest/commit/7c3b4d54e3294990d9c3de583fccff97116efb6b"><code>7c3b4d5</code></a>
Automated Code Change</li>
<li>See full diff in <a
href="https://github.com/google/googletest/compare/56efe3983185e3f37e43415d1afa97e3860f187f...5a9c3f9e8d9b90bbbe8feb32902146cb8f7c1757">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [submodules/openssl](https://github.com/openssl/openssl) from
`d82e8d7` to `19bccb9`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/openssl/openssl/commit/19bccb98a408a8ec1a55c4391708a6a77d5cba33"><code>19bccb9</code></a>
Explicitly define <code>SIO_UDP_NETRESET</code> for MinGW builds.</li>
<li><a
href="https://github.com/openssl/openssl/commit/a98b94715544f0b55a71cf27e22633e5faec682a"><code>a98b947</code></a>
Gate use of IPV6_PMTUDISC_PROBE on it being defined</li>
<li><a
href="https://github.com/openssl/openssl/commit/2e876b8b23a768799a9019cd0d8499f6b5447578"><code>2e876b8</code></a>
doc: add return value documentation for EVP_CIPHER_*_params
functions</li>
<li><a
href="https://github.com/openssl/openssl/commit/29cacb75070b4fccc2cd1b4b34ad0108aa574531"><code>29cacb7</code></a>
doc: clarify OSSL_DISPATCH array usage in provider-base</li>
<li><a
href="https://github.com/openssl/openssl/commit/4afa66e03425f1494bda03bdaff6cf6411a7a5c2"><code>4afa66e</code></a>
Fix typo in CHANGES and NEWS entry for CVE-2019-1551</li>
<li><a
href="https://github.com/openssl/openssl/commit/7f58df92a178eaa6836eb77fa03a393b33f5878a"><code>7f58df9</code></a>
check_cert_crl(): Avoid potential UAF when using the value of
current_crl</li>
<li><a
href="https://github.com/openssl/openssl/commit/901f6607cc4946ba0bdd20b17ce69fdffd17a111"><code>901f660</code></a>
BIO_get_data.pod: Warn about use outside of a custom BIO
implementation</li>
<li><a
href="https://github.com/openssl/openssl/commit/40735fea9397c50119764e1dcd4cc1184ff591d5"><code>40735fe</code></a>
aes-gcm-ppc.pl: Removed .localentry directive</li>
<li>See full diff in <a
href="https://github.com/openssl/openssl/compare/d82e8d7dd2af10398b447a743a8857cbbce4d9d0...19bccb98a408a8ec1a55c4391708a6a77d5cba33">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… test (#5783)

## Description

The only think I can think of triggering test instability is something
strange happening with bitflags of `bool` type.
Move to bools, there is no reason to keep bitflags here

By moving everything to bools and solving runtime errors, I found some
members were not properly initialized. This + bitfields might have
caused undefined behavior. I moved initializations to the declaration
point, where it is easy to spot missing ones.

Fixes #5752

## Testing

C/I

## Documentation

N/A
Co-authored-by: Guillaume Hetier <guhetier@microsoft.com>
@guhetier guhetier merged commit 72c4d31 into main Feb 20, 2026
524 checks passed
@guhetier guhetier deleted the saikat/cross-platform-coverage branch February 20, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants