Skip to content

Commit 77165a0

Browse files
authored
Fix a few special cases of projects with command line arguments (#61758)
* Remove CLRTestExecutionArguments from OOMException01 Test entrypoint is parameterless and so it ignores the argument * The test entrypoint for 347011 is parameterless so the property is ignored * Remove project-driven command line arguments from the polyrec test The test just passes a pair of integers that are used as internal parameters for the test. Refactor the test so that the entrypoint accepts the parameters as arguments and call it once from Main the way we used to do based on the CLRTestExecutionArguments. Thanks Tomas
1 parent 752d396 commit 77165a0

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

src/tests/Loader/regressions/polyrec/Polyrec.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
4-
<CLRTestExecutionArguments>4 50</CLRTestExecutionArguments>
53
<CLRTestPriority>1</CLRTestPriority>
64
<!-- This test leaves threads running at exit -->
75
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>

src/tests/Loader/regressions/polyrec/polyrec.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// and niters it the number of type/method instantiations to create each thread
99
using System;
1010
using System.Threading;
11+
using Xunit;
1112

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

66-
public static int Main(String[] args)
67+
public static void Test(int threads, int insts)
6768
{
68-
if (args.Length < 2)
69-
{
70-
Console.WriteLine("Usage: polyrec <nthreads> <ninsts>");
71-
return 99;
72-
}
73-
74-
nthreads = Int32.Parse(args[0]);
75-
ninsts = Int32.Parse(args[1]);
69+
nthreads = threads;
70+
ninsts = insts;
7671

7772
for (int i = 0; i < nthreads; i++)
78-
{
73+
{
7974
Thread t = new Thread(i % 2 == 0 ? new ThreadStart(Start) : new ThreadStart(Start2));
8075
t.Name = "Thread " + i;
8176
t.Start();
8277
}
83-
Console.WriteLine("Main thread exited");
84-
return 100;
78+
79+
Console.WriteLine("Main thread exited");
80+
}
81+
82+
[Fact]
83+
public static void Test_4_50()
84+
{
85+
Test(4, 50);
8586
}
8687
}

src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<OutputType>Exe</OutputType>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
55
<CLRTestPriority>1</CLRTestPriority>
6-
<CLRTestExecutionArguments>-trustedexe</CLRTestExecutionArguments>
76
</PropertyGroup>
87
<ItemGroup>
98
<Compile Include="oomexception01.cs" />

src/tests/baseservices/threading/regressions/beta1/347011.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<CLRTestPriority>1</CLRTestPriority>
5-
<CLRTestExecutionArguments>240</CLRTestExecutionArguments>
65
</PropertyGroup>
76
<ItemGroup>
87
<Compile Include="347011.cs" />

0 commit comments

Comments
 (0)