diff --git a/eng/Subsets.props b/eng/Subsets.props index 64079deecc48cb..5243a41b59f6b9 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -502,6 +502,8 @@ Test="true" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(NativeAotSupported)' == 'true'"/> + @@ -510,7 +512,7 @@ - + - Library - SharedLibrary $(MSBuildProjectName) - $(BaseOutputPathWithConfig)ilverify\Tests diff --git a/src/tests/ilverify/ILTests/AccessTestsExtern.il b/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsExtern.il similarity index 100% rename from src/tests/ilverify/ILTests/AccessTestsExtern.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsExtern.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsExtern.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsExtern.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsExtern.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/AccessTestsFriend.il b/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsFriend.il similarity index 100% rename from src/tests/ilverify/ILTests/AccessTestsFriend.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsFriend.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsFriend.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsFriend.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/AccessTestsFriend.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/ArrayTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ArrayTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ArrayTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ArrayTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ArrayTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ArrayTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ArrayTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/BasicArithmeticTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/BasicArithmeticTests.il similarity index 100% rename from src/tests/ilverify/ILTests/BasicArithmeticTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/BasicArithmeticTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/BasicArithmeticTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/BasicArithmeticTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/BasicArithmeticTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/BranchingTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/BranchingTests.il similarity index 100% rename from src/tests/ilverify/ILTests/BranchingTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/BranchingTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/BranchingTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/BranchingTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/BranchingTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/CallTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/CallTests.il similarity index 100% rename from src/tests/ilverify/ILTests/CallTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/CallTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/CallTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/CallTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/CallTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/CastingTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/CastingTests.il similarity index 100% rename from src/tests/ilverify/ILTests/CastingTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/CastingTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/CastingTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/CastingTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/CastingTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/ComparisonTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ComparisonTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ComparisonTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ComparisonTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ComparisonTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ComparisonTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ComparisonTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/DefaultInterfaceMethod.il b/src/coreclr/tools/ILVerification.Tests/ILTests/DefaultInterfaceMethod.il similarity index 100% rename from src/tests/ilverify/ILTests/DefaultInterfaceMethod.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/DefaultInterfaceMethod.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/DefaultInterfaceMethod.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/DefaultInterfaceMethod.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/DefaultInterfaceMethod.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/DelegateTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/DelegateTests.il similarity index 100% rename from src/tests/ilverify/ILTests/DelegateTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/DelegateTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/DelegateTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/DelegateTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/DelegateTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/Directory.Build.props b/src/coreclr/tools/ILVerification.Tests/ILTests/Directory.Build.props new file mode 100644 index 00000000000000..2d233f4468dae7 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/Directory.Build.props @@ -0,0 +1,7 @@ + + + + $(NetCoreAppToolCurrent) + false + + diff --git a/src/tests/ilverify/ILTests/ExceptionRegionTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ExceptionRegionTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ExceptionRegionTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ExceptionRegionTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ExceptionRegionTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ExceptionRegionTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ExceptionRegionTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/FieldTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/FieldTests.il similarity index 100% rename from src/tests/ilverify/ILTests/FieldTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/FieldTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/FieldTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/FieldTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/FieldTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/FtnTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/FtnTests.il similarity index 100% rename from src/tests/ilverify/ILTests/FtnTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/FtnTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/FtnTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/FtnTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/FtnTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/FunctionPointerTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/FunctionPointerTests.il similarity index 100% rename from src/tests/ilverify/ILTests/FunctionPointerTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/FunctionPointerTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/FunctionPointerTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/FunctionPointerTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/FunctionPointerTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/GenericInterface.il b/src/coreclr/tools/ILVerification.Tests/ILTests/GenericInterface.il similarity index 100% rename from src/tests/ilverify/ILTests/GenericInterface.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/GenericInterface.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/GenericInterface.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/GenericInterface.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/GenericInterface.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/InterfaceDefinition.il b/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceDefinition.il similarity index 100% rename from src/tests/ilverify/ILTests/InterfaceDefinition.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceDefinition.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceDefinition.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceDefinition.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceDefinition.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/InterfaceImplementation.il b/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceImplementation.il similarity index 100% rename from src/tests/ilverify/ILTests/InterfaceImplementation.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceImplementation.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceImplementation.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceImplementation.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/InterfaceImplementation.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/LoadStoreIndirectTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/LoadStoreIndirectTests.il similarity index 100% rename from src/tests/ilverify/ILTests/LoadStoreIndirectTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/LoadStoreIndirectTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/LoadStoreIndirectTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/LoadStoreIndirectTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/LoadStoreIndirectTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/LocalAllocTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/LocalAllocTests.il similarity index 100% rename from src/tests/ilverify/ILTests/LocalAllocTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/LocalAllocTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/LocalAllocTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/LocalAllocTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/LocalAllocTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/NewobjTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/NewobjTests.il similarity index 100% rename from src/tests/ilverify/ILTests/NewobjTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/NewobjTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/NewobjTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/NewobjTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/NewobjTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/PrefixTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/PrefixTests.il similarity index 100% rename from src/tests/ilverify/ILTests/PrefixTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/PrefixTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/PrefixTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/PrefixTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/PrefixTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/ReturnTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ReturnTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ReturnTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ReturnTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ReturnTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ReturnTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ReturnTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/RuntimeAsyncTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/RuntimeAsyncTests.il similarity index 100% rename from src/tests/ilverify/ILTests/RuntimeAsyncTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/RuntimeAsyncTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/RuntimeAsyncTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/RuntimeAsyncTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/RuntimeAsyncTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/ShiftTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ShiftTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ShiftTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ShiftTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ShiftTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ShiftTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ShiftTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/SwitchTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/SwitchTests.il similarity index 100% rename from src/tests/ilverify/ILTests/SwitchTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/SwitchTests.il diff --git a/src/tests/ilverify/ILTests/ThisStateTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ThisStateTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ThisStateTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ThisStateTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ThisStateTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ThisStateTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ThisStateTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTests/ValueTypeTests.il b/src/coreclr/tools/ILVerification.Tests/ILTests/ValueTypeTests.il similarity index 100% rename from src/tests/ilverify/ILTests/ValueTypeTests.il rename to src/coreclr/tools/ILVerification.Tests/ILTests/ValueTypeTests.il diff --git a/src/coreclr/tools/ILVerification.Tests/ILTests/ValueTypeTests.ilproj b/src/coreclr/tools/ILVerification.Tests/ILTests/ValueTypeTests.ilproj new file mode 100644 index 00000000000000..356b4dcc778989 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILTests/ValueTypeTests.ilproj @@ -0,0 +1,9 @@ + + + $(MSBuildProjectName) + + + + + + diff --git a/src/tests/ilverify/ILTypeVerificationTester.cs b/src/coreclr/tools/ILVerification.Tests/ILTypeVerificationTester.cs similarity index 100% rename from src/tests/ilverify/ILTypeVerificationTester.cs rename to src/coreclr/tools/ILVerification.Tests/ILTypeVerificationTester.cs diff --git a/src/coreclr/tools/ILVerification.Tests/ILVerification.Tests.csproj b/src/coreclr/tools/ILVerification.Tests/ILVerification.Tests.csproj new file mode 100644 index 00000000000000..09923f87e7238b --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/ILVerification.Tests.csproj @@ -0,0 +1,25 @@ + + + true + $(NetCoreAppToolCurrent) + false + + + + + + + + + + + + + + false + Content + PreserveNewest + Tests\%(Filename).dll + + + diff --git a/src/coreclr/tools/ILVerification.Tests/JsonContext.cs b/src/coreclr/tools/ILVerification.Tests/JsonContext.cs new file mode 100644 index 00000000000000..8ab954e3fd5886 --- /dev/null +++ b/src/coreclr/tools/ILVerification.Tests/JsonContext.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Text.Json.Serialization; +using ILVerify; + +namespace ILVerification.Tests +{ + [JsonSourceGenerationOptions(WriteIndented = false)] + [JsonSerializable(typeof(List))] + internal partial class JsonContext : JsonSerializerContext + { + } +} diff --git a/src/tests/ilverify/TestDataLoader.cs b/src/coreclr/tools/ILVerification.Tests/TestDataLoader.cs similarity index 95% rename from src/tests/ilverify/TestDataLoader.cs rename to src/coreclr/tools/ILVerification.Tests/TestDataLoader.cs index ea490973255db8..bcd0f240b0c584 100644 --- a/src/tests/ilverify/TestDataLoader.cs +++ b/src/coreclr/tools/ILVerification.Tests/TestDataLoader.cs @@ -11,7 +11,7 @@ using System.Text; using ILVerify; using Internal.TypeSystem.Ecma; -using Newtonsoft.Json; +using System.Text.Json; using Xunit; using Xunit.Abstractions; @@ -36,7 +36,7 @@ class TestDataLoader /// [FriendlyName]_ValidType_Valid /// /// - public static IEnumerable GetTypesWithValidType() + public static IEnumerable GetTypesWithValidType() { var typeSelector = new Func((mparams, typeDefinitionHandle) => { @@ -54,7 +54,7 @@ public static IEnumerable GetTypesWithValidType() /// [FriendlyName]_InvalidType_[ExpectedVerifierError1]@[ExpectedVerifierError2]....[ExpectedVerifierErrorN] /// /// - public static IEnumerable GetTypesWithInvalidType() + public static IEnumerable GetTypesWithInvalidType() { var typeSelector = new Func((mparams, typeDefinitionHandle) => { @@ -110,7 +110,7 @@ private static List GetTestTypeFromDll(Func - public static IEnumerable GetMethodsWithValidIL() + public static IEnumerable GetMethodsWithValidIL() { var methodSelector = new Func((mparams, methodHandle) => { @@ -132,7 +132,7 @@ public static IEnumerable GetMethodsWithValidIL() /// 3. part: the expected VerifierErrors as string separated by '.'. /// E.g.: SimpleAdd_Invalid_ExpectedNumericType /// - public static IEnumerable GetMethodsWithInvalidIL() + public static IEnumerable GetMethodsWithInvalidIL() { var methodSelector = new Func((mparams, methodHandle) => { @@ -306,6 +306,10 @@ public PEReader Resolve(string simpleName) public abstract class TestCase : IXunitSerializable { + public TestCase() + { + } + public string TestName { get; set; } public string TypeName { get; set; } public string MethodName { get; set; } @@ -351,7 +355,7 @@ public class InvalidILTestCase : TestCase public override void Serialize(IXunitSerializationInfo info) { base.Serialize(info); - var serializedExpectedErrors = JsonConvert.SerializeObject(ExpectedVerifierErrors); + var serializedExpectedErrors = JsonSerializer.Serialize(ExpectedVerifierErrors, JsonContext.Default.ListVerifierError); info.AddValue(nameof(ExpectedVerifierErrors), serializedExpectedErrors); } @@ -359,7 +363,7 @@ public override void Deserialize(IXunitSerializationInfo info) { base.Deserialize(info); var serializedExpectedErrors = info.GetValue(nameof(ExpectedVerifierErrors)); - ExpectedVerifierErrors = JsonConvert.DeserializeObject>(serializedExpectedErrors); + ExpectedVerifierErrors = JsonSerializer.Deserialize(serializedExpectedErrors, JsonContext.Default.ListVerifierError); } public override string ToString() @@ -393,7 +397,7 @@ public class InvalidTypeTestCase : TestCase public override void Serialize(IXunitSerializationInfo info) { base.Serialize(info); - var serializedExpectedErrors = JsonConvert.SerializeObject(ExpectedVerifierErrors); + var serializedExpectedErrors = JsonSerializer.Serialize(ExpectedVerifierErrors, JsonContext.Default.ListVerifierError); info.AddValue(nameof(ExpectedVerifierErrors), serializedExpectedErrors); } @@ -401,7 +405,7 @@ public override void Deserialize(IXunitSerializationInfo info) { base.Deserialize(info); var serializedExpectedErrors = info.GetValue(nameof(ExpectedVerifierErrors)); - ExpectedVerifierErrors = JsonConvert.DeserializeObject>(serializedExpectedErrors); + ExpectedVerifierErrors = JsonSerializer.Deserialize(serializedExpectedErrors, JsonContext.Default.ListVerifierError); } public override string ToString() diff --git a/src/coreclr/tools/ILVerify/README.md b/src/coreclr/tools/ILVerify/README.md index ec92aad8b9ba1d..8b7c2c5df219ee 100644 --- a/src/coreclr/tools/ILVerify/README.md +++ b/src/coreclr/tools/ILVerify/README.md @@ -40,44 +40,13 @@ The code is split into three projects: ## Tests -To test the ILVerification library we have small methods checked in as .il files testing specific verification scenarios. These tests live under [src/tests/ilverify/ILTests](../../../tests/ilverify/ILTests). Tests are grouped into .il files based on functionalities they test. There is no strict policy here, the goal is to have a few dozen .il files instead of thousands containing each only a single method. +To test the ILVerification library we have small methods checked in as .il files testing specific verification scenarios. These tests live under [src/coreclr/tools/ILVerification.Tests/ILTests](../ILVerification.Tests/ILTests). Tests are grouped into .il files based on functionalities they test. There is no strict policy here, the goal is to have a few dozen .il files instead of thousands containing each only a single method. -The test project itself is under [src/tests/ilverify](../../../tests/ilverify) +The test project itself is under [src/coreclr/tools/ILVerification.Tests](../ILVerification.Tests) ### Building and Running Tests -General instructions to build this library can be found [here](https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/coreclr/testing.md). - -As quick snippet which should be enough to build CoreCLR -``` -./build.cmd -s clr+libs -c release -``` - -As the test project is marked with priority=1, simply building the test projects from the root of the project is not enough. Run the following to build ilverify tests: - -```shell -src/tests/build.(cmd/sh) release tree ilverify -``` - -It is important to not attempt to build the test project using `dotnet build` or `dotnet test`, as this will invalidate the state of the build and requires a full rebuild of both (see this [issue](https://github.com/dotnet/runtime/issues/43967)). - -To incrementally build the ILVerify tests in isolation, run the following: - -```sh -dotnet.(cmd/sh) msbuild ./src/tests/ilverify/ILVerificationTests.csproj /p:Configuration=Release -``` - -In order to run the tests, execute: - -on Linux -```sh -artifacts/tests/coreclr/linux.x64.Release/ilverify/ILVerificationTests.sh -coreroot=artifacts/tests/coreclr/linux.x64.Release/Tests/Core_Root -``` -on Windows -```shell -artifacts\tests\coreclr\windows.x64.Release\ilverify\ILVerificationTests.cmd -coreroot=artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root -``` - +To run tests, you can run `./dotnet[.cmd|.sh] test src/coreclr/tools/ILVerification.Tests/ILVerification.Tests.csproj` from the root of the repository. ### Defining Tests diff --git a/src/tests/ilverify/ILTests/AccessTests.ilproj b/src/tests/ilverify/ILTests/AccessTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/AccessTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/AccessTestsExtern.ilproj b/src/tests/ilverify/ILTests/AccessTestsExtern.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/AccessTestsExtern.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/AccessTestsFriend.ilproj b/src/tests/ilverify/ILTests/AccessTestsFriend.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/AccessTestsFriend.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ArrayTests.ilproj b/src/tests/ilverify/ILTests/ArrayTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ArrayTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/BasicArithmeticTests.ilproj b/src/tests/ilverify/ILTests/BasicArithmeticTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/BasicArithmeticTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/BranchingTests.ilproj b/src/tests/ilverify/ILTests/BranchingTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/BranchingTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/CallTests.ilproj b/src/tests/ilverify/ILTests/CallTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/CallTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/CastingTests.ilproj b/src/tests/ilverify/ILTests/CastingTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/CastingTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ComparisonTests.ilproj b/src/tests/ilverify/ILTests/ComparisonTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ComparisonTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/DefaultInterfaceMethod.ilproj b/src/tests/ilverify/ILTests/DefaultInterfaceMethod.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/DefaultInterfaceMethod.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/DelegateTests.ilproj b/src/tests/ilverify/ILTests/DelegateTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/DelegateTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ExceptionRegionTests.ilproj b/src/tests/ilverify/ILTests/ExceptionRegionTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ExceptionRegionTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/FieldTests.ilproj b/src/tests/ilverify/ILTests/FieldTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/FieldTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/FtnTests.ilproj b/src/tests/ilverify/ILTests/FtnTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/FtnTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/FunctionPointerTests.ilproj b/src/tests/ilverify/ILTests/FunctionPointerTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/FunctionPointerTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/GenericInterface.ilproj b/src/tests/ilverify/ILTests/GenericInterface.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/GenericInterface.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/InterfaceDefinition.ilproj b/src/tests/ilverify/ILTests/InterfaceDefinition.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/InterfaceDefinition.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/InterfaceImplementation.ilproj b/src/tests/ilverify/ILTests/InterfaceImplementation.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/InterfaceImplementation.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/LoadStoreIndirectTests.ilproj b/src/tests/ilverify/ILTests/LoadStoreIndirectTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/LoadStoreIndirectTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/LocalAllocTests.ilproj b/src/tests/ilverify/ILTests/LocalAllocTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/LocalAllocTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/NewobjTests.ilproj b/src/tests/ilverify/ILTests/NewobjTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/NewobjTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/PrefixTests.ilproj b/src/tests/ilverify/ILTests/PrefixTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/PrefixTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ReturnTests.ilproj b/src/tests/ilverify/ILTests/ReturnTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ReturnTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/RuntimeAsyncTests.ilproj b/src/tests/ilverify/ILTests/RuntimeAsyncTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/RuntimeAsyncTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ShiftTests.ilproj b/src/tests/ilverify/ILTests/ShiftTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ShiftTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ThisStateTests.ilproj b/src/tests/ilverify/ILTests/ThisStateTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ThisStateTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILTests/ValueTypeTests.ilproj b/src/tests/ilverify/ILTests/ValueTypeTests.ilproj deleted file mode 100644 index 8e8765d14a524d..00000000000000 --- a/src/tests/ilverify/ILTests/ValueTypeTests.ilproj +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/tests/ilverify/ILVerificationTests.csproj b/src/tests/ilverify/ILVerificationTests.csproj deleted file mode 100644 index f9f7e7521ffaff..00000000000000 --- a/src/tests/ilverify/ILVerificationTests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - $(BaseOutputPathWithConfig)ilverify\ - 1 - - true - true - true - true - - - - - - - - - - - - - - - - - false - Content - - -