Build/Test Issues

SourceGenerator

Started by Dirk Maegh on 1,681 views

Hi,

I am working on a source generator now.
Is there a way to get NCrunch to work on this one please ?

https://github.com/dotnet/roslyn-sdk/tree/0abb5881b483493b198315c83b4679b6a13a4545/samples/CSharp/SourceGenerators

I made a copy of these projects, upgraded to dotnet5 and made that work.
Then I added a source generator to the project SourceGeneratorSamples.

I added a unit test project (xunit) to test my new source generator.
In my test project, I will create a GenerationContext via invoking the internal constructor etc.
So I could create a ISourceGenerator and test it. There's no problem in that. NCrunch runs those without issue.

So these tests run, but the generated project (the one that uses the generated code - in the url, that would be the GeneratedDemo) does not compile with ncrunch.
If I wanted to write a test for classes in this GeneratedDemo project, I would not be able to execute them with ncrunch. (and that will be my next focus, I guess, like in a week or two)

Thx,
Dirk

Edited

Hi Dirk,

Last month we did an assessment of the Roslyn based source generators to see if we could find a way to support them (see here).

Unfortunately, the platform is not yet ready for us to integrate with. We will re-assess when it is closer to RTM.

Post a reply

Log in to reply.