Skip to content

Commit 4972c6d

Browse files
TestFramework: Create empty projects (#8565)
1 parent 7f91a13 commit 4972c6d

File tree

10 files changed

+1462
-7
lines changed

10 files changed

+1462
-7
lines changed

analyzers/SonarAnalyzer.sln

+16-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common Solution Items", "Co
88
src\AssemblyInfo.Shared.cs = src\AssemblyInfo.Shared.cs
99
..\azure-pipelines.yml = ..\azure-pipelines.yml
1010
NuGet.Config = NuGet.Config
11+
..\README.md = ..\README.md
1112
src\Signing.cs = src\Signing.cs
1213
packaging\SonarAnalyzer.CSharp.nuspec = packaging\SonarAnalyzer.CSharp.nuspec
1314
packaging\SonarAnalyzer.VisualBasic.nuspec = packaging\SonarAnalyzer.VisualBasic.nuspec
14-
..\README.md = ..\README.md
1515
EndProjectSection
1616
EndProject
1717
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B7233F78-E142-4882-B084-7C83BE472109}"
@@ -58,7 +58,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AnalysisConfig", "AnalysisC
5858
EndProject
5959
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonarAnalyzer.SourceGenerators", "src\SonarAnalyzer.SourceGenerators\SonarAnalyzer.SourceGenerators.csproj", "{76D6EBB8-D2B0-41C1-8880-027EC78CB7FF}"
6060
EndProject
61-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SonarAnalyzer.Net8.Test", "tests\SonarAnalyzer.Net8.Test\SonarAnalyzer.Net8.Test.csproj", "{DB0A158B-D003-47ED-8209-E70277EB0693}"
61+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonarAnalyzer.Net8.Test", "tests\SonarAnalyzer.Net8.Test\SonarAnalyzer.Net8.Test.csproj", "{DB0A158B-D003-47ED-8209-E70277EB0693}"
62+
EndProject
63+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonarAnalyzer.TestFramework.Test", "tests\SonarAnalyzer.TestFramework.Test\SonarAnalyzer.TestFramework.Test.csproj", "{ADBE6CFE-980F-4D4F-8E25-E391581D291E}"
64+
EndProject
65+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonarAnalyzer.TestFramework", "tests\SonarAnalyzer.TestFramework\SonarAnalyzer.TestFramework.csproj", "{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}"
6266
EndProject
6367
Global
6468
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -102,6 +106,14 @@ Global
102106
{DB0A158B-D003-47ED-8209-E70277EB0693}.Debug|Any CPU.Build.0 = Debug|Any CPU
103107
{DB0A158B-D003-47ED-8209-E70277EB0693}.Release|Any CPU.ActiveCfg = Release|Any CPU
104108
{DB0A158B-D003-47ED-8209-E70277EB0693}.Release|Any CPU.Build.0 = Release|Any CPU
109+
{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110+
{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Debug|Any CPU.Build.0 = Debug|Any CPU
111+
{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Release|Any CPU.ActiveCfg = Release|Any CPU
112+
{ADBE6CFE-980F-4D4F-8E25-E391581D291E}.Release|Any CPU.Build.0 = Release|Any CPU
113+
{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
114+
{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
115+
{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
116+
{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8}.Release|Any CPU.Build.0 = Release|Any CPU
105117
EndGlobalSection
106118
GlobalSection(SolutionProperties) = preSolution
107119
HideSolutionNode = FALSE
@@ -115,6 +127,8 @@ Global
115127
{C086048C-D183-4B4D-9D3C-A6E191F19680} = {0C3E0519-DB5C-47C0-ABB3-9D1FB23DFBAF}
116128
{E044950A-098B-4090-B4FB-8D6BD086828B} = {0C3E0519-DB5C-47C0-ABB3-9D1FB23DFBAF}
117129
{DB0A158B-D003-47ED-8209-E70277EB0693} = {B7233F78-E142-4882-B084-7C83BE472109}
130+
{ADBE6CFE-980F-4D4F-8E25-E391581D291E} = {B7233F78-E142-4882-B084-7C83BE472109}
131+
{4C1DB1C4-C1FC-4AA1-B855-0D1948E68FB8} = {B7233F78-E142-4882-B084-7C83BE472109}
118132
EndGlobalSection
119133
GlobalSection(ExtensibilityGlobals) = postSolution
120134
SolutionGuid = {4259CA71-C565-42DD-8D58-F59819A11065}

analyzers/src/SonarAnalyzer.Common/Properties/AssemblyInfo.cs

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@
2929
[assembly: InternalsVisibleTo("SonarAnalyzer.CSharp" + Signing.InternalsVisibleToPublicKey)]
3030
[assembly: InternalsVisibleTo("SonarAnalyzer.VisualBasic" + Signing.InternalsVisibleToPublicKey)]
3131
[assembly: InternalsVisibleTo("SonarAnalyzer.Test" + Signing.InternalsVisibleToPublicKey)]
32+
[assembly: InternalsVisibleTo("SonarAnalyzer.TestFramework" + Signing.InternalsVisibleToPublicKey)]

analyzers/tests/SonarAnalyzer.Net8.Test/packages.lock.json

+16
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,26 @@
478478
"SonarAnalyzer": "[1.0.0, )",
479479
"SonarAnalyzer.CFG": "[1.0.0, )",
480480
"SonarAnalyzer.CSharp": "[1.0.0, )",
481+
"SonarAnalyzer.TestFramework": "[1.0.0, )",
481482
"SonarAnalyzer.VisualBasic": "[1.0.0, )",
482483
"altcover": "[8.6.95, )"
483484
}
484485
},
486+
"sonaranalyzer.testframework": {
487+
"type": "Project",
488+
"dependencies": {
489+
"FluentAssertions": "[6.12.0, )",
490+
"MSTest.TestFramework": "[3.1.1, )",
491+
"Microsoft.Build.Locator": "[1.5.5, )",
492+
"Microsoft.CodeAnalysis.CSharp.Workspaces": "[4.8.0-2.final, )",
493+
"Microsoft.CodeAnalysis.VisualBasic.Workspaces": "[4.8.0-2.final, )",
494+
"Microsoft.CodeAnalysis.Workspaces.Common": "[4.8.0-2.final, )",
495+
"Microsoft.CodeAnalysis.Workspaces.MSBuild": "[4.8.0-2.final, )",
496+
"Moq": "[4.18.4, )",
497+
"NuGet.Protocol": "[6.8.0, )",
498+
"SonarAnalyzer": "[1.0.0, )"
499+
}
500+
},
485501
"sonaranalyzer.visualbasic": {
486502
"type": "Project",
487503
"dependencies": {

analyzers/tests/SonarAnalyzer.Test/SonarAnalyzer.Test.csproj

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<!-- The -windows suffix is needed because SonarAnalyzer.TestFramework references Microsoft.WindowsDesktop.App.WindowsForms framework reference. -->
5+
<TargetFrameworks>net48;net7.0-windows</TargetFrameworks>
46
<IsPackable>false</IsPackable>
57
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
68
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
@@ -13,8 +15,6 @@
1315
- NuGet.Core 2.14.0 (net40-client)
1416
-->
1517
<AssetTargetFallback>$(AssetTargetFallback);net40-client;portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
16-
<ProjectGuid>{e11606ca-a186-4fee-ba30-b1688747cd1a}</ProjectGuid>
17-
<TargetFrameworks>net48;net7.0</TargetFrameworks>
1818
</PropertyGroup>
1919

2020
<ItemGroup Condition="'$(TargetFramework)' != 'net48'">
@@ -61,6 +61,7 @@
6161
</ItemGroup>
6262

6363
<ItemGroup>
64+
<ProjectReference Include="..\SonarAnalyzer.TestFramework\SonarAnalyzer.TestFramework.csproj" />
6465
<ProjectReference Include="..\..\src\SonarAnalyzer.CFG\SonarAnalyzer.CFG.csproj" />
6566
<ProjectReference Include="..\..\src\SonarAnalyzer.Common\SonarAnalyzer.Common.csproj" />
6667
<ProjectReference Include="..\..\src\SonarAnalyzer.CSharp\SonarAnalyzer.CSharp.csproj">

analyzers/tests/SonarAnalyzer.Test/packages.lock.json

+31-1
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,21 @@
436436
"System.Collections.Immutable": "[1.1.37, )"
437437
}
438438
},
439+
"sonaranalyzer.testframework": {
440+
"type": "Project",
441+
"dependencies": {
442+
"FluentAssertions": "[6.12.0, )",
443+
"MSTest.TestFramework": "[3.1.1, )",
444+
"Microsoft.Build.Locator": "[1.5.5, )",
445+
"Microsoft.CodeAnalysis.CSharp.Workspaces": "[4.8.0-2.final, )",
446+
"Microsoft.CodeAnalysis.VisualBasic.Workspaces": "[4.8.0-2.final, )",
447+
"Microsoft.CodeAnalysis.Workspaces.Common": "[4.8.0-2.final, )",
448+
"Microsoft.CodeAnalysis.Workspaces.MSBuild": "[4.8.0-2.final, )",
449+
"Moq": "[4.18.4, )",
450+
"NuGet.Protocol": "[6.8.0, )",
451+
"SonarAnalyzer": "[1.0.0, )"
452+
}
453+
},
439454
"sonaranalyzer.visualbasic": {
440455
"type": "Project",
441456
"dependencies": {
@@ -445,7 +460,7 @@
445460
}
446461
}
447462
},
448-
"net7.0": {
463+
"net7.0-windows7.0": {
449464
"altcover": {
450465
"type": "Direct",
451466
"requested": "[8.6.95, )",
@@ -919,6 +934,21 @@
919934
"System.Collections.Immutable": "[1.1.37, )"
920935
}
921936
},
937+
"sonaranalyzer.testframework": {
938+
"type": "Project",
939+
"dependencies": {
940+
"FluentAssertions": "[6.12.0, )",
941+
"MSTest.TestFramework": "[3.1.1, )",
942+
"Microsoft.Build.Locator": "[1.5.5, )",
943+
"Microsoft.CodeAnalysis.CSharp.Workspaces": "[4.8.0-2.final, )",
944+
"Microsoft.CodeAnalysis.VisualBasic.Workspaces": "[4.8.0-2.final, )",
945+
"Microsoft.CodeAnalysis.Workspaces.Common": "[4.8.0-2.final, )",
946+
"Microsoft.CodeAnalysis.Workspaces.MSBuild": "[4.8.0-2.final, )",
947+
"Moq": "[4.18.4, )",
948+
"NuGet.Protocol": "[6.8.0, )",
949+
"SonarAnalyzer": "[1.0.0, )"
950+
}
951+
},
922952
"sonaranalyzer.visualbasic": {
923953
"type": "Project",
924954
"dependencies": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0-windows</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="altcover" Version="8.6.95" />
9+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
10+
<PackageReference Include="FluentAssertions.Analyzers" Version="0.23.0">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageReference>
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
15+
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
16+
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<ProjectReference Include="..\SonarAnalyzer.TestFramework\SonarAnalyzer.TestFramework.csproj" />
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<Using Include="FluentAssertions" />
25+
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
26+
</ItemGroup>
27+
28+
</Project>

0 commit comments

Comments
 (0)