Skip to content
Draft
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
14 changes: 0 additions & 14 deletions src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,6 @@
<!-- IL projects often have mismatches assembly names vs file names and that breaks Win32 resource generation option -->
<IlcGenerateWin32Resources Condition="'$(Language)' == 'IL'">false</IlcGenerateWin32Resources>

<!-- The default TrimMode in the SDK is full. But trimming most of the tests would just make them fail,
so the default for the test tree is partial. -->
<TrimMode Condition="'$(EnableAggressiveTrimming)' != 'true'">partial</TrimMode>

<IlcTreatWarningsAsErrors>false</IlcTreatWarningsAsErrors>

<IlcToolsPath>$(CoreCLRCrossILCompilerDir)</IlcToolsPath>
Expand All @@ -560,16 +556,6 @@
<!-- Bump the generic cycle tolerance. There's at least one test with a cycle that is reachable at runtime to depth 6 -->
<IlcArg Include="--maxgenericcycle:7" />

<!-- We set TrimMode to partial so that we don't trim parts of the tests,
but don't make this apply to xunit cruft -->
<IlcArg Include="--trim:Microsoft.DotNet.XUnitExtensions" />
<IlcArg Include="--trim:xunit.abstractions" />
<IlcArg Include="--trim:xunit.assert" />
<IlcArg Include="--trim:xunit.console" />
<IlcArg Include="--trim:xunit.core" />
<IlcArg Include="--trim:xunit.execution.dotnet" />
<IlcArg Include="--trim:xunit.abstractions" />

<!-- NativeAOT compiled output is placed into a 'native' subdirectory: we need to set
rpath so that the test can load its native library dependencies if there's any -->
<LinkerArg Include="-Wl,-rpath,'@executable_path/..'" Condition="'$(SetIlcRPath)' != 'false' and ('$(TargetOS)' == 'osx' or '$(TargetsAppleMobile)' == 'true')" />
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -33,7 +34,7 @@ public static void Eval(string location, bool exp)
}
}

public static bool UIsInstT<T,U>(bool expected)
public static bool UIsInstT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -35,7 +36,7 @@ public static void Eval(string location, bool exp)
}
}

public static bool UIsInstT<T,U>(bool expected)
public static bool UIsInstT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -33,7 +34,7 @@ public static void Eval(string location, bool exp)
}
}

public static bool UIsInstT<T,U>(bool expected)
public static bool UIsInstT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -33,7 +34,7 @@ public static void Eval(string location, bool exp)
}
}

public static bool UIsInstT<T,U>(bool expected)
public static bool UIsInstT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -33,7 +34,7 @@ public static void Eval(string location, bool exp)
}
}

public static bool UIsInstT<T,U>(bool expected)
public static bool UIsInstT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -33,7 +34,7 @@ public static void Eval(string location, bool exp)
}
}

public static bool UIsInstT<T,U>(bool expected)
public static bool UIsInstT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
7 changes: 4 additions & 3 deletions src/tests/Loader/classloader/generics/Variance/IL/Unbox001.cs
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -32,17 +33,17 @@ public static void Eval(string location, bool exp)
Console.WriteLine("Test Failed at location: {0} @ count {1} ", location, iTestCount);
}
}
private static void UnboxUToTInternal<T,U>()
private static void UnboxUToTInternal<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
T t = (T) Activator.CreateInstance(typeof(U));
}

private static void CaseClassUToTWrapper<T,U>()
private static void CaseClassUToTWrapper<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
UnboxUToTInternal<T,U>();
}

public static bool UnboxUToT<T,U>(bool expected)
public static bool UnboxUToT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
7 changes: 4 additions & 3 deletions src/tests/Loader/classloader/generics/Variance/IL/Unbox002.cs
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -32,17 +33,17 @@ public static void Eval(string location, bool exp)
Console.WriteLine("Test Failed at location: {0} @ count {1} ", location, iTestCount);
}
}
private static void UnboxUToTInternal<T,U>()
private static void UnboxUToTInternal<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
T t = (T) Activator.CreateInstance(typeof(U));
}

private static void CaseClassUToTWrapper<T,U>()
private static void CaseClassUToTWrapper<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
UnboxUToTInternal<T,U>();
}

public static bool UnboxUToT<T,U>(bool expected)
public static bool UnboxUToT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
7 changes: 4 additions & 3 deletions src/tests/Loader/classloader/generics/Variance/IL/Unbox003.cs
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -32,17 +33,17 @@ public static void Eval(string location, bool exp)
Console.WriteLine("Test Failed at location: {0} @ count {1} ", location, iTestCount);
}
}
private static void UnboxUToTInternal<T,U>()
private static void UnboxUToTInternal<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
T t = (T) Activator.CreateInstance(typeof(U));
}

private static void CaseClassUToTWrapper<T,U>()
private static void CaseClassUToTWrapper<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
UnboxUToTInternal<T,U>();
}

public static bool UnboxUToT<T,U>(bool expected)
public static bool UnboxUToT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
7 changes: 4 additions & 3 deletions src/tests/Loader/classloader/generics/Variance/IL/Unbox004.cs
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -32,17 +33,17 @@ public static void Eval(string location, bool exp)
Console.WriteLine("Test Failed at location: {0} @ count {1} ", location, iTestCount);
}
}
private static void UnboxUToTInternal<T,U>()
private static void UnboxUToTInternal<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
T t = (T) Activator.CreateInstance(typeof(U));
}

private static void CaseClassUToTWrapper<T,U>()
private static void CaseClassUToTWrapper<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
UnboxUToTInternal<T,U>();
}

public static bool UnboxUToT<T,U>(bool expected)
public static bool UnboxUToT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
7 changes: 4 additions & 3 deletions src/tests/Loader/classloader/generics/Variance/IL/Unbox005.cs
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -32,17 +33,17 @@ public static void Eval(string location, bool exp)
Console.WriteLine("Test Failed at location: {0} @ count {1} ", location, iTestCount);
}
}
private static void UnboxUToTInternal<T,U>()
private static void UnboxUToTInternal<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
T t = (T) Activator.CreateInstance(typeof(U));
}

private static void CaseClassUToTWrapper<T,U>()
private static void CaseClassUToTWrapper<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
UnboxUToTInternal<T,U>();
}

public static bool UnboxUToT<T,U>(bool expected)
public static bool UnboxUToT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
7 changes: 4 additions & 3 deletions src/tests/Loader/classloader/generics/Variance/IL/Unbox006.cs
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 System.Diagnostics.CodeAnalysis;
using Xunit;

public class Base {}
Expand Down Expand Up @@ -32,17 +33,17 @@ public static void Eval(string location, bool exp)
Console.WriteLine("Test Failed at location: {0} @ count {1} ", location, iTestCount);
}
}
private static void UnboxUToTInternal<T,U>()
private static void UnboxUToTInternal<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
T t = (T) Activator.CreateInstance(typeof(U));
}

private static void CaseClassUToTWrapper<T,U>()
private static void CaseClassUToTWrapper<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>()
{
UnboxUToTInternal<T,U>();
}

public static bool UnboxUToT<T,U>(bool expected)
public static bool UnboxUToT<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] U>(bool expected)
{
try
{
Expand Down
Loading