thomhurst / TUnit

A modern, fast and flexible .NET testing framework
MIT License
2.4k stars 38 forks source link

Backport.System.Threading.Lock implementation. #1234

Closed MarkCiliaVincenti closed 5 days ago

MarkCiliaVincenti commented 5 days ago

For some reason I couldn't build this project on my machine, not even the main branch; loads of analyzer errors, so please ensure the changes are applied well.

MarkCiliaVincenti commented 5 days ago

I also changed LangVersion from preview to latest. You may or may want to revert this; if you added it for the System.Threading.Lock functionality, it's not needed anymore since .NET 9.0 was released.

thomhurst commented 5 days ago

Doesn't compile unfortunately:

error CS0052: Inconsistent accessibility: field type 'Lock' is less accessible than field 'TestContext.Lock' [/home/runner/work/TUnit/TUnit/TUnit.Core/TUnit.Core.csproj::TargetFramework=net8.0]

MarkCiliaVincenti commented 5 days ago

Try now please @thomhurst?

thomhurst commented 5 days ago

We're now changing the API and making the lock non-public

MarkCiliaVincenti commented 5 days ago

OK in this case I'll revert this particular lock then.

MarkCiliaVincenti commented 5 days ago

Reverted that part @thomhurst

MarkCiliaVincenti commented 5 days ago

I reverted back the LangVersion to preview.

MarkCiliaVincenti commented 5 days ago

Oops, missed a few LangVersion reverts.

thomhurst commented 5 days ago

Looks like you're actually changing most latest lang versions to preview now

MarkCiliaVincenti commented 5 days ago

Looks like you're actually changing most latest lang versions to preview now

Yes I missed a few. You could move them to latest but you'd need to fix the pipelines so they compile with the latest SDK of .NET 9.0

MarkCiliaVincenti commented 5 days ago

All OK now?

MarkCiliaVincenti commented 5 days ago

@thomhurst not quite sure what this error relates to now, but likely unrelated to this PR.

thomhurst commented 5 days ago

Thanks @MarkCiliaVincenti !