* FileSystem.Unix.File.Move use rename in more cases, avoid link/copy when possible, improve performance on file systems that do not support hard links, such as FAT
* Adapt Unit Tests for accounting FileSystemWatcher events fired by FileSystem.Unix.File.Move implementation that use rename in more cases, avoiding link/copy when possible
Commit migrated from https://github.com/dotnet/corefx/commit/89b087ba5548338bb604db4e1cca0e42f8273e2b
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
* 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
* Share CFRunLoop for FSEventStreams in FileSystemWatcher on OSX
* Address review comments
* Add execution context capturing
* Fix nits
* Add some tests to check multiple watchers
* Address review comments
* Update FileSystemWatcher tests
* Add timeout for non-expected events
* Wrap FileSystemWatcher_File_Create_EnablingDisablingNotAffectRaisingEvent test in ExecuteWithRetry helper method and mark it with Outerloop
* Wrap FileSystemWatcher_File_Create_WatchOwnPath test in ExecuteWithRetry helper method
* Move disposing FileSystemWatcher instances to a finally section in FileSystemWatcher_File_Create_ForceLoopRestart test
* Use null-conditional operator before disposing
Commit migrated from https://github.com/dotnet/corefx/commit/8a06434b29599950571aa7975458ae5b465d1a0d
Change the underlying list type to be one that supports concurrent enumeration and mutation. Since mutation of Filters should be rare, and since we want to optimize for events firing and being verified against the filters, we use an immutable data structure. This also has a side benefit that now enumeration is allocation-free, whereas previously we'd allocate an enumerator every time we tried to match the pattern against the collection.
Commit migrated from https://github.com/dotnet/corefx/commit/677d5aef0d5ff8e6e882d8104fb0b2d49eea8627
* Filters Property and tests added
* Tests fixed for osx
* Tests fixed for netfx and error message improved
* Tests fixed for netfx and error message improved
* Added tests for insert,contains ,removeat, index of , to string and gettype
* ToString removed and asser.equal corrected
* Comments and overload of epectevent added for netcoreapp
* Removed duplicate code
* setup and execution separated
* Expected patshs argument added
* ExpectNoEvent Added, negative added for all the test , expected path problem corrected
* handler
* Storing tuple and Unexpected Events
* name added to return values tuples
Commit migrated from https://github.com/dotnet/corefx/commit/9f2377fcd4e46f2c607d03672ed0bb92fe9cb68e
* Cut string allocations for filtered watcher files
This changes the Win32 watcher code to not allocate strings until after we've matched the name and know that we're going to actually fire an event.
Unix code can be changed to encode into a temporary buffer to get a similar reduction. I'll open an up-for-grabs issue on it.
Flip a test to have expected in the expected argument.
* Move loop inside fixed statement
* Move locals inside fixed block.
Commit migrated from https://github.com/dotnet/corefx/commit/11a12e6538a0a024c3adfb944c3983c0d66c3768
* Use FileSystemName in FileSystemWatcher
- Uses newer spanified version in FileSystemName
- Doesn't allow extended match chars `<`, `>`, `"` as these are legal in Unix
* Plumb through the case sensitivity
* Update tests
* Tweak test for netfx
* Tweak the comment to be a bit more readable
Commit migrated from https://github.com/dotnet/corefx/commit/fcfb556ebf99ed551c02d0146c805e792b264cf2
* Moving PlatformDetection to Corefx.Private.TestUtilities assembly
The purpose of this change is to clean up all test projects instead of including the PlatformDetection code inside every test project, we’ll have it in the Corefx.Private.TestUtilities.
I have refactored the PlatformDetection to split the different implementation of Windows and Linux. If we need to do more refactoring there we can do it later as needed.
* Fix Linux BB
* Update the xunit package reference
* Fix wrong condition on one of the tests
* Update the ConditionalFact/Theory to use Type as a parameter
Commit migrated from https://github.com/dotnet/corefx/commit/878e2fcf5a9f1068015e5fada9231088663e3490
Because we are using inotify as the underlying implemenation for FileSystemWatcher on Linux, we can not only raise events for files or only raise events for directories, so we have to allow events for both to be raised regardless of NotifyFilters.
However, inotify does tell us that if an event occurred on a directory or on a file after the event has been raised. Since this is after filtering has already been done, we forward that event regardless of the NotifyFilters. This commit passes NotifyFilters to the RunningInstance that forwards the events and adds in some manual filtering after the fact. It isn't quite the same as filtering through the native call, but it does bring us closer to the Windows behavior.
Commit migrated from https://github.com/dotnet/corefx/commit/541f8e1535466c94b798e4e0177b834d1c3210da
This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled.
Commit migrated from https://github.com/dotnet/corefx/commit/eb2f543b189e8f7f9ae4c31e832ac9d3c22bb41a
* Remove SerializableAttribute from many CoreFX types that will not be serializable.
* Removes serialization tests for types that are no longer serializable and fixes serializing a couple of types. Includes marking some internal serializable types as public so that they'll be reflectible with .NET Native.
* Remove unneeded pragmas
* Update based on review comments
Commit migrated from https://github.com/dotnet/corefx/commit/6dd451f51451a7d0ceea6104b51bd17005e9a0e6