Commit Graph
141 Commits
Author SHA1 Message Date
Viktor Hofer ef7a0e676a Enable XUnit Analyzers (dotnet/corefx#38676)
* Enable XUnit Analyzers


Commit migrated from https://github.com/dotnet/corefx/commit/b8a7f34e1b64e5c594f591aa8683f34506eb9736
2019-07-05 22:50:57 +02:00
Viktor Hofer 0f67ef28f8 Make CoreFx.Private.TestUtilites RID-agnostic (dotnet/corefx#36207)
* Make CoreFx.Private.TestUtilites RID-agnostic

* Add version checks for other distros

https://github.com/dotnet/corefx/commit/dotnet/corefx@4f0d10773ccbb4849b869b6a0a73d5938f1804bd
Porting fix over into PlatformDetection.

* Build test lib in advance for VS support

* Disable pretest in AllConfigurations

Commit migrated from https://github.com/dotnet/corefx/commit/d3d144fad9b600a0fc1ca6fc7d65c247fddd9f04
2019-06-29 21:53:19 +02:00
Carlos Sanchez Lopez 0bbdb43e6c Fix for issue where iterating over directories ending in a dot would unexpectedly throw (dotnet/corefx#38489)
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
2019-06-20 19:58:33 -07:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
Carlos Sanchez Lopez 24545a60b2 Directory.Move behaves differently on Unix vs. Windows (dotnet/corefx#37121)
* 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
2019-04-23 13:46:50 -07:00
Viktor 7e4b5f9b01 Update src folder
Commit migrated from https://github.com/dotnet/corefx/commit/817c36a05ef2d92e59ce6f5a37e2be50076361b3
2019-04-02 19:21:57 +02:00
Tomas Weinfurt 953477d303 improve detection for ReadOnly_FileSystemHelper (dotnet/corefx#35531)
* improve detection for ReadOnly_FileSystemHelper

* feedback from review

* fix bad resolve


Commit migrated from https://github.com/dotnet/corefx/commit/7d4f25f1f503f91dd680d6e2c4cb556fd4f631e4
2019-02-26 15:11:39 -08:00
Viktor Hofer 5a2a56bb22 Disable failing IO PathFeatures tests on netfx
Commit migrated from https://github.com/dotnet/corefx/commit/99aa6e69c24a39d6b7588bc0ce29207267e92afc
2018-09-07 22:30:34 +02:00
Viktor Hofer b998fc821e Xunit 2.4 test changes
Commit migrated from https://github.com/dotnet/corefx/commit/591f0b5ba2c0ddcdad1a326eb327936cb2dd40d8
2018-08-23 19:55:27 +02:00
Viktor Hofer 8585939ef2 Update xunit to official 2.4.0 runner
Add necessary Test SDK assemblies

Enable test sdk props & targets only for netcoreapp


Commit migrated from https://github.com/dotnet/corefx/commit/f528b668fcd06efbde72a9510feb189e3988d795
2018-08-23 19:53:34 +02:00
Stephen Toub 4c9eb2ec25 Simplify built-in types across corefx tests (dotnet/corefx#30660)
Commit migrated from https://github.com/dotnet/corefx/commit/7ae1a252d7e68c5513d2658de7a401c37e9b0504
2018-06-25 22:42:04 -07:00
Dan Moseley a0fb10a2aa Fix uap failures in IO (dotnet/corefx#29816)
* Fix uap failures in IO

* Fix remaining UAP failures

* Fix RuntimeInfo tests

* Var's


Commit migrated from https://github.com/dotnet/corefx/commit/27e718dfc232c8516c69275c0444d4f81d05c3e5
2018-05-25 13:56:24 -07:00
Jeremy Kuhne bf9d6c0a95 Enumerating strings should retain trailing separators (dotnet/corefx#29413)
* Enumerating strings should retain trailing separators

This is a regression introduced by the enumeration overhaul. We didn't have tests that covered trailing separators in the specified root directory when enumerating. They should be retained as is.


Commit migrated from https://github.com/dotnet/corefx/commit/e5b4059217c9958662d8f7bc6749c8a051f55cfb
2018-05-01 12:03:34 -07:00
Jeremy Kuhne 124dbf3655 Populate the original path when creating directories (dotnet/corefx#29155)
* Populate the original path when creating directories

The DirectoryInfo class should be the same when calling Directory.Create() as
it would be creating DirectoryInfo directly then calling create on it.

* Use Combine instead of Join (for NetFX)

* Fix test

The different behavior with desktop is only with the Directory.Create
path.


Commit migrated from https://github.com/dotnet/corefx/commit/2c3bdc61c1bdae804ce862d12285934acbc85bd6
2018-04-20 15:15:08 -07:00
Anirudh Agnihotry 4891d8acf5 Accessing an accessible drive (dotnet/corefx#29010)
Commit migrated from https://github.com/dotnet/corefx/commit/e076f6b8aa94d45022ecbf29d5c485e87375823e
2018-04-11 11:48:31 -07:00
Anirudh Agnihotry ba5dcf0853 Tests for Directory Exists (dotnet/corefx#28732)
Commit migrated from https://github.com/dotnet/corefx/commit/f759243d724f462da0bcef54e86588f8a55352c6
2018-04-02 16:06:45 -07:00
Anirudh Agnihotry 281ee60d7d Disabling test on alpine (dotnet/corefx#28401)
* Disabling test on alpine

* Alpine Detection added to platformDetection

* ref and win updated


Commit migrated from https://github.com/dotnet/corefx/commit/c239771fe12ad9e591fc288a8bf8757c4dba84a8
2018-03-23 09:22:35 -04:00
Anirudh Agnihotry 4a52e4c4e0 Fixing NonBreakingSpace test on OSX using FSAssert (dotnet/corefx#28094)
Commit migrated from https://github.com/dotnet/corefx/commit/a89e7ad8e09fe133fefd76aea902232892453561
2018-03-15 12:45:40 -07:00
Jeremy Kuhne 231f26e3dd Test changes for System.IO.FileSystem (dotnet/corefx#27923)
* Test changes

- Add new tests for more coverage on enumeration
- Re-enable tests

* Add missing assert


Commit migrated from https://github.com/dotnet/corefx/commit/0e70b43de9d13a629082ec878411c4662557e9e1
2018-03-09 20:01:56 -08:00
Anirudh Agnihotry 2a687498bb Test for enumerateDirectories NonBreaking space (dotnet/corefx#27762)
Commit migrated from https://github.com/dotnet/corefx/commit/61aaf07bf486e457fa6d3f19f8335b0d536d7bca
2018-03-07 16:59:14 -08:00
Anirudh Agnihotry 6dff4e5f8e enable failing tests due to paths (dotnet/corefx#27681)
Commit migrated from https://github.com/dotnet/corefx/commit/91b311e840646cd343db5cb97622b53ce14334e3
2018-03-05 10:25:12 -08:00
Stephen Toub ff964cd53c Disable failing System.IO tests
Commit migrated from https://github.com/dotnet/corefx/commit/303922a96cc14b3db2150c01f44ffe5dacb18fee
2018-02-28 09:03:28 -05:00
Jeremy Kuhne 973cec3dd6 Update tests for Path changes (dotnet/corefx#27348)
* Update tests for Path changes

Updates for https://github.com/dotnet/coreclr/pull/16478

* Add back Unix active issue (wishful thinking that this would get the same error on Unix)

* Address feedback


Commit migrated from https://github.com/dotnet/corefx/commit/92afa6ec21817739ebf45cd66b4569a03b54d4c0
2018-02-22 12:13:29 -08:00
Jeremy Kuhne 985d730865 API tweaks to match latest updates to spec (dotnet/corefx#27102)
* API tweaks to match latest updates to spec

Add a few new tests

See dotnet/corefx#25873

* Properly clear state when enumerating on Unix.
Make sure we don't include special directories in subdir processing. Add test.
Collapse helper that was only called in one place, and remove dead one.


Commit migrated from https://github.com/dotnet/corefx/commit/1c9cd8118abfa13165d88a4e660fbdcc6c2ebc4c
2018-02-13 21:49:57 -08:00
Anirudh Agnihotry 04c6f66b04 Fix tests for path validation changes on Windows And Unix (dotnet/corefx#25788)
Commit migrated from https://github.com/dotnet/corefx/commit/fc0e922bb1d5e92414acb6869d8a7aa3502f6b1c
2017-12-08 14:41:55 -08:00
Stephen Toub e492fe23ba Disable failing tests after path validation updates
Commit migrated from https://github.com/dotnet/corefx/commit/c0817aec1c3fbf9ee8bdbba286edbf1c9c3c64c4
2017-12-03 12:08:32 -05:00
Jeremy Kuhne 3307889b0c Fast file enumeration for Windows (dotnet/corefx#25426)
* Fast file enumeration for Windows

Implements an optimized, low allocation replacement for file enumeration on Windows. In preliminary tests this improves performance at least two fold, particularly for recursive searches.
Removes aggressive filter validation.
Copies and cleans up filename matching code from FileSystemWatcher.
Add length setter for ValueStringBuilder.
Remove Unix .. check for enumerable.

Commit migrated from https://github.com/dotnet/corefx/commit/eb0d4388c339288a589bdd7f5e0c9fcd61da4362
2017-11-30 15:46:56 -08:00
Krzysztof Wicher f3f741eade Use distro detection from Microsoft.DotNet.PlatformAbstractions (dotnet/corefx#24531)
Commit migrated from https://github.com/dotnet/corefx/commit/4bf90198c5e7710ea67b7c1b467e859ec8bb78e5
2017-11-03 14:30:47 -07:00
Eric Mellino f717af1490 Disable RecursiveDelete_DeepNesting (Issue dotnet/corefx#24242). (dotnet/corefx#24243)
Commit migrated from https://github.com/dotnet/corefx/commit/6cee65c560f1b853f67c7871345c0feacd95a070
2017-09-25 20:12:23 -07:00
Dan Moseley e24a0bcdbc Disable RO-filesystem tests on RH69 (dotnet/corefx#23842)
* Disable RO filesystem tests on RH69

* Disable


Commit migrated from https://github.com/dotnet/corefx/commit/3f6fc6bdb578cfa06324735a2fcab09decced96a
2017-09-06 21:47:40 -07:00
Tarek Mahmoud Sayed 45ebc07bd8 Enable detecting Red Hat distors in PlatformDetection (dotnet/corefx#23775)
* Enable detecting Red Hat distors in PlatformDetection

* Add RedHat properties to PlatformDetection class


Commit migrated from https://github.com/dotnet/corefx/commit/f0a9551d38ddf76a02c4c65cce74559263466ddd
2017-09-05 15:03:06 -07:00
Dan Moseley 1b50c157a6 Disable RecursiveDelete_DeepNesting for desktop (dotnet/corefx#23757)
Commit migrated from https://github.com/dotnet/corefx/commit/499e099dc8e9e8495b602a623c96c8695d5a4d53
2017-09-01 16:16:20 -07:00
Jeremy Kuhne d9d8cd8b89 Add tests to validate we don't fall over enumerating files that just … (dotnet/corefx#23528)
* Add tests to validate we don't fall over enumerating files that just cross the legacy MAX_PATH barrier. As we do special logic on Windows to support long paths this is an important boundary to test. While these path lengths don't have special meaning outside of Windows, we'll always run them they should still pass .

* Conditionalize tests for long path support

NetFX needs to have the long path functionality enabled to run these
tests.


Commit migrated from https://github.com/dotnet/corefx/commit/424823b9123729ec990b31666177b6b17905eb1c
2017-08-25 17:08:27 -07:00
Jeremy Kuhne 5aaa274e86 Improve directory deletion stack pressure (dotnet/corefx#22596)
* Improve directory deletion stack pressure

Recursive directory deletion used particulary large frames and would easily stack overflow with deeply nested directories (especially so when running unoptimized bits).

Reduced the stack frame size by passing the native struct used by ref and removing unnecessary throw/catch blocks. Other optimizations and logic clarfications.

Made the native struct blittable and introduced a helper struct set for fixed size blittable strings.

* Update comments

* Use span prototype

* Switch to ReadOnlySpan

* Update packages

* Mark System.Memory as inbox on UAP

* Packaging fixes

* Factor out package configs


Commit migrated from https://github.com/dotnet/corefx/commit/1d3cc0417753bf0a436824abfeff9c3c1712f63f
2017-08-03 16:19:02 -07:00
Santiago Fernandez Madero e8aa3151cc Re-enable long path tests for Uap (dotnet/corefx#22505)
Commit migrated from https://github.com/dotnet/corefx/commit/b2b47908656ef3b7dcaef62fb342e12aee5f34c4
2017-07-21 15:30:49 -07:00
Stephen Daudell 0d59144bf9 Remove ActiveIssue for PathTooLongException related tests. (dotnet/corefx#22467)
* Remove ActiveIssue for PathTooLongException related tests.

* Fix for *nix and OS X tests.


Commit migrated from https://github.com/dotnet/corefx/commit/87e0f78e812f6fe42413cae99d6f83ce81cd9fc9
2017-07-20 19:16:22 -07:00
Jeremy Kuhne 1450695794 Nested directories were too deep (dotnet/corefx#22448)
* Nested directories were too deep

Nesting directories with Windows paths were over 800
levels deep, causing intermittent issues with stack overflows.
Making directory segments longer to mitigate.

* Use "N" format for guids per feedback


Commit migrated from https://github.com/dotnet/corefx/commit/27886bcb3d016a744e7461b3e378e7261230960f
2017-07-19 22:51:00 -07:00
Nina Chikanov 4b3e622648 Remove ActiveIssue(21358) on WhiteSpace changes (dotnet/corefx#22449)
Changes fully merged in, no longer active issue

Commit migrated from https://github.com/dotnet/corefx/commit/9714cced3ff1e4c525ceecadb5bfa74ce00eefa3
2017-07-19 22:04:21 -04:00
Jeremy Kuhne ffdd2b2904 Fix test assertions for long paths (dotnet/corefx#22393)
We don't preemptively check path length any more. The OS errors we
get back can either be PathTooLong or NotFound depending on the
environment and requested path.

Commit migrated from https://github.com/dotnet/corefx/commit/65ba2083ae5c16163465a1e06aca88b81232b333
2017-07-18 13:57:03 -07:00
Stephen Daudell c247a3e484 Update tests for long path support in CoreCLR (dotnet/corefx#22190)
* Updated tests to correspond to dotnet/coreclrdotnet/corefx#12786.

* Addressed review feedback.


Commit migrated from https://github.com/dotnet/corefx/commit/b6b0a3c54100ea93375c6a8b6646f1e9bf13c6b0
2017-07-17 17:24:49 -07:00
Nina Chikanov 21eb406937 Update tests for pending whitespace trimming changes (dotnet/corefx#22341)
* Update tests for pending whitespace trimming changes coreclr/dotnet/corefx#12862

* Fix attribute for ActiveIssue


Commit migrated from https://github.com/dotnet/corefx/commit/88ece1d0c6a247c669831f15929d2bb271bba26e
2017-07-17 17:11:09 -07:00
Stephen Daudell f1d375cf9b Remove preemptive checks for path being too long in CoreFX (dotnet/corefx#22131)
* Removed preemptive checks for path being too long.

* Updated tests to catch proper exception.

Fixed an issue in IOInputs.cs where MaxLongPath was not being initialized correctly.

* Rework improper test change.

* Addresed some feedback and hopefully fixed failing unit tests.

* Go back to expecting PathTooLongException on all platforms for this test.

* Adjusted to handle either exception on non netfx.


Commit migrated from https://github.com/dotnet/corefx/commit/f2e440450e8b52317f08c21fe66f70141c9e933c
2017-07-12 16:09:00 -07:00
t-nichik 6dd2e79756 Split TrailingWhiteSpaceExistence into two tests
The test depended on two different IOInputs functions
(GetSimpleWhiteSpace and GetWhiteSpace). Previously didn't notice so
split the test into two to address both functions.


Commit migrated from https://github.com/dotnet/corefx/commit/ccff43e892dac662b67327aad3d7e20625f3f2bc
2017-07-06 16:50:08 -07:00
t-nichik 8162a540bc Convert Tests to Theory
Converting tests from Fact to Theory to make it easier to recognize
which tests are failing instead of spending time sorting through
ambiguous test output.


Commit migrated from https://github.com/dotnet/corefx/commit/343e20e1452d9eb0267f4e28a3650417a7fb6ae6
2017-07-06 13:37:26 -07:00
Maggie Tsang dd6f456515 Read only file system delete tests (dotnet/corefx#21684)
* Read only file system delete tests

Tests to validate behavior for directory and file delete for read only
file systems on Unix.

* Addresses feedback


Commit migrated from https://github.com/dotnet/corefx/commit/b61fa81efee8003f34dfed3bfbe093e45ac06fed
2017-06-30 10:17:07 -07:00
Jeremy Kuhne 6563c7348e Add converter from IEnumerable to TheoryData (dotnet/corefx#21671)
* Add converter from IEnumerable to TheoryData

Manipulating test input data in IEnumerable format is
desirable, but a bit awkward to get into IEnumerable<object[]> format that [Theory] expects.

Add test project to new test project. :)  Change a test in
System.IO.FileSystem to theory with new extension.

* Fix performance test project

* Run the UpdateConfigurations target

* Add netfx reference


Commit migrated from https://github.com/dotnet/corefx/commit/94b2a85c837a536096af1a7bc3812feef45e9ecb
2017-06-28 21:15:33 -07:00
Krzysztof Wicher 307239626a Fix System.IO.FileSystem UAP failures (dotnet/corefx#21277)
Commit migrated from https://github.com/dotnet/corefx/commit/7d5d44a6a905624b066a768c68e413b6d40be9e0
2017-06-20 17:27:21 -07:00
Jeremy Kuhne 7181dc2b9b Clean up attribute code (dotnet/corefx#21149)
- Cleans up and optimizes file attribute retrieval
- Adds wrapper for disabling media prompt and wraps correctly in enumerator

This is backlog work that is important for taking the next steps to removing our WinRT code.

Commit migrated from https://github.com/dotnet/corefx/commit/0cdb9f36c76927f8a2fcf57641c64e8985a48e4d
2017-06-16 16:38:02 -07:00
Jeremy Kuhne 07a7560678 Handle escaping in Unix file enumeration (dotnet/corefx#20784)
* Handle escaping in Unix file enumeration

We try and align with Windows, so we'll escape out [ and /.

Adds a bunch of tests and issues for other cases that we don't
match Windows behavior.

* Clarify comments, move one case

For completeness I ran everything through RtlIsNameInExpression to
validate the "correct" results. I've commented appropriately.

I moved one test to the "normal" block that I misplaced.

* Optimize the escaping a bit

* Improve perf further

* Whoops, miscopied

* More feedback


Commit migrated from https://github.com/dotnet/corefx/commit/059eec8df974867d773178d5553ca15a487a2e45
2017-06-08 10:53:46 -07:00
Jeremy Kuhne 9ff1ec49c4 Fill out FileSystemInfo state when enumerating (dotnet/corefx#20716)
* Fill out FileSystemInfo state when enumerating

On Windows FileSystemInfos are filled in with state as we have
all of the state from FindFirstFileEx.

* Add more tests

Refactor Time tests and add cases for refresh state.
Fix positive attribute assertion.

* Missed one of the cases

* Tweaking the time tolerance didn't succeed.

Putting it back to -3 seconds.

* Refactor tests

Gets coverage consistent
Fixes test bug in DirectoryInfo where it was creating files for invalid attributes

* Address feedback


Commit migrated from https://github.com/dotnet/corefx/commit/9468aedba81b7d0b43f5545fc840a53544164694
2017-06-07 19:53:15 -07:00