Add code coverage#220
Merged
Merged
Conversation
Code Coverage OverviewLanguages: Swift Swift / code-coverage/llvm-covThe overall coverage in the branch is 88%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds code coverage measurement, reporting, and CI enforcement — and, along the way, raises coverage from a 70.68% baseline to 88.35%, fixes several source bugs the new tests uncovered, and makes the unit tests actually run on more platforms in CI.
Coverage tooling
Scripts/coverage.shruns the suite with coverage, exports LCOV (coverage.lcov) and Cobertura (coverage.xml) reports scoped to this package's own sources underSources/(dependencies and tests excluded), and fails if line coverage drops below the threshold.Code CoverageGitHub Actions job runs the script on macOS, uploads the Cobertura report to GitHub Code Quality for per-PR display, and archives both reports.COVERAGE_PLAN.mddocuments the phased path toward 95%.New tests (70.68% → 88.35%)
GATTDatabasevalue-type API, and end-to-endGATTClient⇄GATTServerprocedures (reads, long reads, read-by-type, short/long/no-response writes, error responses) over the in-memory L2CAP transport.Source bug fixes (found by the new tests)
HCIReadLMPHandleReturnvalidated against the wrong length and misordered its fields — could never decode through the HCI transport.HCILEGenerateDHKeyencoded 65 bytes instead of 64 (duplicated two bytes, dropped one).HCILEReadLocalResolvableAddressReturn/HCILEReadPeerResolvableAddressReturnread 8 bytes from a 6-byte payload — trapped out-of-bounds on any valid response.HCILETransmitterTestomitted theLength_Of_Test_Databyte.GATTDatabase.add(service:)never recorded included-service handles, tripping an assertion (a debug-build trap) for any service with included services.Deduplication
Hexadecimal,Integer,System,String, andBoolextensions were copiedinternalinto every target. Consolidated onepackage-access copy each into the coreBluetoothtarget and removed 12 duplicate files (~1,200 lines).CI: run the unit tests on more platforms
swift test(previously build-only).Note: the new Android/Windows CI jobs and the coverage-upload step could not be exercised locally; the local suite (macOS) is green at 88.35%.