|
58 | 58 | <NetStandardDriver Include="**/netcore/ref/Microsoft.Data.SqlClient*.csproj" />
|
59 | 59 | <AKVProvider Include="**/add-ons/**/AzureKeyVaultProvider/*.csproj" />
|
60 | 60 |
|
| 61 | + <UnitTests Include="**/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" /> |
| 62 | + <UnitTestsProj Include="**/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" /> |
| 63 | + |
61 | 64 | <FunctionalTests Include="**/Common/Common.csproj" />
|
62 | 65 | <FunctionalTests Include="**/tools/TDS/TDS/TDS.csproj" />
|
63 | 66 | <FunctionalTests Include="**/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
|
64 | 67 | <FunctionalTests Include="**/tools/TDS/TDS.Servers/TDS.Servers.csproj" />
|
65 | 68 | <FunctionalTests Include="**/tools/Microsoft.Data.SqlClient.TestUtilities/Microsoft.Data.SqlClient.TestUtilities.csproj" />
|
66 | 69 | <FunctionalTests Include="**/tools/CoreFx.Private.TestUtilities/CoreFx.Private.TestUtilities.csproj" />
|
67 | 70 | <FunctionalTests Include="**/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" />
|
68 |
| - <FunctionalTests Include="**/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj" /> |
69 |
| - <FunctionalTestsProj Include="**/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj" /> |
70 |
| - |
| 71 | + <FunctionalTests Include="**/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj" /> |
| 72 | + <FunctionalTestsProj Include="**/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj" /> |
| 73 | + |
71 | 74 | <ManualTests Include="**/Common/Common.csproj" />
|
72 | 75 | <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj" />
|
73 | 76 | <ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj" />
|
|
84 | 87 | <Target Name="Restore" DependsOnTargets="RestoreSqlServerLib;RestoreNetCore;RestoreNetFx" />
|
85 | 88 | <Target Name="BuildAll" DependsOnTargets="BuildSqlServerLib;BuildNetFx;BuildNetCore;BuildNetStandard" />
|
86 | 89 | <Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;GenerateNugetPackage" />
|
87 |
| - <Target Name="BuildSqlServerPackage" DependsOnTargets="BuildSqlServerLibAnyOS;GenerateSqlServerPackage" /> |
88 |
| - <Target Name="BuildTestsNetCore" DependsOnTargets="RestoreTestsNetCore;BuildAKVNetCore;BuildFunctionalTestsNetCore;BuildManualTestsNetCore" /> |
89 |
| - <Target Name="BuildTestsNetFx" DependsOnTargets="RestoreTestsNetFx;BuildAKVNetFx;BuildFunctionalTestsNetFx;BuildManualTestsNetFx" Condition="$(IsEnabledWindows) == 'true'" /> |
90 |
| - <Target Name="BuildTests" DependsOnTargets="BuildTestsNetCore;BuildTestsNetFx" /> |
| 90 | + <Target Name="BuildSqlServerPackage" DependsOnTargets="BuildSqlServerLibAnyOS;GenerateSqlServerPackage"/> |
| 91 | + <Target Name="BuildTestsNetCore" DependsOnTargets="RestoreTestsNetCore;BuildAKVNetCore;BuildUnitTestsNetCore;BuildFunctionalTestsNetCore;BuildManualTestsNetCore"/> |
| 92 | + <Target Name="BuildTestsNetFx" DependsOnTargets="RestoreTestsNetFx;BuildAKVNetFx;BuildUnitTestsNetFx;BuildFunctionalTestsNetFx;BuildManualTestsNetFx" Condition="$(IsEnabledWindows) == 'true'"/> |
| 93 | + <Target Name="BuildTests" DependsOnTargets="BuildTestsNetCore;BuildTestsNetFx"/> |
91 | 94 |
|
92 | 95 | <Target Name="RestoreSqlServerLib">
|
93 | 96 | <MSBuild Projects="@(SqlServerLib)" Targets="restore" />
|
|
100 | 103 | <Target Name="RestoreTestsNetCore">
|
101 | 104 | <MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" />
|
102 | 105 | <MSBuild Projects="@(FunctionalTests)" Targets="restore" Properties="$(TestProjectProperties)" />
|
| 106 | + <MSBuild Projects="@(UnitTests)" Targets="restore" Properties="$(TestProjectProperties)"/> |
103 | 107 | </Target>
|
104 | 108 |
|
105 | 109 | <Target Name="RestoreNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
|
|
109 | 113 | <Target Name="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
|
110 | 114 | <MSBuild Projects="@(ManualTests)" Targets="restore" Properties="$(TestProjectProperties)" />
|
111 | 115 | <MSBuild Projects="@(FunctionalTests)" Targets="restore" Properties="$(TestProjectProperties)" />
|
| 116 | + <MSBuild Projects="@(UnitTests)" Targets="restore" Properties="$(TestProjectProperties)"/> |
112 | 117 | </Target>
|
113 | 118 |
|
114 | 119 | <Target Name="BuildTools" Condition="'$(BuildTools)' == 'true'">
|
|
144 | 149 | <MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
|
145 | 150 | <MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
|
146 | 151 | </Target>
|
147 |
| - |
148 | 152 | <!-- Build .NET Standard target DLLs for Lib folder from here.
|
149 | 153 | This target enables BuildForLib for the NetCore ref project. -->
|
150 | 154 | <Target Name="BuildNetStandard">
|
151 | 155 | <MSBuild Projects="@(NetStandardDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;BuildForLib=True" RemoveProperties="TargetsWindows;TargetsUnix;" />
|
152 | 156 | </Target>
|
153 | 157 |
|
| 158 | + <Target Name="BuildUnitTestsNetCore" DependsOnTargets="RestoreTestsNetCore" Condition="$(ReferenceType.Contains('Project'))"> |
| 159 | + <Message Text=">>> Building UnitTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))"/> |
| 160 | + <MSBuild Projects="@(UnitTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" /> |
| 161 | + </Target> |
| 162 | + |
154 | 163 | <Target Name="BuildFunctionalTestsNetCore" DependsOnTargets="RestoreTestsNetCore">
|
155 | 164 | <Message Text=">>> Building FunctionalTestsNetCore [TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;ReferenceType=$(ReferenceType);] ..." Condition="!$(ReferenceType.Contains('Package'))" />
|
156 | 165 | <MSBuild Projects="@(FunctionalTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
|
|
169 | 178 | <MSBuild Projects="@(ManualTests)" Properties="TestTargetOS=$(TestOS)netcoreapp;$(TestProjectProperties);Platform=$(Platform);" Condition="$(ReferenceType.Contains('Package'))" />
|
170 | 179 | </Target>
|
171 | 180 |
|
| 181 | + <Target Name="BuildUnitTestsNetFx" DependsOnTargets="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true' AND $(ReferenceType.Contains('Project'))"> |
| 182 | + <Message Text=">>> Building UnitTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;] ..." Condition="!$(ReferenceType.Contains('Package'))"/> |
| 183 | + <MSBuild Projects="@(UnitTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))"/> |
| 184 | + </Target> |
| 185 | + |
172 | 186 | <Target Name="BuildFunctionalTestsNetFx" DependsOnTargets="RestoreTestsNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
|
173 | 187 | <Message Text=">>> Building FunctionalTestsNetFx [TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;] ..." Condition="!$(ReferenceType.Contains('Package'))" />
|
174 | 188 | <MSBuild Projects="@(FunctionalTests)" Properties="TestTargetOS=$(TestOS)netfx;$(TestProjectProperties);Platform=AnyCPU;" Condition="!$(ReferenceType.Contains('Package'))" />
|
|
189 | 203 |
|
190 | 204 | <!-- Tests -->
|
191 | 205 |
|
| 206 | + <!-- Run all tests applicable to the host OS. --> |
| 207 | + <Target Name="RunTests" DependsOnTargets="RunUnitTests;RunFunctionalTests;RunManualTests"/> |
| 208 | + |
192 | 209 | <!-- Run all unit tests applicable to the host OS. -->
|
193 |
| - <Target Name="RunTests" DependsOnTargets="RunFunctionalTests;RunManualTests" /> |
| 210 | + <Target Name="RunUnitTests" DependsOnTargets="RunUnitTestsWindows;RunUnitTestsUnix" Condition="$(ReferenceType.Contains('Project'))"/> |
| 211 | + |
| 212 | + <!-- Run all unit tests applicable to Windows. --> |
| 213 | + <Target Name="RunUnitTestsWindows" Condition="'$(IsEnabledWindows)' == 'true' AND $(ReferenceType.Contains('Project'))"> |
| 214 | + <PropertyGroup> |
| 215 | + <TestCommand> |
| 216 | + $(DotnetPath)dotnet test "@(UnitTestsProj)" |
| 217 | + --no-build |
| 218 | + -v n |
| 219 | + -p:Configuration=$(Configuration) |
| 220 | + -p:Target$(TFGroup)Version=$(TF) |
| 221 | + -p:TestTargetOS=Windows$(TargetGroup) |
| 222 | + --collect "Code coverage" |
| 223 | + --results-directory $(ResultsDirectory) |
| 224 | + --logger:"trx;LogFilePrefix=Unit-Windows$(TargetGroup)-$(TestSet)" |
| 225 | + </TestCommand> |
| 226 | + <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 227 | + </PropertyGroup> |
| 228 | + <Message Text=">>> Running unit tests for Windows via command: $(TestCommand)"/> |
| 229 | + <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/> |
| 230 | + </Target> |
| 231 | + |
| 232 | + <!-- Run all unit tests applicable to Unix. --> |
| 233 | + <Target Name="RunUnitTestsUnix" Condition="'$(IsEnabledWindows)' != 'true' AND $(ReferenceType.Contains('Project'))"> |
| 234 | + <PropertyGroup> |
| 235 | + <TestCommand> |
| 236 | + $(DotnetPath)dotnet test "@(UnitTestsProj)" |
| 237 | + --no-build |
| 238 | + -v n |
| 239 | + -p:Configuration=$(Configuration) |
| 240 | + -p:TargetNetCoreVersion=$(TF) |
| 241 | + -p:TestTargetOS=Unixnetcoreapp |
| 242 | + --collect "Code coverage" |
| 243 | + --results-directory $(ResultsDirectory) |
| 244 | + --logger:"trx;LogFilePrefix=Unit-Unixnetcoreapp-$(TestSet)" |
| 245 | + </TestCommand> |
| 246 | + <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 247 | + </PropertyGroup> |
| 248 | + <Message Text=">>> Running unit tests for Unix via command: $(TestCommand)"/> |
| 249 | + <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/> |
| 250 | + </Target> |
194 | 251 |
|
195 | 252 | <!-- Run all Functional tests applicable to the host OS. -->
|
196 | 253 | <Target Name="RunFunctionalTests" DependsOnTargets="RunFunctionalTestsWindows;RunFunctionalTestsUnix" />
|
|
0 commit comments