Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process. Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.
This helps measurably with test performance. Consider the System.ComponentModel.Annotations test suite. On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified. With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds. This should help measurably with CI time in coreclr.
Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
* dotnet/corefx#35491 Fixes issue with BinaryFormatter.Deserialize throwing other exceptions than those specified in the documentation (only supposed to throw SerializationException or SecurityException).
* Update UnitySerializationHolderTests to test the expected behaviour of BinaryFormatter.Deserialize. Fix naming error in SerializationGuardTests.
Commit migrated from https://github.com/dotnet/corefx/commit/1736bfa5f06d4d3a60742142f0aaf601bd4db788
However, I'm not enabling the rule permanently, as it disagrees with VS IDE0055 about the spacing around semicolons at the end of empty while and for loops.
Because this also impacts `for (;;)` loops, I also searched and replaced those with `while (true)`, to standardize on that across the codebase.
Commit migrated from https://github.com/dotnet/corefx/commit/93285e4511a9656a30b92b8b6a9088608aac40e0
Mechanical/automated change. The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.
Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
* Enable xUnit2000 analyzer
This commit enables xUnit2000 (Constants and literals should be the expected argument) and apply fixes for the existing violating codes.
* a Massive commit fixing xUnit2000
* fixing some 2003 errors
* Fix mistakes
* Fix missed errors for unix
Commit migrated from https://github.com/dotnet/corefx/commit/93d7aa1c1737b6da29d04b78557215e18eb786d4
* Removed null checks on value types and enabled xunit 2002
* Updated Fill_OpenDataReader_Throws to use range check
Updated Fill_OpenDataReader_Throws to use range check for passing path
* Removed uneeded asserts and updated others
- Removed any assert for a valuetype where it was succeeded by a value type assertion (e.g. Assert.Equal(1, 1))
- Updated reflection tests to check flags for the specified scenario
* Update src/Microsoft.VisualBasic.Core/tests/FileSystemTests.cs
Co-Authored-By: Jeremy Barton <[email protected]>
* Update src/System.Reflection/tests/AssemblyNameTests.cs
Co-Authored-By: Jeremy Barton <[email protected]>
* Fixed failing reflection tests and removed Assert.NotNull for enum
* Pulled ruleset up from master to merge
* Cleaned up assert ordering for TestGuid
* Updated TestResponseWithoutContentEvents
- Asserted for 200 OK based on response from DefaultAzureServer + EmptyContentHandler
Commit migrated from https://github.com/dotnet/corefx/commit/c96e389f803b043753558878fefb575f3f85c934
* Replace "Assert.Equal(true, " with "Assert.True("
* Replace "Assert.Equal(false, " with "Assert.False("
And fix a few Assert.Equal(true cases that deal with objects and thus need to be reverted.
* Replace "Assert.StrictEqual(true, " with "Assert.True("
* Revert a few changes where true/false was being compared to object
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/1296bc8386a7283e319ddf723282f16651f9ea5f
* Making Exceptions serializable
* Remove EventLog serialization exceptions from tests since they won't work on non-Windows platforms
* Fix build and add internal exceptions as well
* Add parameter-less constructor to RethrowException
* Adding PR Feedback
* Fix allConfigurations build
Commit migrated from https://github.com/dotnet/corefx/commit/7075587321a1b6b59248b1a6c7ea04fc803eab96
* Factor out repo restore into seperate props/targets
* Use configuration system msbuild sdk
* Remove XUnit.Runtime.depproj
* Remove TargetGroup usages in test projects
* Fix ILLink configuration
The ILLink package contains netcoreapp2.0 assets which are compatible
with netstandard2.0. Removing the old TargetFramework to restore
successfully.
* Remove usages from TargetGroup in Directory.Build.props
* Remove dead net4* configurations
* Change tests.builds to tests.proj sdk proj
* Make externals dir proj an sdk project
* Consume Microsoft.DotNet.CoreFxTesting as an msbuild sdk
* Use runtimeconfig.template.json
* Remove SupplementalTestData
* Map shared framework version to product version
* Stop binplacing tests
* Move some tool depprojs to targets during restore
* Remove dead code
* Use PackageReference instead of RefFromRuntime in test
* Disable using an apphost
* Copy compression testdata manually cause unicode bug
* Remove target batching in optimizationData
* Reference packaging tools from CoreFx.Private.TestUtilities
Commit migrated from https://github.com/dotnet/corefx/commit/c4c1985531cc1f25c805bbc4801b85c98e0dfee0
* React to APICompat changes enabling reverse APICompat for facades
* Fix UAP and NETFX reverse APICompat issues
* Fix reverse APICompat baseline for allconfigurations build
* Manually update to latest APICompat
* Manually update to latest CoreCLR and fix issues
* Baseline System.Threading.Tasks
* Revert "Manually update to latest CoreCLR and fix issues"
This partially reverts commit dotnet/corefx@ee800617b6.
I'm keeping the baseline changes which will be needed when we get a new update.
* Temporarily baseline DiagnosticCounter API gaps
This can be removed when get a new CoreCLR
That's currently blocked due to regressions in tests.
Commit migrated from https://github.com/dotnet/corefx/commit/035343743c5a7f67be8a2a2f36913a3c43893b76
* Clean up lots of string.Format usage
This PR does a few things:
- Adds new SR.Format overloads, in particular to support accepting an IFormatProvider as the first argument.
- Fixes a bunch of calls to string.Format that should have been using SR.Format. This not only helps in AOT builds where we want to be able to more cleanly remove resource strings, it enables easier auditing of the remaining string.Format uses to determine whether there are more appropriate implementations.
- Replaces some string.Format uses, in particular in asserts, with easier to read and maintain string interpolation
- Replaces some string.Format uses with string concatenation where it's simple and cheaper
- Fixes a bunch of SR.Format(SR.Something) calls where the SR.Format part is extraneous and should just be removed.
- Replaces a bunch of Debug.Assert(false, ...) calls with Debug.Fail(...). This isn't directly related to string.Format, but I started this cleanup as part of cleaning up asserts that were using string.Format, and then ended up accidentally merging the chain into the same commit, and decided it was simple enough that I should just leave it rather than trying to separate it out again.
* Address PR feedback
* Fix breaks due to lower netstandard builds
Commit migrated from https://github.com/dotnet/corefx/commit/a6f76f4f620cbe74821c6445af3f13e048361658
A corrupted BinaryFormatter stream can result in a BinaryObjectInfo getting constructed before the ObjectManager is constructed, resulting in the BinaryObjectInfo not having a reference to the ObjectManager. Attempts to use it then hit a null reference exception.
Commit migrated from https://github.com/dotnet/corefx/commit/7622efd2dbd363a632e00b6b95be4d990ea125de
* Auto-generate the reference assemblies
* Add back type forwards.
* Revert "Add back type forwards."
This reverts commit dotnet/corefx@3acf74aabb.
* Add back TypeForwardedTo in .Forward.cs files
* Add new type forward files to the csproj files
* Add back if-defs and move TestUtilities comment from ref to source
* Remove duplicate definitions, delete unnecessary manual files,
* Fix build breaks
* Add back missing AsyncMethodBuilderAttr to S.Runtime ref
* Fix typo between XmlDocument and XPath.XDocument
* Add type forward fild missed from previous commit
* Fix ECDiffieHellmanCngPublicKey internal ctor for netfx 4.6.1
* Remove "this type was moved to comments" from the type forwards.
* Add back the Xml and Debugger* attributes to Xml.ReaderWriter
* Add back struct layout attributes
* Add back attributes missing (highlighted from api compat)
* Add missing toolbox item attribute in s.data.common.
* Add missing struct layout attributes and remove unnecessary additions
* Add back InterfaceTypeAttribute
Commit migrated from https://github.com/dotnet/corefx/commit/16689aa0a933517dc45465fc6edb6223222414a6
* Make System.Runtime.CompilerServices.Unsafe inbox
Fix a couple places where we wanted to use it from other inbox assemblies but couldn't.
Unsafe remains as a package and newer versions of Unsafe will replace the inbox Version,
permitting us to add API over time.
* Update Rune tests to use TryEncodeToUtf8Bytes directly
* Add temporary suppression to package tests
Commit migrated from https://github.com/dotnet/corefx/commit/9074d9f5b513a95b7eac9ba1112069c29230d1d2
* Add SyncSortedList serialization tests and remove SyncRoot
* Disable blob comparison for SyncSortedList
On UWP we get different blobs for SyncSortedList as reflection behaves
differently as the amount of types that we tests is less than in
.NET Core and .NET Framework. The order of fields that are serialized
into the payload are different in such a case.
Therefore we just disable the blob comparison for this type entirely.
Commit migrated from https://github.com/dotnet/corefx/commit/de591233c04efa019ea2aed0a8fc5181f6d4210b