Skip to content

Commit

Permalink
Convert JIT\Regression tests to merged test groups (#83895)
Browse files Browse the repository at this point in the history
Remaining usability issues are listed in #71732

Conversion steps:
- static-none uses args - add comment to RequiresProcessIsolation
- remove unused arg in Runtime_80731.il
- Rewrite 4 IL tests to use newarr instead of args
- [cs-main] remove unused args in C# tests
- Update 9 tests with Main(args)
- Workaround: add RequiresProcessIsolation to LdfldaHack
- Move [Fact] to correct location in b12263
- In b06020, wrap $ class so that the C# wrapper can call it
- [ILTransform -public]
- [ILTransform -sr]
- Manually rename b598031/test and test2.
  These were missed by the previous ILTransform -n run.
  They no longer clash because run renamed all of their conflicts,
  but this renames them for consistency.
- [ILTransform -prociso] Rerun for new tests
- Wrappers
- [ILTransform -ilfact]
- Manually do missed -collapse-main-sig and fix placement of [Fact]
- Fix b89946 that referred to Main
- Fix Runtime_59444 reflection on Test*
* Fix TestSummary.cs to handle invalid XML characters
* [ILTransform -a]
* Manual fixes
* Update test groupings and add extern aliases
* Finish merge - incorporate changes to csproj/Dir.B.props - fix xunit.analyzers errors
* [ILTransform -public]
* [ILTransform -prociso]
* [ILTransform -ilfact] (undo GitHub_26491)
* Fix xUnit1003 in Runtime_83003
* Update new test Runtime_83941 for merged groups
* 59444 - Changing methods to internal broke reflection calls.  Use this
  opportunity to remove the reflection and simply mark the callees as [Fact]s.
- 64883/76273 - Suppress the xunit warning so that the code can continue
  using the normal (public-only) reflection search.
- Fix TestSummary.cs to handle invalid XML characters
- Add RequiresProcessIsolation for existing issues.target entry (AOT compiler fails)
- undo JIT/opt/And/Regressions/Regression1.csproj (possibly from manual merge from main)
  • Loading branch information
markples authored Mar 31, 2023
1 parent ef6b6d5 commit 52bbeeb
Show file tree
Hide file tree
Showing 2,947 changed files with 4,411 additions and 4,267 deletions.
3 changes: 2 additions & 1 deletion src/tests/Common/XUnitWrapperLibrary/TestSummary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace XUnitWrapperLibrary;

public class TestSummary
Expand Down Expand Up @@ -43,7 +44,7 @@ public string ToXmlString()
+ $@" method=""{MethodName}"" time=""{Duration.TotalSeconds:F6}""");

string outputElement = !string.IsNullOrWhiteSpace(Output)
? $"<output><![CDATA[{Output}]]></output>"
? $"<output><![CDATA[{XmlConvert.EncodeName(Output)}]]></output>"
: string.Empty;

if (Exception is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
//

using System;
using Xunit;

public class Bug
{
public void Func(ref String str)
internal void Func(ref String str)
{
Console.WriteLine(str.ToString());
str = "Abc";
}

public void run()
internal void run()
{
String[] str = new String[10];
str[0] = "DEF";
Func(ref str[0]);
}

public static int Main()
[Fact]
public static int TestEntryPoint()
{
(new Bug()).run();
Console.WriteLine("Passed");
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 @@ -3,6 +3,7 @@

using System;
using System.Diagnostics;
using Xunit;
namespace SetIPTest
{
public class SetIP
Expand All @@ -13,7 +14,7 @@ public SetIP()
}


public static void F()
internal static void F()
{
String s;
double d;
Expand Down Expand Up @@ -53,7 +54,8 @@ public static void F()
}


public static int Main()
[Fact]
public static int TestEntryPoint()
{
Console.WriteLine("Entering Main of SetIP");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. -->
<DebugType>PdbOnly</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern legacy library mscorlib {}
.assembly extern xunit.core {}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
Expand All @@ -11,6 +12,9 @@
.class public ILGEN_0x38e94b27 {

.method public static int32 main() {
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 10

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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
//

using Xunit;
namespace Test
{
using System;
Expand All @@ -13,7 +14,8 @@ public BB Method1(float param2)
return new BB();
}

public static int Main()
[Fact]
public static int TestEntryPoint()
{
new BB().Method1(0.0f);
return 100;
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,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
//

using Xunit;
namespace Test
{
using System;
Expand All @@ -15,7 +16,8 @@ BB Method3(float param2, ulong[] param3)

static bool Static1(float[] param1) { return false; }

public static int Main()
[Fact]
public static int TestEntryPoint()
{
try
{
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.IL">
<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.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
//

using Xunit;
namespace JitTest
{
using System;

public class Test
{
public static int Main()
[Fact]
public static int TestEntryPoint()
{
ulong a = 0x0000000000000020;
ulong b = 0xa697fcbfd6d232d1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
//

using Xunit;
namespace Test
{
using System;

public class App
{
public static int Main()
[Fact]
public static int TestEntryPoint()
{
ulong a = 0x00000000005d909c;
ulong b = 0x00004021bfa15862;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
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>
<RestorePackages>true</RestorePackages>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

namespace DefaultNamespace
{
Expand Down Expand Up @@ -135,7 +136,8 @@ public class Bug
internal static readonly String[,] strArr = {{"This", " ", "a", " ", "test", " ", "of", " ", "patience", "."},
{"This", " ", "a", " ", "test", " ", "of", " ", "patience", "."}};

public static int Main()
[Fact]
public static int TestEntryPoint()
{
new Bug();
return 100;
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
4 changes: 4 additions & 0 deletions src/tests/JIT/Regression/CLR-x86-EJIT/v1-m10/b07847/b07847.il
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern legacy library mscorlib {}
.assembly b07847
{
Expand All @@ -17,6 +18,9 @@
.field public static int32 TLSFieldData at FieldData
.method public static int32 main()
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
ldsfld int32 test::TLSFieldData
ldc.i4 51966
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>
<!-- Test relies on tls support see #2441 -->
<DisableProjectBuild>true</DisableProjectBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern legacy library mscorlib {}
.assembly extern xunit.core {}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
Expand All @@ -13,6 +14,9 @@
.class public _simple {

.method public static int32 main() {
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 100

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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern legacy library mscorlib {}
.assembly extern xunit.core {}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
Expand All @@ -13,6 +14,9 @@
.class public _simple {

.method public static int32 main() {
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 100

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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern legacy library mscorlib {}
.assembly extern xunit.core {}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
Expand All @@ -13,6 +14,9 @@
.class public _simple {

.method public static int32 main() {
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 100

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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern legacy library mscorlib {}
.assembly extern xunit.core {}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
Expand All @@ -12,6 +13,9 @@
.class public ExceptionTest {

.method public static int32 main(){
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
L1:
newobj instance void [mscorlib]System.Exception::.ctor() throw
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
Loading

0 comments on commit 52bbeeb

Please sign in to comment.