Skip to content

Commit

Permalink
Fix playground (#4420)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored Apr 26, 2023
1 parent 8e64247 commit 8500198
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion playground/TestPlatform.Playground/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class EnvironmentVariables
["VSTEST_RUNNER_DEBUG_ATTACHVS"] = "0",
["VSTEST_HOST_DEBUG_ATTACHVS"] = "0",
["VSTEST_DATACOLLECTOR_DEBUG_ATTACHVS"] = "0",
["VSTEST_EXPERIMENTAL_FORWARD_OUTPUT_FEATURE"] = "1"
["VSTEST_EXPERIMENTAL_FORWARD_OUTPUT_FEATURE"] = "0"
};

}
6 changes: 3 additions & 3 deletions playground/TestPlatform.Playground/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ static void Main()
""";

var sources = new[] {
Path.Combine(playground, "MSTest1", "bin", "Debug", "net472", "MSTest1.dll"),
//Path.Combine(playground, "MSTest2", "bin", "Debug", "net472", "MSTest2.dll"),
//Path.Combine(playground, "MSTest1", "bin", "Debug", "net5.0", "MSTest1.dll"),
Path.Combine(playground, "bin", "MSTest1", "Debug", "net472", "MSTest1.dll"),
// Path.Combine(playground, "bin", "MSTest2", "Debug", "net472", "MSTest2.dll"),
// Path.Combine(playground, "bin", "MSTest1", "Debug", "net5.0", "MSTest1.dll"),
};

//// Console mode
Expand Down
48 changes: 22 additions & 26 deletions playground/TestPlatform.Playground/TestPlatform.Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,40 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition=" '$(OS)' == 'WINDOWS_NT' ">
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<PropertyGroup>
<SourcePath>$(RepoRoot)src\</SourcePath>
<SourcePath>$(RepoRoot)artifacts\</SourcePath>
<DestinationPath>$(TargetDir)vstest.console\</DestinationPath>
</PropertyGroup>

<ItemGroup>
<FileToCopy Include="$(SourcePath)vstest.console\bin\$(Configuration)\$(NetFrameworkMinimum)\**\*.*" SubFolder="" />
<FileToCopy Include="$(SourcePath)Microsoft.TestPlatform.TestHostProvider\bin\$(Configuration)\$(NetFrameworkMinimum)\**\*.*" SubFolder="Extensions\" />
<FileToCopy Include="$(SourcePath)bin\vstest.console\$(Configuration)\$(NetFrameworkMinimum)\win7-x64\**\*.*" SubFolder="" />
<FileToCopy Include="$(SourcePath)bin\Microsoft.TestPlatform.TestHostProvider\$(Configuration)\$(NetFrameworkMinimum)\**\*.*" SubFolder="Extensions\" />

<!-- copy net462, net47, net471, net472 and net48 testhosts" -->
<FileToCopy Include="$(SourcePath)testhost.x86\bin\$(Configuration)\$(NetFrameworkMinimum)\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost\bin\$(Configuration)\$(NetFrameworkMinimum)\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost.x86\bin\$(Configuration)\net47\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost\bin\$(Configuration)\net47\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost.x86\bin\$(Configuration)\net471\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost\bin\$(Configuration)\net471\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost.x86\bin\$(Configuration)\net472\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost\bin\$(Configuration)\net472\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost.x86\bin\$(Configuration)\net48\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)testhost\bin\$(Configuration)\net48\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost.x86\$(Configuration)\$(NetFrameworkMinimum)\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost\$(Configuration)\$(NetFrameworkMinimum)\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost.x86\$(Configuration)\net47\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost\$(Configuration)\net47\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost.x86\$(Configuration)\net471\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost\$(Configuration)\net471\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost.x86\$(Configuration)\net472\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost\$(Configuration)\net472\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost.x86\$(Configuration)\net48\win7-x86\**\*.*" SubFolder="TestHostNetFramework\" />
<FileToCopy Include="$(SourcePath)bin\testhost\$(Configuration)\net48\win7-x64\**\*.*" SubFolder="TestHostNetFramework\" />

<!-- copy datacollectors" -->
<FileToCopy Include="$(SourcePath)datacollector\bin\$(Configuration)\net472\**\*.*" SubFolder="" />
<FileToCopy Include="$(SourcePath)Microsoft.TestPlatform.Extensions.BlameDataCollector\bin\$(Configuration)\net472\**\*.*" SubFolder="Extensions\" />
<FileToCopy Include="$(SourcePath)DataCollectors\Microsoft.TestPlatform.Extensions.EventLogCollector\bin\$(Configuration)\$(NetFrameworkMinimum)\**\*.*" SubFolder="Extensions\" />
<FileToCopy Include="$(SourcePath)DataCollectors\DumpMinitool\bin\$(Configuration)\$(NetFrameworkMinimum)\win7-x64\**\*.*" SubFolder="Extensions\blame\" />
<FileToCopy Include="$(SourcePath)DataCollectors\DumpMinitool.x86\bin\$(Configuration)\$(NetFrameworkMinimum)\win7-x86\**\*.*" SubFolder="Extensions\blame\" />
<FileToCopy Include="$(SourcePath)DataCollectors\DumpMinitool.arm64\bin\$(Configuration)\$(NetFrameworkMinimum)\win10-arm64\**\*.*" SubFolder="Extensions\blame\" />
<FileToCopy Include="$(SourcePath)bin\datacollector\$(Configuration)\net472\win7-x64\**\*.*" SubFolder="" />
<FileToCopy Include="$(SourcePath)bin\Microsoft.TestPlatform.Extensions.BlameDataCollector\$(Configuration)\net472\**\*.*" SubFolder="Extensions\" />
<FileToCopy Include="$(SourcePath)bin\DataCollectors\Microsoft.TestPlatform.Extensions.EventLogCollector\$(Configuration)\$(NetFrameworkMinimum)\**\*.*" SubFolder="Extensions\" />
<FileToCopy Include="$(SourcePath)bin\DataCollectors\DumpMinitool\$(Configuration)\$(NetFrameworkMinimum)\win7-x64\**\*.*" SubFolder="Extensions\blame\" />
<FileToCopy Include="$(SourcePath)bin\DataCollectors\DumpMinitool.x86\$(Configuration)\$(NetFrameworkMinimum)\win7-x86\**\*.*" SubFolder="Extensions\blame\" />
<FileToCopy Include="$(SourcePath)bin\DataCollectors\DumpMinitool.arm64\$(Configuration)\$(NetFrameworkMinimum)\win10-arm64\**\*.*" SubFolder="Extensions\blame\" />
</ItemGroup>

<Copy SourceFiles="@(FileToCopy)"
DestinationFiles="@(FileToCopy -> '$(DestinationPath)\%(SubFolder)\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="True" OverwriteReadOnlyFiles="True" Retries="3" RetryDelayMilliseconds="500"
UseHardlinksIfPossible="False" UseSymboliclinksIfPossible="False" ErrorIfLinkFails="False"
Condition="@(FileToCopy->Count()) > 0">
<Copy SourceFiles="@(FileToCopy)" DestinationFiles="@(FileToCopy -> '$(DestinationPath)\%(SubFolder)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="True" OverwriteReadOnlyFiles="True" Retries="3" RetryDelayMilliseconds="500" UseHardlinksIfPossible="False" UseSymboliclinksIfPossible="False" ErrorIfLinkFails="False" Condition="@(FileToCopy-&gt;Count()) &gt; 0">

<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
</Copy>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private static bool AttachVs(Process process, int? vsPid)
var parent = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location);
while (parent != null)
{
var path = Path.Combine(parent, @"src\AttachVS\bin\Debug\net472\AttachVS.exe");
var path = Path.Combine(parent, @"artifacts\bin\AttachVS\Debug\net472\AttachVS.exe");
Debug.WriteLine($"Looking for AttachVS in: {path}.");
if (File.Exists(path))
{
Expand Down

0 comments on commit 8500198

Please sign in to comment.