Skip to content

feat(generators): wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline (#123 slice 2)#166

Merged
cwinland merged 2 commits intofeature/123-full-test-generation-slice-1from
feature/123-settings-bridge-slice-2
May 6, 2026
Merged

feat(generators): wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline (#123 slice 2)#166
cwinland merged 2 commits intofeature/123-full-test-generation-slice-1from
feature/123-settings-bridge-slice-2

Conversation

@cwinland
Copy link
Copy Markdown
Owner

@cwinland cwinland commented May 6, 2026

Summary

Wires the FastMoqGeneratedTestFramework MSBuild → analyzer-config-options bridge into the Roslyn incremental generator pipeline.

Changes

  • Declares CompilerVisibleProperty for FastMoqGeneratedTestFramework in the generator csproj
  • Reads build_property.FastMoqGeneratedTestFramework via AnalyzerConfigOptionsProvider.GlobalOptions in Initialize(); combines the setting with the targets pipeline using Combine(); passes the setting string to EmitSource/AppendGeneratedXUnitSmokeTests
  • When the value equals none (case-insensitive), xUnit smoke-test emission is suppressed unconditionally, regardless of whether the xUnit metadata is present
  • Adds TestAnalyzerConfigOptionsProvider + TestAnalyzerConfigOptions nested helpers for generator-test isolation
  • Adds 3 new [Fact] tests: suppression with none, explicit enable with xunit, and case-insensitive None

Stacked on

This PR is stacked on #165 (feature/123-full-test-generation-slice-1). Merge that first.

Related

Part of #123.

…peline

- Add CompilerVisibleProperty for FastMoqGeneratedTestFramework to generator csproj
- Read build_property.FastMoqGeneratedTestFramework in incremental pipeline via AnalyzerConfigOptionsProvider
- Combine frameworkSetting with targets pipeline; pass to EmitSource
- When value is 'none' (case-insensitive), suppress xUnit smoke-test emission regardless of metadata
- Add TestAnalyzerConfigOptionsProvider / TestAnalyzerConfigOptions nested helpers for test isolation
- Add 3 new [Fact] tests covering none suppression, explicit xunit enable, and case-insensitive none

Part of #123
…ngs-bridge-slice-2

Resolve conflict in test file by:
- Keeping settings-bridge tests (framework property gating)
- Adding keyword escaping test from slice 1 (addresses code review on GeneratedHarnessSourceGenerator.cs)
- Combining both test suites into comprehensive validation
@cwinland cwinland merged commit 13a3f3a into feature/123-full-test-generation-slice-1 May 6, 2026
cwinland added a commit that referenced this pull request May 6, 2026
* Widen generated harness smoke test coverage

* Fix: Escape C# keywords in generated method invocations

When component methods are named with C# keywords (e.g., @Class, @return),
the unescaped IMethodSymbol.Name resulted in invalid emitted code like
'component.class()' instead of 'component.@Class()'.

- Add EscapeIdentifierIfKeyword helper using SyntaxFacts.GetKeywordKind
- Apply escaping in CreateGeneratedTestMethodModel to all method references
- Add [Fact] test covering keyword methods (@Class, @interface, @return)

Addresses code review comment on GeneratedHarnessSourceGenerator.cs

* feat(generators): wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline (#123 slice 2) (#166)

Wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline

- Add CompilerVisibleProperty for FastMoqGeneratedTestFramework to generator csproj
- Read build_property.FastMoqGeneratedTestFramework in incremental pipeline via AnalyzerConfigOptionsProvider
- Combine frameworkSetting with targets pipeline; pass to EmitSource
- When value is 'none' (case-insensitive), suppress xUnit smoke-test emission regardless of metadata
- Add TestAnalyzerConfigOptionsProvider / TestAnalyzerConfigOptions nested helpers for test isolation
- Add 3 new [Fact] tests covering none suppression, explicit xunit enable, and case-insensitive none

Part of #123
cwinland added a commit that referenced this pull request May 6, 2026
* Expand generated scenario scaffold executors

* Add generated shared setup scaffold hooks

* Strengthen generated shared setup hook ordering test

* Document generated scenario scaffold members

* docs: align generator roadmap with current scope

* Widen generated harness smoke test coverage (#165)

* Widen generated harness smoke test coverage

* Fix: Escape C# keywords in generated method invocations

When component methods are named with C# keywords (e.g., @Class, @return),
the unescaped IMethodSymbol.Name resulted in invalid emitted code like
'component.class()' instead of 'component.@Class()'.

- Add EscapeIdentifierIfKeyword helper using SyntaxFacts.GetKeywordKind
- Apply escaping in CreateGeneratedTestMethodModel to all method references
- Add [Fact] test covering keyword methods (@Class, @interface, @return)

Addresses code review comment on GeneratedHarnessSourceGenerator.cs

* feat(generators): wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline (#123 slice 2) (#166)

Wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline

- Add CompilerVisibleProperty for FastMoqGeneratedTestFramework to generator csproj
- Read build_property.FastMoqGeneratedTestFramework in incremental pipeline via AnalyzerConfigOptionsProvider
- Combine frameworkSetting with targets pipeline; pass to EmitSource
- When value is 'none' (case-insensitive), suppress xUnit smoke-test emission regardless of metadata
- Add TestAnalyzerConfigOptionsProvider / TestAnalyzerConfigOptions nested helpers for test isolation
- Add 3 new [Fact] tests covering none suppression, explicit xunit enable, and case-insensitive none

Part of #123
cwinland added a commit that referenced this pull request May 6, 2026
* Document generated-test settings design for #162

* Fix generated harness parameterless constructor selection

* Define #126 scenario scaffolding contract

* Document #134 helper-family narrowing matrix

* Align generator project GUID across solutions

* Add generated shared setup scenario scaffold hooks (#164)

* Expand generated scenario scaffold executors

* Add generated shared setup scaffold hooks

* Strengthen generated shared setup hook ordering test

* Document generated scenario scaffold members

* docs: align generator roadmap with current scope

* Widen generated harness smoke test coverage (#165)

* Widen generated harness smoke test coverage

* Fix: Escape C# keywords in generated method invocations

When component methods are named with C# keywords (e.g., @Class, @return),
the unescaped IMethodSymbol.Name resulted in invalid emitted code like
'component.class()' instead of 'component.@Class()'.

- Add EscapeIdentifierIfKeyword helper using SyntaxFacts.GetKeywordKind
- Apply escaping in CreateGeneratedTestMethodModel to all method references
- Add [Fact] test covering keyword methods (@Class, @interface, @return)

Addresses code review comment on GeneratedHarnessSourceGenerator.cs

* feat(generators): wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline (#123 slice 2) (#166)

Wire FastMoqGeneratedTestFramework MSBuild property into generator pipeline

- Add CompilerVisibleProperty for FastMoqGeneratedTestFramework to generator csproj
- Read build_property.FastMoqGeneratedTestFramework in incremental pipeline via AnalyzerConfigOptionsProvider
- Combine frameworkSetting with targets pipeline; pass to EmitSource
- When value is 'none' (case-insensitive), suppress xUnit smoke-test emission regardless of metadata
- Add TestAnalyzerConfigOptionsProvider / TestAnalyzerConfigOptions nested helpers for test isolation
- Add 3 new [Fact] tests covering none suppression, explicit xunit enable, and case-insensitive none

Part of #123
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.

1 participant