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
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
* Re-enable xunit warning 1026 (unused theory arguments)
Some of these were addressed by explicitly discarding theory arguments, generally in cases where either a) the argument was being used as a description to aid in debugging failures, or b) the argument was part of a member data that was used by some theories and not by others all sharing the same member data.
However, there are quite a few legitimate bugs being fixed here, enough that highlights it's worthwhile to have the rule enabled. Some are cases where the argument was supposed to be used but wasn't. Some are cases where the argument isn't used at all, and in many cases where we end up running the same test over and over and wasting cycles. Some are cases where we're unnecessarily including irrelevant inputs to the tests and making the input data more complicated than it needs to be. Etc.
(Along the way, I also fixed some cases where VS was warning about lambdas being used instead of local functions, and in cases where I agreed I fixed them, via auto-fixers.)
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/daf93ee0e5e5233141eb762c64b6049cfd7d123e
* Fix ordering of keywords in member signatures
* Add StyeCop.Analyzers
Most rules are disabled. Many of them we'll want to leave disabled, however there are a handful it'll be good to enable over time.
* Use built-in type alias
* Fix straggling stylecop warnings in all configurations
* Replace tabs with spaces
Commit migrated from https://github.com/dotnet/corefx/commit/a12c557a72988070b8624cc7ecc46899629895c4
* 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
Issue
In Windows, when iterating over the files of a directory whose name ends in a dot, the iteration fails by throwing an unexpected exception, even when using the proper prefix "\\?\" for the full directory path.
Fix
Add a new boolean argument at the end of the enumeration function signatures that will indicate if the passed path is normalized or not. If it is normalized (which only happens when the path is created by us, not by the user), then we can create the handle using that path. If it's not normalized, we attempt to get its full path before creating the handle, which will throw if a full path can't be obtained.
Added a new unit test to verify the fixed behavior and updated some others whose behavior changed with this fix.
Commit migrated from https://github.com/dotnet/corefx/commit/8e95261ef710e0df980a6d46923eb3c0e8b0bc83
Assert.Equals on arrays boxes each element and then performs a complex
operation to compare each box. This is slow for large arrays, and extremely
slow for large arrays on checked CoreCLR.
Use AssertExtensions.Equal for large arrays in File.Copy tests to make
them reasonably fast on checked CoreCLR.
Commit migrated from https://github.com/dotnet/corefx/commit/c53300f0696c4817bc06a8ef8711a0bb46f362ec
* 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
In the 1903 release of Windows 10 the deletion behavior has changed. Previously, the filename would be reserved until all open handles were closed after being marked for deletion. Now the filename is immediately released.
Commit migrated from https://github.com/dotnet/corefx/commit/a4cf9a480b34a00e11201e932f7152c63b99b85f
* Directory.Move behaves differently on Unix vs. Windows
We will now throw an exception in Unix platforms like in Windows, if the destination path already exists.
* Modifying ExistingDirectory test method that verifies Move overwrite so its called by all platforms.
We already had a test method that tests Move when the destination path exists. I simply removed the platform attribute that restricted it to Windows and renamed the test method so its universal (as opposed to platform specific).
Commit migrated from https://github.com/dotnet/corefx/commit/f9c85c033361ee5bfcf43707dc6d29731f8bc3cb
* Added support for UF_HIDDEN flag on macOS and FreeBSD (dotnet/corefx#29323)
* Changes based on review
* Reverted UserFlags field
* Sorted include in csproj
* Changed comparison style
* Reverted UserFlags field
* Fixed parentheses
* Changes based on PR review
* Add missing newline
* Add missing newline
Commit migrated from https://github.com/dotnet/corefx/commit/b37f0185ac05c9431389f333f5b2b0fc5fe93e6a
* Disable Media test on NETFX
* Fix S.R.E for Uapaot
* Disable varargs for PN
* missing method 'AssemblyLoadContext..ctor(bool)
* IO test
* Fix UapAot RuntimeInformation tests
* Set correct tfm for AppDomainTests
* Merge driveonly tests into one
* Revert math
Commit migrated from https://github.com/dotnet/corefx/commit/0a751af9afe28042a720411925e6e6c55bdc10cc
* long name test
* typo
* typo
* Enable test as WSL fixed
* Disable test for WSL
* Test update
* Fix tests
* Properly reuse buffer length
* Fix actual bug
* Tests for create on Linux
* Extend to unix
* netfx
* Update interop file
Commit migrated from https://github.com/dotnet/corefx/commit/23521cc75428e38b8ff62cbac188c86b32184d42
* test added
* rearranging order for if statements
* reducing thread sleep time and reverting millisecond test change
* adding comment
* removing comment, adding tick equality check, failing if not able to create file with non-zero nano or milli second
* correcting test for hfs system
* NanoSeconds -> Nanoseconds, Millisec -> milliseconds
HFs assert converted to false
Commit migrated from https://github.com/dotnet/corefx/commit/83e468591a0212f109c179c2f4b75ef03c92432b
* Initial work on implementing File.Move with overwrite
* Add unit tests for File.Move and FileInfo.MoveTo with overloads for overwrite
* Add MoveFile overload with overwrite parameter to Unix
* Correct namespace for Unix function call
* Separate corefx-specific tests
* Move corefx-specific tests to correct ItemGroup
* * Consolidate error blocks
* Pass named argument for readability
* Remove MOVEFILE_WRITE_THROUGH
* Remove const declaration for MOVEFILE_WRITE_THROUGH since it's not used.
Commit migrated from https://github.com/dotnet/corefx/commit/40364e539572e9dad9c8a2eb165fc9af28e5664a