Commit Graph
63 Commits
Author SHA1 Message Date
Stephen ToubandJan Kotas ccf6aedb63 Address more issue numbers in the code (#1888)
* Address more issue numbers in the code

Replaced a bunch of unadorned issue numbers with links, so we know which repo the issue is for.  In some cases the repo was named, but for consistency I still replaced it with a link.

In some cases, in particular where the issue had been closed saying effectively "we're not going to do anything here", I removed TODOs and the associated issue numbers.

In a few cases, the TODO and issue number was to say "we should do X when Y is fixed", so I did X since Y was fixed.

* Apply suggestions from code review

Co-Authored-By: Jan Kotas <[email protected]>

* Address PR feedback

* Fix OrderedEnumerable by using MemoryExtensions.Sort

Co-authored-by: Jan Kotas <[email protected]>
2020-01-18 00:52:17 -08:00
Roman Marusyk 25a6514dc0 Consolidate .netcoreapp.cs test files in System.IO.* (dotnet/corefx#42329)
* Consolidate .netcoreapp.cs files because System.IO.* projects is no longer cross-compiled



Commit migrated from https://github.com/dotnet/corefx/commit/1499cbb3e319ec733c09202fd2501292c1d3fe3b
2019-11-03 15:31:21 -08:00
Stephen Toub 7ff3a1100a Reduce RemoteInvoke usage in tests (dotnet/corefx#41741)
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
2019-10-15 12:09:06 -04:00
Stephen Toub 60d1224ddd Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (dotnet/corefx#40113)
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
2019-08-07 21:07:58 -04:00
Stephen Toub bf9054c38c Re-enable xUnit1025 (duplicate InlineData) (dotnet/corefx#39737)
Commit migrated from https://github.com/dotnet/corefx/commit/47d96f89df41ce18d3ba77b38007ec68f7f66fc6
2019-07-25 10:45:20 +02:00
Stephen Toub cd3ca6f991 Re-enable xunit warning 2004 (dotnet/corefx#39698)
* 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
2019-07-23 17:05:15 -04:00
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 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
Viktor 7e4b5f9b01 Update src folder
Commit migrated from https://github.com/dotnet/corefx/commit/817c36a05ef2d92e59ce6f5a37e2be50076361b3
2019-04-02 19:21:57 +02:00
Dávid Kaya 7470570d4b Added support for UF_HIDDEN flag on macOS and FreeBSD (dotnet/corefx#29323) (dotnet/corefx#34560)
* 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
2019-03-28 09:56:08 -04:00
Anirudh Agnihotry 9cf32412ae setnanoseconds disabled for mac (dotnet/corefx#34870)
Commit migrated from https://github.com/dotnet/corefx/commit/d68361f04cd8851b0e6fa58b5a7bd429cd26db58
2019-01-25 21:52:12 -05:00
Anirudh Agnihotry 4fa997ee8e making the milisecond test deterministic (dotnet/corefx#34734)
Commit migrated from https://github.com/dotnet/corefx/commit/673e1c171b95eeb0c23c980bd97aaf9b4f580ab9
2019-01-22 12:22:44 -05:00
Anirudh Agnihotry 730bffcbbf set the nanoseconds properties deterministically (dotnet/corefx#34362)
Commit migrated from https://github.com/dotnet/corefx/commit/db259b0302a866e2ff31a7d2c343abcc176ba4f4
2019-01-04 15:20:57 -08:00
Anirudh Agnihotry a5e2dae571 increase tries to 20 (dotnet/corefx#34342)
Commit migrated from https://github.com/dotnet/corefx/commit/df4c956d32654e77e799e538a67a2c7b13e656d4
2019-01-03 18:00:04 -08:00
Anirudh Agnihotry 0964672cf1 Using FUTIMENS instead of FUTIMES (dotnet/corefx#34271)
* 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
2019-01-02 15:12:21 -08:00
Blake Hensley 4c89c0460c Add overloads to File.Move and FileInfo.MoveTo that accept overwrite parameter (dotnet/corefx#31511) (dotnet/corefx#33054)
* 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
2018-10-26 19:28:35 -07:00
Anirudh Agnihotry 8e9c9c4a75 Another Case where millisecond Granularity was missed (dotnet/corefx#31593)
* MilliSeconds added

* Test Added for move operation

* LastAccessTimeTest

* avoid overflow and using both seconfs and nanoseconds of the native

* feedback addressed

* Tests fixed for CI

* Feedback addressed

* method signature changed

* removing comments

* named argument added


Commit migrated from https://github.com/dotnet/corefx/commit/510eaf10912ce5790302addb0171916b9a134000
2018-08-08 22:06:57 -07:00
Anirudh Agnihotry e527d170fe Maintaining the consistency of tests among master and release branch (dotnet/corefx#31164)
* Feedback Addressed

* Fixing original tests and for appContainers

* comment corrected


Commit migrated from https://github.com/dotnet/corefx/commit/7d916b0fe6c5e723374be7232c79706eedc64466
2018-07-23 13:42:06 -07:00
Anirudh Agnihotry fee351144f MilliSecond Granualrity added to Copy operation on unix (dotnet/corefx#30996)
* test added

* Test Modified

* Adding Implementation

* tabs removed

* modifyingTest

* Fixing build on HFS

* Space around arithemetic operator


Commit migrated from https://github.com/dotnet/corefx/commit/387aa6c624f0cc8b1c0c013dfddeb115f7c16e27
2018-07-12 10:19:39 -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 7c4ac470b7 Fix getting attributes for sharing violation files (dotnet/corefx#29790)
* Fix getting attributes for sharing violation files

Some files, such as the pagefile, refuse to allow you to get attributes directly.
You need to enumerate to get the attributes.

Enumerating is expensive, so we had changed from an opt-out to an opt-in. As
it took nearly a year to find this case, switching back to an opt-out with a
larger set of known cases where we get no value from trying again.

Also add an assert to flush out other error codes and scenarios.

* Skip lock test on MacOS (not supported)

* Nano was getting ERROR_NETWORK_UNREACHABLE


Commit migrated from https://github.com/dotnet/corefx/commit/31cdcaa77ab7d03a5430488e180cd1b47d0ee25e
2018-05-18 19:09:15 -07:00
Jan Kotas cab7e9e4a0 WIP: Enable TimesIncludeMillisecondPart on selected filesystems only (dotnet/corefx#28242)
* Enable TimesIncludeMillisecondPart on selected filesystems only

Use filesystem name to suppress the test failure

* Make the test fail

* Break out tests


Commit migrated from https://github.com/dotnet/corefx/commit/a31762f7fd5b580a6f583b3bbb69fb9e75b87d14
2018-03-20 22:17:25 -07:00
Jeremy Kuhne 10c2a8b41a Add more alternate data stream tests (dotnet/corefx#27945)
Commit migrated from https://github.com/dotnet/corefx/commit/de1878e129d4e44f4bccac3bae28612357c6a79d
2018-03-10 23:31:04 -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
Dan Moseley 5319d7787e Add nanosecond granularity to Unix filesystem time reads (dotnet/corefx#26176)
* Update PAL

* Revert PAL

* Add SxS struct

* Test

* CompareTo

* Simple creation time test

* CompareTo public

* Simple creation time test

* typo

* Extract method

* CR feedback

* Look for birthtimespec

* Rework to PAL approach

* comment

* typos

* typo

* Comment


Commit migrated from https://github.com/dotnet/corefx/commit/d75610efce77c2f2562c4f35de901ea38b6d43b7
2018-01-15 08:10:27 -08: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
Jeremy Kuhne 058ab2e451 Fix Unix missing file state (dotnet/corefx#19959)
* Fix Unix missing file state

In the original .NET implementation a missing file never
throws directly with FileInfo. Attributes get the error result
from Windows (-1) and times aren't initialized.

* Feedback

* Change FileSystemTest derivation

FileSystemTest should derive from RemoteFileSystemTest so
we can have one base class.

* Add RemoteExecutorBase to performance test project

* Address test feedback

* Fix File.GetAttributes on Unix

NetFX doesn't rely on FileInfo and throws when getting attributes
on missing files through File.


Commit migrated from https://github.com/dotnet/corefx/commit/801dde95a5eac06140d0ac633ac3f9bfdd25aca5
2017-05-19 13:20:11 -07:00
Morgan Brown 975ad3c685 Scale back [Serializable] CoreFX types (dotnet/corefx#19742)
* 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
2017-05-16 18:16:29 -04:00
Stephen Toub 4724fbf441 Fix sharing violations caused by FileShare.Inherited
The FileShareOpen test has been failing sporadically with sharing violations.  It turns out the problem has to do with FileShare.Inheritable being included in the list of FileShare values to test.  If another test in the same process concurrently spawns a process while a FileShare.Inheritable file is open, that file's handle will be inherited into the child process, which will in turn keep the file in use for longer than the test expects.  When it then tries to re-open the file, it may encounter a sharing violation if the subsequent open is incompatible with the previous one's FileShare.


Commit migrated from https://github.com/dotnet/corefx/commit/041672ff3642753807a4502a4c407cb82bfa1009
2017-05-09 10:00:21 -04:00
Daniel Harvey 252cdc5e95 Bulk updates of tests for AssertExtensions (dotnet/corefx#18491)
Bulk update to AssertExtensions.Throws for AOT support. This doesn't disable Assert.Throws.

Commit migrated from https://github.com/dotnet/corefx/commit/b43b4df2e0e2182154bb0f425cb4a61bc1269828
2017-04-18 09:52:02 -07:00
Ian Hays ebe8f66e34 Get IO.FileSystem tests running on NetFX
There were a high number of failing FileSystem tests for NetFX. This PR modifies the tests to run on NetFX without failures and adds comments for the reasons for the tests that had to be disabled.


Commit migrated from https://github.com/dotnet/corefx/commit/7d7b9be2c0eb870658722b1b78f850fbb08b4a97
2017-03-30 12:16:21 -07:00
sepidehMS e3d734c19d Add comments to PlatformSpecific tests
Commit migrated from https://github.com/dotnet/corefx/commit/493cb79ff4976479be5cc7c6f1fe2d5d9b710425
2017-02-07 15:46:26 -08:00
Santiago Fernandez Madero ce1b82e2b0 Add Replace methods to System.IO.FileInfo (dotnet/corefx#13563)
* Add Replace methods to System.IO.FileInfo


Commit migrated from https://github.com/dotnet/corefx/commit/2b0ce9c6f76cf2d68d79032f220cabe97eb4e676
2016-11-10 21:35:16 -08:00
Stephen Toub 8bc0c7486e Add System.IO.FileSystem serialization
Commit migrated from https://github.com/dotnet/corefx/commit/a8c26b8f37139e7b2fc25acd8859b1782319dcd6
2016-10-17 23:26:49 -04:00
Justin Van Patten aa68f5ce2f Replace uses of Xunit.PlatformID with renamed TestPlatforms
Replace uses of `Xunit.PlatformID` with renamed `TestPlatforms` because
the old name conflicts with `System.PlatformID` and should be plural
according to the design guidelines for flags enums.


Commit migrated from https://github.com/dotnet/corefx/commit/5179dda7331b1e201519adf76ce9ae69ffe2a0f6
2016-10-01 17:18:41 -07:00
Jose Perez Rodriguez a27ef1f7be Reving up the versions of the contracts where we have added Apis for netcoreapp1.1 (dotnet/corefx#10531)
Reving up the versions of the contracts where we have added Apis for
netcoreapp1.1

Commit migrated from https://github.com/dotnet/corefx/commit/62334804aa655a250838eefed68553f357ebec5f
2016-08-04 13:05:12 -07:00
Ian Hays 9d790f57d4 Add missing tests to System.IO.FileSystem
Adds missing tests to achieve strictly higher coverage than ToF and also adds some other new tests and cleans up existing tests.


Commit migrated from https://github.com/dotnet/corefx/commit/09e70d429a7c89abed1514a90667e0088f903d4c
2016-03-31 11:11:17 -07:00
stephentoub b540d002e5 Centralize case-sensitive PlatformID checks in FileSystem tests
Commit migrated from https://github.com/dotnet/corefx/commit/4f1d4382f5def0c000ff860f02dd02b1998e1017
2016-03-04 07:28:29 -05:00
stephentoub 7c4a049b44 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/09efd6b341ba83e7b5edd54af6600432fa8604ba
2016-03-03 17:57:55 -05:00
stephentoub 4f301f6e7c Fix System.IO.FileSystem handling of symlinks
We've visited this topic a few times... hopefully this is the last.  We previously misunderstood some of how Windows handles symlinks, leading us to make some invalid choices on Unix.  This addresses those issues.

For the most part with this commit, we now match Windows behavior on Unix wherever possible, while also trying to do something sensible on the Unix side.  The only notable difference now comes into play for broken symlinks, due to a fundamental difference between symlinks on Windows and Unix: on Windows, a symlink is created as either a file or directory symlink and thus .NET can tell which it is even if it's broken... on Unix, a symlink only stores a path to its target, so when it's broken, there's no information about whether it's intended to be a file or a directory.  As a result, we fall back to always treating it as a file.


Commit migrated from https://github.com/dotnet/corefx/commit/59da18fc926397f6674e1de86e296ca6e0dfe067
2016-03-02 13:40:27 -05:00
dotnet-bot 01a4f8e52c Deploy nameof throughout corefx in ConditionalFact/Theory
Commit migrated from https://github.com/dotnet/corefx/commit/0f9f72dec0493aa3d90fb4a5e22d7b62ffd79f79
2016-02-18 23:58:17 -05:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
stephentoub 9386f54542 Make Directory/FileInfo follow symlinks again
Previously on unix we would use stat to get information about directories and files for DirectoryInfo and FileInfo.  That meant that we wouldn't correctly report ReparsePoint for symlinks, and the code was changed to use LStat.  But that then breaks important use cases, such as by DirectoryInfo.Exist for a symlink to a directory always returning false.

This commit provides a compromise: we first use lstat, and if we find it's a symlink, we use stat but remember separately that it's a symlink so we can include ReparsePoint in the reported attributes.


Commit migrated from https://github.com/dotnet/corefx/commit/36259dc3c72fb1dc2a71a06db6f7dce9ea88c642
2016-01-22 16:35:23 -05:00
Mike Rousos 3d2b633341 Get Unix file stats with LStat (instead of Stat)
Stat was ignoring symbolic links (and getting stats for the target
instead) which caused checks for whether or not a path was a sym link
to fail on Unix.

Fixes dotnet/corefxdotnet/corefx#5015


Commit migrated from https://github.com/dotnet/corefx/commit/967cde5486cb290718b4b8f7779ccf832d5f4325
2016-01-14 12:06:45 -08:00
Stephen A. Imhoff a8ce720bd6 Update test namespace in System.IO.FileSystem
Update test namespace where applicable.
Cleanup `using`s in updated files.


Commit migrated from https://github.com/dotnet/corefx/commit/5b5717c2eb8fc88ed5bd59babe39890c581ad622
2015-09-25 21:30:57 +09:00
Ian Hays 0e2ae5be2d Fixed test bug with FileInfo_GetSetTimes
resolves dotnet/corefx#3272


Commit migrated from https://github.com/dotnet/corefx/commit/50aa6bbfd3921a9312392f534c5986a193486c35
2015-09-16 11:03:32 -07:00
Ian Hays 71345b4a45 Fixed OSX file creation time format
FileInfo.CreationTime on OSX was returning a correctly timed but incorrectly formatted DateTime. This commit fixes this issue and adds coverage to a existing test to fill the test gap that let the issue through.


Commit migrated from https://github.com/dotnet/corefx/commit/e59a99c6628b817e95a43880fe14cbf602602b9e
2015-09-14 10:51:15 -07:00
stephentoub 8b936e6509 Fix failing FileSystem tests on OS X
Several FileSystem tests are failing on OS X because the tests are expecting that file/directory creation time can be changed on Unix.  Fixing the tests.


Commit migrated from https://github.com/dotnet/corefx/commit/12c0d738a0c234b707b0c99e40b3cb760df8096e
2015-09-11 14:51:53 -07:00
Ian Hays 6f2190dc4e Fixed AccessTime, WriteTime, and CreationTime getters
Previously, AccessTime, WriteTime, and CreationTime would return DateTime objects with an unspecified DateTimeKind. This commit modified that behavior to have them instead return Local DateTime objects. Extra tests were also added to catch more potential error cases.

- Resolves dotnet/corefx#2603
- Resolves dotnet/corefx#2610


Commit migrated from https://github.com/dotnet/corefx/commit/df06e562a49b739655efff4b6b9f0faa23d09b78
2015-08-07 10:16:52 -07:00