Fix OOPStackUnwinderX86::Unwind crash when Eip is invalid
[platform/upstream/coreclr.git] / tests / helixperftasks.targets
index 16fe7dd..d578360 100644 (file)
@@ -1,4 +1,43 @@
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+    <UsingTask TaskName="RemoveDuplicateAssemblies" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
+      <ParameterGroup>
+        <DuplicateAssemblies ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
+        <AssemblyPaths ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
+        <UniqueAssemblyPaths ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
+      </ParameterGroup>
+      <Task>
+        <Using Namespace="System"/>
+        <Using Namespace="System.IO"/>
+        <Using Namespace="System.Collections.Generic"/>
+        <Code Type="Fragment" Language="cs">
+          <![CDATA[
+                  var uniqueAssemblyPathsList = new List<Microsoft.Build.Framework.ITaskItem>();
+                  var dupeSet = new HashSet<string>();
+                  foreach(var dupe in DuplicateAssemblies)
+                  {
+                    dupeSet.Add(dupe.GetMetadata("Identity"));
+                  }
+                  foreach(var assemPath in AssemblyPaths)
+                  {
+                    if((dupeSet.Contains(assemPath.GetMetadata("FileName")+assemPath.GetMetadata("Extension")) &&
+                        !(assemPath.GetMetadata("Identity").StartsWith("runtime"))))
+                    {
+                      Log.LogMessage("Duplicate assembly filtered: {0}", assemPath.GetMetadata("Identity"));
+                    }
+                    else
+                    {
+                      uniqueAssemblyPathsList.Add(assemPath);
+                    }
+
+                  }
+                  UniqueAssemblyPaths = uniqueAssemblyPathsList.ToArray();
+          ]]>
+        </Code>
+      </Task>
+    </UsingTask>
+
+
   <UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
   <Import Project="$(ToolsDir)publishtest.targets" />
   <Import Project="$(ToolsDir)CloudTest.targets" />
       <TestBinary Include="$(BinDir)**/*.dll" />
       <TestBinary Include="$(BinDir)**/*.exe" />
     </ItemGroup>
-
     <!-- Get full paths to each of the perf test directories -->
     <GetPerfTestAssemblies TestBinaries="@(TestBinary)" GetFullPaths="true">
       <Output TaskParameter="PerfTestAssemblies" ItemName="CoreCLRPerfTest" />
     </GetPerfTestAssemblies>
 
-    <PropertyGroup>
-      <TestRuntimeDependenciesJson>$(SourceDir)Common\test_runtime\project.json</TestRuntimeDependenciesJson>
-      <TestRuntimeProjectLockJson>$(SourceDir)Common\test_runtime\project.lock.json</TestRuntimeProjectLockJson>
-    </PropertyGroup>
-
     <!-- Restore the runtime dependencies -->
-    <Exec Command="$(DnuRestoreCommand) &quot;$(TestRuntimeDependenciesJson)&quot;"
+    <Exec Command="$(DotnetRestoreCommand) &quot;$(TestRuntimeProjectJson)&quot;"
            StandardOutputImportance="Low"
            CustomErrorRegularExpression="^Unable to resolve .*"
            IgnoreExitCode="true"
 
   </Target>
 
+  <Target Name="RunTestsForProject">
+    <Message Text="This is a dummy target to appease DependsOnTargets for ArchiveTestBuild in publishtest.targets" Importance="Low" />
+  </Target>
+
+  <!-- CoreCLR builds do not generate dependency lists yet, we need to archive the whole packages dir so that tests can find dependencies -->
+  <!-- compress the required files from the packages dir in preparation for uploading -->
+  <Target Name="CompressPackagesDir">
+    <ItemGroup>
+      <ExcludeFromArchive Include="nupkg$" />
+      <ExcludeFromArchive Include="Microsoft.DotNet.BuildTools" />
+      <ExcludeFromArchive Include="TestData" />
+    </ItemGroup>
+    <ZipFileCreateFromDirectory
+        SourceDirectory="$(PackagesDir)"
+        DestinationArchive="$(PackagesArchiveFile)"
+        ExcludePatterns="@(ExcludeFromArchive)"
+        OverwriteDestination="true" />
+    <ItemGroup>
+      <ForUpload Include="$(PackagesArchiveFile)">
+        <RelativeBlobPath>$(Platform)$(ConfigurationGroup)/$(PackagesArchiveFilename)</RelativeBlobPath>
+      </ForUpload>
+    </ItemGroup>
+  </Target>
+
   <Target Name="_zipSingleProject">
     <PropertyGroup>
       <OutDir>$([System.IO.Path]::GetDirectoryName($(CurrPerfAssembly)))/</OutDir>
                                TargetMonikers="@(TestTargetFramework)">
       <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RequiredAssemblies" />
     </PrereleaseResolveNuGetPackageAssets>
+
+
     <ItemGroup>
       <AssemblyPaths Include="$([MSBuild]::MakeRelative($(PackagesDir), %(RequiredAssemblies.FullPath)))" />
+      <AssemblyFiles Include="@(RequiredAssemblies->'%(FileName)%(Extension)')"></AssemblyFiles>
+      <DupeAssemblies Include="%(AssemblyFiles.Identity)" Condition="'@(AssemblyFiles->Count())' &gt; 1"> </DupeAssemblies>
     </ItemGroup>
-    <RemoveDuplicatesWithLastOneWinsPolicy Inputs="@(AssemblyPaths)">
-      <Output TaskParameter="Filtered" ItemName="UniqueAssemblyPaths" />
-    </RemoveDuplicatesWithLastOneWinsPolicy>
-    <PropertyGroup>
-      <_TestCopyLocalByFileNameWithoutDuplicates></_TestCopyLocalByFileNameWithoutDuplicates>
-    </PropertyGroup>
-    <ItemGroup>
-      <UniqueAssemblyPaths Include="$([System.String]::Copy('%(_TestCopyLocalByFileNameWithoutDuplicates.SourcePath)').Replace('$(PackagesDir)',''))" Condition="'%(_TestCopyLocalByFileNameWithoutDuplicates.NugetPackageId)' != ''" />
-    </ItemGroup>
+    <!-- There are duplicate dependency assemblies calculated for some projects that we need to fix, this is check/fix to weed out duplicates -->
+    <RemoveDuplicateAssemblies AssemblyPaths="@(AssemblyPaths)" DuplicateAssemblies="@(DupeAssemblies)">
+      <Output TaskParameter="UniqueAssemblyPaths" ItemName="UniqueAssemblyPaths" />
+    </RemoveDuplicateAssemblies>
+
     <WriteLinesToFile
       File="$(OutDir)/assemblylist.flat.txt"
       Lines="@(UniqueAssemblyPaths)"
      />
 
     <Message Text="Archiving Perf test assemblies for project: $(OutDir)" Importance="High" />
-    <MSBuild Projects="$(MSBuildProjectFile)" Properties="OutDir=$(OutDir);TestArchiveDir=$(TestArchiveDir);TestProjectName=$(TestProjectName);DisableCopyTestToTestDirectory=true" Targets="ArchiveTestBuild"/>
+    <MSBuild Projects="$(MSBuildProjectFile)" Properties="OutDir=$(OutDir);TestArchiveDir=$(TestArchiveDir);TestProjectName=$(TestProjectName)" Targets="ArchiveTestBuild"/>
   </Target>
 </Project>
\ No newline at end of file