Skip to content

Commit

Permalink
Convert jit\jit64 to merged test groups (#83151)
Browse files Browse the repository at this point in the history
This is done with a collection of automated ILTransform changes with [this version of the tool](markples/utils@cefdaff) and manual fixes. Below is an order of steps. This also restores b16102 in jit\Regression as a completely empty test, which was lost in automatic changes during that conversion.

- Standardizing ilprojs suffixes
- Removing test entrypoint args
- Running ILTransform -p
- Running ILTransform -n
- Running ILTransform -m
- Running ILTransform -a
- Running ILTransform -prociso
- Running ILTransform -collapse-main-sig
- Running ILTransform -public
- Running ILTransform -ilfact
- Adding JIT/Directed merge tests wrapper
- Removing il_do ilproj extensions
- Balancing test groups
- Removing invalid token $ from iltest entrypoint name
- Patching merge wrapper generator code
- Fixing incompatible accesibility after exposing test entrypoint
- Fixing accesibility problems after wrapper generator updates
- Updating issue.targets after renaming ilprojs
- Ignoring on jit64/regress/vsw/373472/test_il linux wasm
- Apply recent msbuild changes. Disable some analyzer warnings.
- Fix xUnit1013 in pri1 tests
- Restore b16102 as an empty-Main executable test
- Extend IL project renaming to handle _il_do and _il_ro
- Change 102754 to return 100 so exit code isn't necessary. Add comments to IL.
- Unconditionally set CLRTestExpectedExitCode to allow its usage in tests in merged groups

Co-authored-by: Mark Plesko <markples@microsoft.com>
  • Loading branch information
BrianBohe and markples authored Apr 14, 2023
1 parent 9c02b25 commit 4f7375c
Show file tree
Hide file tree
Showing 1,574 changed files with 3,026 additions and 2,453 deletions.
2 changes: 1 addition & 1 deletion src/tests/Common/CLRTest.Execute.Bash.targets
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fi

<BashCLRTestExitCodePrep Condition="$(_CLRTestNeedsToRun)">
<![CDATA[
if [ -z ${CLRTestExpectedExitCode+x} ]%3B then export CLRTestExpectedExitCode=$(CLRTestExitCode)%3B fi
export CLRTestExpectedExitCode=$(CLRTestExitCode)
echo BEGIN EXECUTION]]>
</BashCLRTestExitCodePrep>

Expand Down
2 changes: 1 addition & 1 deletion src/tests/Common/CLRTest.Execute.Batch.targets
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ IF NOT "%CrossGen2SynthesizePgo"=="" (

<BatchCLRTestExitCodePrep Condition="$(_CLRTestNeedsToRun)">
<![CDATA[
if not defined CLRTestExpectedExitCode (set CLRTestExpectedExitCode=$(CLRTestExitCode))
set CLRTestExpectedExitCode=$(CLRTestExitCode)
ECHO BEGIN EXECUTION
]]>
</BatchCLRTestExitCodePrep>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Directory.Merged.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
Directory.Build.targets is typically too late as SDK .targets files will have already
been processed and may have used the value.
-->
<AssemblyName Condition="'$(BuildAsStandalone)' != 'true'">$(MSBuildProjectName.Replace('_il_d', '').Replace('_il_r', ''))</AssemblyName>
<AssemblyName Condition="'$(BuildAsStandalone)' != 'true'">$(MSBuildProjectName.Replace('_il_do', '').Replace('_il_d', '').Replace('_il_ro', '').Replace('_il_r', ''))</AssemblyName>
</PropertyGroup>
</Project>
6 changes: 2 additions & 4 deletions src/tests/JIT/Regression/CLR-x86-JIT/V1-M09/b16102/b16102.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@


using System;
using Xunit;


namespace N
{
public class X
internal class X
{
[Fact]
public static void TestEntryPoint()
public static void Main(String[] args)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>

<!-- The test is an empty Main method, so explicitly don't reference the generator
and run it as an executable -->
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<ReferenceXUnitWrapperGenerator>false</ReferenceXUnitWrapperGenerator>
</PropertyGroup>
<PropertyGroup>
<!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. -->
Expand Down
10 changes: 10 additions & 0 deletions src/tests/JIT/jit64/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="..\..\Directory.Merged.props" />
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />

<PropertyGroup>
<RunAnalyzers>true</RunAnalyzers>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
</PropertyGroup>
</Project>
6 changes: 4 additions & 2 deletions src/tests/JIT/jit64/ebvts/cs/generics/generics/repro52.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Xunit;
internal class MCell<T>
{
private T _t;
Expand Down Expand Up @@ -29,9 +30,10 @@ internal class MPair<R, S> : MCell<R>
public MPair(R r, S s) : base(r) { _s = s; }
}

internal class M
public class M
{
public static int Main()
[Fact]
public static int TestEntryPoint()
{
MCell<int> c = new MCell<int>(1);
MPair<int, string> p = c.GetMPair<string>("2");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

class Program
public class Program
{

private static TestUtil.TestLog testLog;
Expand All @@ -24,7 +25,7 @@ static Program()
testLog = new TestUtil.TestLog(expectedOut);
}

public static void Test(int count)
internal static void Test(int count)
{
try
{
Expand Down Expand Up @@ -54,7 +55,8 @@ public static void Test(int count)
}
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
// start recording
testLog.StartRecording();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

class Program
public class Program
{

private static TestUtil.TestLog testLog;
Expand All @@ -24,7 +25,7 @@ static Program()
testLog = new TestUtil.TestLog(expectedOut);
}

public static void Test(int count)
internal static void Test(int count)
{
try
{
Expand Down Expand Up @@ -53,7 +54,8 @@ public static void Test(int count)
}
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
// start recording
testLog.StartRecording();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

class Program
public class Program
{

private static TestUtil.TestLog testLog;
Expand All @@ -29,7 +30,7 @@ static Program()
testLog = new TestUtil.TestLog(expectedOut);
}

public static void Test(int count)
internal static void Test(int count)
{
try
{
Expand Down Expand Up @@ -76,7 +77,8 @@ public static void Test(int count)
}
}

static int Main()
[Fact]
public static int TestEntryPoint()
{
// start recording
testLog.StartRecording();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/tests/JIT/jit64/eh/FinallyExec/nonlocalexitincatch.il
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern mscorlib {}
.assembly extern eh_common {}
.assembly test {}
.module nonlocalexitincatch.exe
.assembly 'nonlocalexitincatch' {}


.class public auto ansi nonlocalexitincatch {
.method public static int32 Main()
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 2
.locals init (
Expand Down Expand Up @@ -61,6 +65,7 @@

ret
}
}


.method public static void Run()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/tests/JIT/jit64/eh/FinallyExec/nonlocalexitinfinally.il
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern mscorlib {}
.assembly extern eh_common {}
.assembly test {}
.module nonlocalexitinfinally.exe
.assembly 'nonlocalexitinfinally' {}


.class public auto ansi nonlocalexitinfinally {
.method public static int32 Main()
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 2
.locals init (
Expand Down Expand Up @@ -61,6 +65,7 @@

ret
}
}


.method public static void Run()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/tests/JIT/jit64/eh/FinallyExec/nonlocalexitinhandler.il
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern mscorlib {}
.assembly extern eh_common {}
.assembly test {}
.module nonlocalexitinhandler.exe
.assembly 'nonlocalexitinhandler' {}


.class public auto ansi nonlocalexitinhandler {
.method public static int32 Main()
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 2
.locals init (
Expand Down Expand Up @@ -64,6 +68,7 @@

ret
}
}


.method public static void Run()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/tests/JIT/jit64/eh/FinallyExec/nonlocalexitinroot.il
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern mscorlib {}
.assembly extern eh_common {}
.assembly test {}
.module nonlocalexitinroot.exe
.assembly 'nonlocalexitinroot' {}


.class public auto ansi nonlocalexitinroot {
.method public static int32 Main()
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 2
.locals init (
Expand Down Expand Up @@ -55,6 +59,7 @@

ret
}
}


.method public static void Run()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/tests/JIT/jit64/eh/FinallyExec/nonlocalexitintry.il
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern mscorlib {}
.assembly extern eh_common {}
.assembly test {}
.module nonlocalexitintry.exe
.assembly 'nonlocalexitintry' {}


.class public auto ansi nonlocalexitintry {
.method public static int32 Main()
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 2
.locals init (
Expand Down Expand Up @@ -61,6 +65,7 @@

ret
}
}


.method public static void Run()
Expand Down
Loading

0 comments on commit 4f7375c

Please sign in to comment.