Fix netfx test runs (dotnet/corefx#36082)
authorSantiago Fernandez Madero <safern@microsoft.com>
Tue, 19 Mar 2019 02:31:07 +0000 (19:31 -0700)
committerGitHub <noreply@github.com>
Tue, 19 Mar 2019 02:31:07 +0000 (19:31 -0700)
* Fix netfx test SDK tfm for new package version

* Add validation that we actually found assets in package to catch this early

* PR Feedback

Commit migrated from https://github.com/dotnet/corefx/commit/6e9561fb169b372ac0ecc5f85655f4d8800d1238

src/libraries/external/test-runtime/XUnit.Runtime.depproj

index e08e3fe..747461e 100644 (file)
           BeforeTargets="ResolveReferences">
 
     <PropertyGroup>
-      <TestSdkTFM Condition="'$(TargetsNetFx)' == 'true'">net45</TestSdkTFM>
+      <TestSdkTFM Condition="'$(TargetsNetFx)' == 'true'">net40</TestSdkTFM>
       <TestSdkTFM Condition="'$(TargetsUap)' == 'true'">uap10.0</TestSdkTFM>
       <TestSdkTFM Condition="'$(TestSdkTFM)' == ''">netcoreapp1.0</TestSdkTFM>
     </PropertyGroup>
 
     <ItemGroup>
-      <ReferenceCopyLocalPaths Include="$(PackagesDir)$(MicrosoftNetTestSdkPackageName)\$(MicrosoftNETTestSdkPackageVersion)\build\$(TestSdkTFM)\*.*">
+      <_microsoftNetTestSdkAssets Include="$(PackagesDir)$(MicrosoftNetTestSdkPackageName)\$(MicrosoftNETTestSdkPackageVersion)\build\$(TestSdkTFM)\*.*" />
+      <ReferenceCopyLocalPaths Include="@(_microsoftNetTestSdkAssets)">
         <Private>false</Private>
         <NuGetPackageId>$(MicrosoftNetTestSdkPackageName)</NuGetPackageId>
         <NuGetPackageVersion>$(MicrosoftNETTestSdkPackageVersion)</NuGetPackageVersion>
       </ReferenceCopyLocalPaths>
     </ItemGroup>
 
+    <Error Condition="'@(_microsoftNetTestSdkAssets)' != ''"
+           Text="Error: no assets for test sdk package where found under: $(PackagesDir)$(MicrosoftNetTestSdkPackageName)\$(MicrosoftNETTestSdkPackageVersion)\build\$(TestSdkTFM)\*.*" />
+
   </Target>
 
   <Target Name="AddTestPlatformDependenciesNetCore"