Skip to content

Add RequiresMSBuildVersion test attribute - #11700

Merged
dsplaisted merged 3 commits into
dotnet:masterfrom
sfoslund:MSbuildTesting
May 27, 2020
Merged

dsplaisted merged 3 commits into
dotnet:masterfrom
sfoslund:MSbuildTesting

Conversation

@sfoslund

@sfoslund sfoslund commented May 19, 2020 •

Copy link
Copy Markdown
Member

Fixes #11369

@sfoslund
sfoslund requested a review from dsplaisted May 20, 2020 15:09
{
public RequiresMSBuildVersionFactAttribute(string version)
{
if (!Version.TryParse(TestContext.Current.ToolsetUnderTest.MSBuildVersion, out Version msbuildVersion))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think these attributes should never skip if running on .NET Core (if we don't have the required MSBuild version in the .NET SDK, then we wouldn't be writing the test at all). If running on full framework, then we need to shell out to msbuild instead of dotnet msbuild to get the full framework MSBuild version. Also, make sure that we handle 3 versus 4 part version numbers correctly (where the required version is 3 parts and the msbuild version is 4 parts).

@dsplaisted
dsplaisted merged commit f46d35e into dotnet:master May 27, 2020
@sfoslund
sfoslund deleted the MSbuildTesting branch May 27, 2020 21:48
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.

Better handle tests which require new MSBuild features

2 participants