Skip to content

Add xUnit test infrastructure and deterministic T01–T08 coverage while preserving IL harness behavior - #1

Draft
marcialwushu with Copilot wants to merge 2 commits into
mainfrom
copilot/t03b-criar-testes-unitarios-com-xunit
Draft

marcialwushu with Copilot wants to merge 2 commits into
mainfrom
copilot/t03b-criar-testes-unitarios-com-xunit

Conversation

Copilot AI commented Sep 14, 2026 •

Copy link
Copy Markdown

This PR introduces xUnit-based unit test infrastructure across the core test projects and adds deterministic coverage for the contracts/components delivered in T01–T08. It keeps the existing IL fixture harness as the integration validation path, ensuring static inspection does not execute fixture methods.

  • Test infrastructure (xUnit + discoverability)

    • Added Microsoft.NET.Test.Sdk, xunit, xunit.runner.visualstudio, and coverlet.collector to:
      • ClrLens.Tests.Unit
      • ClrLens.Tests.IL
      • ClrLens.Tests.Optimization
      • ClrLens.Tests.Regression
    • Marked these as test projects for dotnet test discovery.
    • Kept ClrLens.Tests.Benchmarks separate from unit-test runner setup.
  • Unit test suite for T01–T08 (deterministic / order-independent)

    • Added focused test files under tests/ClrLens.Tests.Unit for:
      • solution/module boundaries (T01),
      • domain contracts + validation + serialization (T02),
      • IR modeling and CIL→IR mapping (T06),
      • CFG/dominance/loops (T07),
      • call graph + unknown effects (T08).
    • Covers positive and negative paths, including localized diagnostic message expectations for contract/stack/branch/CFG/call-graph failure modes.
  • IL and fixture-focused tests

    • Added tests/ClrLens.Tests.IL/* for fixture manifest, assembly ingestion (valid/invalid), CIL decode, stack validation, and exception regions (T03–T05).
    • Added reusable test support helpers for fixture metadata decoding and deterministic path/root resolution.
  • Harness preservation and integration alignment

    • Refactored tests/ClrLens.Tests.IL/Program.cs into reusable harness logic (FixtureHarness.RunAsync) and wrapped it with xUnit integration coverage.
    • Explicitly verifies harness-only static analysis flow (no fixture method invocation side effects).
  • Regression scaffolding for report compatibility

    • Added FixtureRegressionTests and ReportCompatibilityTests in ClrLens.Tests.Regression to lock schema/serialization/validation behavior and support future optimization-phase test expansion (T16–T18).
<ItemGroup>
  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
  <PackageReference Include="xunit" Version="2.9.2" />
  <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="all" />
  <PackageReference Include="coverlet.collector" Version="6.0.2" PrivateAssets="all" />
</ItemGroup>

Co-authored-by: marcialwushu <16365313+marcialwushu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add xUnit test coverage for components and contracts Add xUnit test infrastructure and deterministic T01–T08 coverage while preserving IL harness behavior Sep 14, 2026
Copilot AI requested a review from marcialwushu September 14, 2026 03:12
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