}
}
- // Run all the programs from the CoreCLR test binary drop we wish to run while collecting MC files.
- private static void RunTestProgramsWhileCollecting()
+ private static string[] GetSpmiTestFullPaths()
{
- // Note: We previously used
- // JIT\Performance\CodeQuality\Roslyn\CscBench\CscBench.cmd
- // but it doesn't currently run on x86 due to this issue: https://github.com/dotnet/coreclr/issues/6844.
- var superPMICollectionTestProgramsList = new List<string>();
+ var spmiTestFullPaths = new List<string>();
- using (var resourceStream = typeof(SuperPMICollectionClass).GetTypeInfo().Assembly.GetManifestResourceStream("TestProjects"))
+ using (var resourceStream = typeof(SuperPMICollectionClass).GetTypeInfo().Assembly.GetManifestResourceStream("SpmiTestNames"))
using (var streamReader = new StreamReader(resourceStream))
{
string currentDirectory = Directory.GetCurrentDirectory();
- string csprojRelativePath;
- while ((csprojRelativePath = streamReader.ReadLine()) != null)
+ string spmiTestName;
+ while ((spmiTestName = streamReader.ReadLine()) != null)
{
- string cmdFileName = Path.ChangeExtension(Path.GetFileName(csprojRelativePath), ".cmd");
- cmdFileName = Path.Combine(currentDirectory, cmdFileName);
- superPMICollectionTestProgramsList.Add(cmdFileName);
+ string spmiTestFullPath = Path.Combine(currentDirectory, spmiTestName, Path.ChangeExtension(spmiTestName, ".cmd"));
+ spmiTestFullPaths.Add(spmiTestFullPath);
}
}
+ return spmiTestFullPaths.ToArray();
+ }
+
+ // Run all the programs from the CoreCLR test binary drop we wish to run while collecting MC files.
+ private static void RunTestProgramsWhileCollecting()
+ {
+
// Run the tests
- foreach (string testFullPath in superPMICollectionTestProgramsList)
+ foreach (string spmiTestPath in GetSpmiTestFullPaths())
{
try
{
- RunTest(testFullPath);
+ RunTest(spmiTestPath);
}
catch (SpmiException ex)
{
}
}
-}
\ No newline at end of file
+}
<PropertyGroup>
<OutputType>Exe</OutputType>
<GCStressIncompatible>true</GCStressIncompatible>
- <CrossGenTest>false</CrossGenTest>
<!-- This test takes a long time to complete -->
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>
<!-- https://github.com/dotnet/coreclr/issues/24633 -->
<ItemGroup>
<Compile Include="superpmicollect.cs" />
</ItemGroup>
- <!-- TestProjects file contains the relative paths to the test projects that are used by superpmicollect test. -->
+
+ <ItemGroup>
+ <_SpmiTestProjects Include="..\Performance\CodeQuality\Bytemark\Bytemark.csproj" />
+ <_SpmiTestProjects Include="..\Methodical\fp\exgen\10w5d_cs_do.csproj" />
+ <_SpmiTestProjects Update="@(_SpmiTestProjects)">
+ <Properties>OutputPath=$(OutputPath)\%(FileName)</Properties>
+ </_SpmiTestProjects>
+ </ItemGroup>
+
+ <!-- This target builds the executables and test running scripts for the _SpmiTestProjects
+ to the output directory of the current project. -->
+ <Target Name="_BuildSpmiTestProjects" BeforeTargets="Build">
+ <MSBuild Projects="@(_SpmiTestProjects)" />
+ </Target>
+
+ <!-- _SpmiTestNamesFile contains the file names of the _SpmiTestProjects. -->
<PropertyGroup>
- <_TestProjectsFileName>TestProjects.txt</_TestProjectsFileName>
+ <_SpmiTestNamesFile>$(IntermediateOutputPath)\SpmiTestNames.txt</_SpmiTestNamesFile>
</PropertyGroup>
- <!-- In order to avoid hard-coding of those paths in C# file we embed the file as an assembly resource. -->
+
+ <!-- In order to avoid hard-coding of the _SpmiTestProjects names in a C# file
+ we will write them to a file and embed the file as an assembly resource. -->
+ <Target Name="_WriteSpmiTestNamesToFile" BeforeTargets="ResGen">
+ <ItemGroup>
+ <_SpmiTestNames Include="@(_SpmiTestProjects->'%(FileName)')" />
+ </ItemGroup>
+ <WriteLinesToFile File="$(_SpmiTestNamesFile)" Lines="@(_SpmiTestNames)" Overwrite="True" />
+ </Target>
+
<ItemGroup>
- <EmbeddedResource Include="$(_TestProjectsFileName)">
- <LogicalName>TestProjects</LogicalName>
+ <EmbeddedResource Include="$(_SpmiTestNamesFile)">
+ <LogicalName>SpmiTestNames</LogicalName>
</EmbeddedResource>
</ItemGroup>
- <!-- This target builds the executables and test running scripts for the TestProjects to output directory of the current project. -->
- <Target Name="_BuildTestProjects" AfterTargets="Build">
- <ReadLinesFromFile File="$(_TestProjectsFileName)">
- <Output TaskParameter="Lines" ItemName="_TestProjectsToBuild" />
- </ReadLinesFromFile>
- <MSBuild Projects="@(_TestProjectsToBuild)" Properties="OutputPath=$(OutputPath)" />
- </Target>
</Project>