Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few special cases of projects with command line arguments #61758

Merged
merged 5 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/tests/Loader/regressions/polyrec/Polyrec.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestExecutionArguments>4 50</CLRTestExecutionArguments>
<CLRTestPriority>1</CLRTestPriority>
<!-- This test leaves threads running at exit -->
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>
Expand Down
25 changes: 13 additions & 12 deletions src/tests/Loader/regressions/polyrec/polyrec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// and niters it the number of type/method instantiations to create each thread
using System;
using System.Threading;
using Xunit;

// Spice things up a bit with some mutual recursion between instantiations
class C<T>
Expand Down Expand Up @@ -63,24 +64,24 @@ public static void Start2()
genmeth2<string>(ninsts);
}

public static int Main(String[] args)
public static void Test(int threads, int insts)
{
if (args.Length < 2)
{
Console.WriteLine("Usage: polyrec <nthreads> <ninsts>");
return 99;
}

nthreads = Int32.Parse(args[0]);
ninsts = Int32.Parse(args[1]);
nthreads = threads;
ninsts = insts;

for (int i = 0; i < nthreads; i++)
{
{
Thread t = new Thread(i % 2 == 0 ? new ThreadStart(Start) : new ThreadStart(Start2));
t.Name = "Thread " + i;
t.Start();
}
Console.WriteLine("Main thread exited");
return 100;

Console.WriteLine("Main thread exited");
}

[Fact]
public static void Test_4_50()
{
Test(4, 50);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestPriority>1</CLRTestPriority>
<CLRTestExecutionArguments>-trustedexe</CLRTestExecutionArguments>
</PropertyGroup>
<ItemGroup>
<Compile Include="oomexception01.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
<CLRTestExecutionArguments>240</CLRTestExecutionArguments>
</PropertyGroup>
<ItemGroup>
<Compile Include="347011.cs" />
Expand Down