diff options
author | Egor Bogatov <egorbo@gmail.com> | 2017-12-20 01:03:59 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-12-20 01:03:59 +0300 |
commit | cae8dd6dbd9253c0abbe2ab0a000ac617f116a78 (patch) | |
tree | b5b29229d2e0550e647181ae974d9dbd5355b491 /mcs/class/System.Core | |
parent | 05d5204da8f26549cf2e8ae387d907f6a4748823 (diff) |
[System.Core] Use corefx System.Linq tests (~25k tests) (#5515)
Diffstat (limited to 'mcs/class/System.Core')
-rw-r--r-- | mcs/class/System.Core/Makefile | 4 | ||||
-rw-r--r-- | mcs/class/System.Core/System.Core_xtest.dll.sources | 68 | ||||
-rw-r--r-- | mcs/class/System.Core/Test/System.Linq.Expressions/TestExtensions.cs | 35 | ||||
-rw-r--r-- | mcs/class/System.Core/corefx/SR.tests.cs | 16 |
4 files changed, 123 insertions, 0 deletions
diff --git a/mcs/class/System.Core/Makefile b/mcs/class/System.Core/Makefile index d0c6453a990..09990975ed6 100644 --- a/mcs/class/System.Core/Makefile +++ b/mcs/class/System.Core/Makefile @@ -52,6 +52,10 @@ BUILT_SOURCES = \ endif TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) +XTEST_LIB_REFS = System Facades/System.Threading.Tasks Microsoft.CSharp Facades/System.Text.RegularExpressions Facades/System.Reflection Facades/System.Reflection.Extensions Facades/System.Runtime.InteropServices.RuntimeInformation Facades/System.Reflection.Emit +# FEATURE_INTERPRET, FEATURE_COMPILE, NO_FEATURE_STATIC_DELEGATE +XTEST_LIB_FLAGS = -unsafe -d:FEATURE_COMPILE +XTEST_RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Collections.Immutable/src/Resources/Strings.resx include ../../build/library.make diff --git a/mcs/class/System.Core/System.Core_xtest.dll.sources b/mcs/class/System.Core/System.Core_xtest.dll.sources new file mode 100644 index 00000000000..276d32c5a77 --- /dev/null +++ b/mcs/class/System.Core/System.Core_xtest.dll.sources @@ -0,0 +1,68 @@ +../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs + +# System.Linq.Queryable +../../../external/corefx/src/System.Linq.Queryable/tests/*.cs +../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs + +# System.Linq.Expressions +../../../external/corefx/src/System.Linq.Expressions/tests/Array/*.cs:NewArrayBoundsTests.cs,ArrayAccessTests.cs,ArrayIndexTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Block/*.cs:NoParameterBlockTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Call/*.cs:CallTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Cast/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Conditional/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Constant/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Convert/*.cs:ConvertCheckedTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/DebuggerTypeProxy/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/DebugInfo/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Default/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/DelegateType/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/DynamicExpression/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/ExceptionHandling/*.cs:ExceptionHandlingExpressions.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Goto/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/ILReader/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/IndexExpression/*.cs:IndexExpressionTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Invoke/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Label/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Lambda/*.cs:LambdaTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Lifted/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/ListInit/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Loop/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Member/*.cs:MemberAccessTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/MemberInit/*.cs:BindTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/New/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/SequenceTests/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Switch/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Ternary/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/TestExtensions/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/TypeBinary/*.cs +#../../../external/corefx/src/System.Linq.Expressions/tests/Unary/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Variables/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Visitor/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Arithmetic/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Assignment/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Bitwise/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Coalesce/*.cs:BinaryCoalesceTests.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Comparison/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/Logical/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/BinaryOperators/ReferenceComparison/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/Unary/IncDecAssign/*.cs +../../../external/corefx/src/System.Linq.Expressions/tests/*.cs:CompilerTests.cs,StackSpillerTests.cs,ReadOnlyCollectionBuilderTests.cs +Test/System.Linq.Expressions/TestExtensions.cs + +# System.Linq.Expressions +../../../external/corefx/src/System.Linq.Parallel/tests/Combinatorial/*.cs +../../../external/corefx/src/System.Linq.Parallel/tests/Helpers/*.cs +#../../../external/corefx/src/System.Linq.Parallel/tests/QueryOperators/*.cs +../../../external/corefx/src/System.Linq.Parallel/tests/*.cs:WithCancellationTests.cs,PlinqModesTests.cs,ExchangeTests.cs,EtwTests.cs +../../../external/corefx/src/Common/tests/System/Threading/ThreadPoolHelpers.cs +../../../external/corefx/src/Common/tests/System/Diagnostics/Tracing/TestEventListener.cs +../../../external/corefx/src/Common/tests/System/ShouldNotBeInvokedException.cs + +# tests need System.Collections.Immutable.dll +../../../external/corefx/src/Common/src/System/Runtime/Versioning/NonVersionableAttribute.cs +../../../external/corefx/src/System.Collections.Immutable/src/System/Collections/Generic/*.cs +../../../external/corefx/src/System.Collections.Immutable/src/System/Collections/Immutable/*.cs +../../../external/corefx/src/System.Collections.Immutable/src/Validation/*.cs +corefx/SR.tests.cs diff --git a/mcs/class/System.Core/Test/System.Linq.Expressions/TestExtensions.cs b/mcs/class/System.Core/Test/System.Linq.Expressions/TestExtensions.cs new file mode 100644 index 00000000000..f3c97c212f5 --- /dev/null +++ b/mcs/class/System.Core/Test/System.Linq.Expressions/TestExtensions.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.CompilerServices; +using System.Threading; +using Xunit; + +namespace System.Linq.Expressions.Tests +{ + public static class CompilerTests + { + public static void VerifyIL(this LambdaExpression expression, string expected, bool appendInnerLambdas = false) + { + string actual = expression.GetIL(appendInnerLambdas); + + string nExpected = Normalize(expected); + string nActual = Normalize(actual); + + Assert.Equal(nExpected, nActual); + } + + private static string Normalize(string s) + { + Collections.Generic.IEnumerable<string> lines = + s + .Replace("\r\n", "\n") + .Split(new[] { '\n' }) + .Select(line => line.Trim()) + .Where(line => line != "" && !line.StartsWith("//")); + + return string.Join("\n", lines); + } + } +}
\ No newline at end of file diff --git a/mcs/class/System.Core/corefx/SR.tests.cs b/mcs/class/System.Core/corefx/SR.tests.cs new file mode 100644 index 00000000000..8e8ec8c12ac --- /dev/null +++ b/mcs/class/System.Core/corefx/SR.tests.cs @@ -0,0 +1,16 @@ +// +// This file was generated by resx2sr tool +// + +partial class SR +{ + public const string ArrayInitializedStateNotEqual = "Object is not a array with the same initialization state as the array to compare it to."; + public const string ArrayLengthsNotEqual = "Object is not a array with the same number of elements as the array to compare it to."; + public const string CannotFindOldValue = "Cannot find the old value"; + public const string CapacityMustBeGreaterThanOrEqualToCount = "Capacity was less than the current Count of elements."; + public const string CapacityMustEqualCountOnMove = "MoveToImmutable can only be performed when Count equals Capacity."; + public const string CollectionModifiedDuringEnumeration = "Collection was modified; enumeration operation may not execute."; + public const string DuplicateKey = "An element with the same key but a different value already exists. Key: {0}"; + public const string InvalidEmptyOperation = "This operation does not apply to an empty instance."; + public const string InvalidOperationOnDefaultArray = "This operation cannot be performed on a default instance of ImmutableArray<T>. Consider initializing the array, or checking the ImmutableArray<T>.IsDefault property."; +} |