Skip to content

test: add test coverage - #6

Merged
jerrysxie merged 3 commits into
OpenDevicePartnership:mainfrom
jerrysxie:add-unit-tests
Aug 20, 2026
Merged

test: add test coverage#6
jerrysxie merged 3 commits into
OpenDevicePartnership:mainfrom
jerrysxie:add-unit-tests

Conversation

@jerrysxie

@jerrysxie jerrysxie commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Add unit test coverage

Test report with grcov:

file coverage covered missed_lines
src/assignment.rs 99.12% 225 / 227 32, 81
src/config.rs 28.01% 128 / 457 12-14, 96-125, 132, 134-135, 141-229, 307-636
src/deps.rs 8.17% 17 / 208 66-122, 143-157, 163-360
src/file_error.rs 0.00% 0 / 12 26-38
src/generation.rs 97.24% 211 / 217 83, 101, 104, 110, 133, 156
src/init.rs 0.00% 0 / 290 38-463
src/lib.rs 0.00% 0 / 379 115-600
src/main.rs 0.00% 0 / 238 82-584
src/mangling.rs 25.35% 18 / 71 38-99
src/validation.rs 21.58% 101 / 468 92-142, 156-167, 173-281, 296, 307, 318, 348-351, 355-369, 377-738

Total coverage: 27.27%

Add inline coverage for byte-unit parsing, memory range validation,
duplicate priorities, and Rust symbol mangling prefix detection.

The existing cargo test --locked CI jobs discover these tests on Linux
and Windows.

Assisted-by: GitHub Copilot:gpt-5.3-codex
@jerrysxie jerrysxie self-assigned this Aug 20, 2026
Update expectations for the case-insensitive unit suffix parsing added
on latest main. Cover lowercase K, M, and G suffixes as valid input.

Assisted-by: GitHub Copilot:gpt-5.3-codex
Cover assignment priorities, linker script generation, and symbol
classification behavior. Add a test-only dependency-tree constructor
for focused fixtures.

Assisted-by: GitHub Copilot
@jerrysxie jerrysxie changed the title test: add config and mangling coverage test: add test coverage Aug 20, 2026
@jerrysxie
jerrysxie marked this pull request as ready for review August 20, 2026 19:49
@jerrysxie
jerrysxie requested a review from a team as a code owner August 20, 2026 19:49

@felipebalbi felipebalbi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Really good, I suggest adding proptest s a dev-dep and letting it generate random examples.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR increases unit test coverage across CratePlace’s core logic (validation/mangling detection, linker-script generation, config parsing/validation, and dependency assignment) and adds a small test-only constructor to simplify building DepTree fixtures.

Changes:

  • Add new unit tests for crate-name extraction and symbol classification in validation.
  • Add unit tests for mangling prefix detection and linker-script generation output/patterns.
  • Add unit tests for ByteUnit parsing and config-range validation, plus assignment behavior tests.
  • Introduce DepTree::from_crates behind #[cfg(test)] to construct DepTree in unit tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/validation.rs Adds unit tests for crate-name extraction and Rust symbol classification edge cases.
src/mangling.rs Adds unit tests for recognizing/rejecting mangling prefixes.
src/generation.rs Adds unit tests for section name normalization, mangling match generation, and script output content.
src/deps.rs Adds a #[cfg(test)] helper constructor used by unit tests to build DepTree fixtures.
src/config.rs Adds unit tests for ByteUnit parsing and config validation behaviors (overlap, overflow, priorities).
src/assignment.rs Adds unit tests covering error cases and assignment/defaulting behavior across dependency graphs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jerrysxie
jerrysxie merged commit 2d1d9a5 into OpenDevicePartnership:main Aug 20, 2026
9 checks passed
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.

5 participants