Latest packages are now on dotnet-core myget feed.
This should address a many of the warnings in the build. I will follow up with another change to address the rest.
This change brings in the latest build tools with updates to consume "latest" packages (* versions).
I've updated every project in the repo to use * versioning for dependencies.
The new packages can be used to resolve runtime assets as well (like clrcompression.dll) so I have removed the custom code in System.IO.Compression to copy this dll. Instead the test project references the actual System.IO.Compression package and sets the correct runtime IDs to pull out the resources. The System.IO.Compression.dll from the package is not used since the project reference takes precedence.
I had to workaround an issue in System.Xml.XmlSerializer with the current packages: System.Runtime.WindowsRuntime 4.0.0 has a depedendency on "windows" package which doesn't exist. This was caused by our auto-generation task not filtering the winrt reference in the reference assembly's surface area. I've fixed this in a separate change and we can remove the workaround once we have a new set of packages. https://github.com/dotnet/corefx/issues/1761
I also had to add a dependency to System.Security.Cryptography.Hashing.Algorithms\tests due to an issue with DNX. It's not honoring the dependency group with no targetFramework when another dependency group exists in the nuspec. This is inconsistent with nuget v2 and should be fixed in DNX. https://github.com/aspnet/dnx/issues/1881
[tfs-changeset: 1471885]
Commit migrated from https://github.com/dotnet/corefx/commit/08c0d8628ef621fbd44d7aaa85b3239616a6b108
DNX and BuildTools now support all of the nuget v2 conventions that we depend on so we can
move all remaining nuget v2 packages to the project.json file and eliminate packages.config.
This change also adds "frameworks" to the project.json so that dnu restore can calculate
applicable assets. I am not yet using "runtimes" in the project.json since we are still resolving
our runtime assets manually (eg: build tools copies known files from packages). A future
change will move us to using our runtime packages and add runtimes sections to projects
as appropriate.
Commit migrated from https://github.com/dotnet/corefx/commit/eb35a304c7e89e8b4335ed13c5d23706360d49a4
https://github.com/dotnet/coreclr/pull/823 fixes an where '*' and '?' are treated as invalid path characters. Once that's fixed, some additional FileSystem tests that were expecting '*' and '?' to be invalid start failing on Unix. This commit fixes those tests.
The fixes are all of either two flavors: using Interop.IsWindows to only run the test on Windows, or changing the path to include characters also invalid on Unix (namely '\0'). A bit arbitrary, but I used the former when there was a comment saying that wildcards were being tested, and I used the latter when there was a comment saying that illegal characters were being tested.
Commit migrated from https://github.com/dotnet/corefx/commit/d3fb391ef0d6505bd0f2f4bb6c269c4c96c126a3
UnixFileStream.Seek was dumping the read buffer as desired, but with a SeekOrigin.Current, it wasn't factoring in the read buffer information into the offset (the fact that we have a read buffer means that the caller's definition of "Current" doesn't match the actual underlying file descriptor's position). This fix just updates the offset (as is correctly done in similar code in the Win32FileStream implementation) based on how much data we have in the read buffer.
I've also added a seek test that repeatedly seeks around and reads data. It blows up without the fix and passes with it.
Commit migrated from https://github.com/dotnet/corefx/commit/563f4977543f483ce1a5df8b9ffd9f96ffe0921f
Most of our testing until now has been on Linux. This PR represents a pass through the tests on OSX and provides fixes to get the System.IO.FileSystem, System.IO.Pipes, and System.IO.MemoryMappedFiles tests passing at 100%. Most of these fixes are product fixes, with just a few test fixes.
Primary src fixes:
- Lots of named values (errors, open flags, sysconf names, etc.) have different values across Linux and OSX: I've fixed those to be specific to the platform being compiled for. (In the future, we should consider introducing a native shim layer through which we make _all_ calls to Unix and have it surface a consistent view, so that we don't have to worry about this kind of issue.)
- Some functions or options to functions being used on Linux don't exist on OSX, e.g. madvise's DONTFORK, posix_fadvise, etc.; these have either been removed if not truly needed or moved behind the PAL layer to only be used on Linux.
- Some functions (e.g. shm_open) have different behavior from Linux. For example, shm_open doesn't appear to work well with shared memory objects, such as not allowing MAP_PRIVATE and not supporting PROT_EXEC (though the OSX man pages don't mention this). In such cases, I've implemented a fallback, e.g. on OSX we use a temporary file rather than a shared memory object.
- Some functions have subtle differences around edge cases, e.g. mmap on Linux appears to allow the creation of a map with length that goes beyond that of the underlying medium, but then fails when trying to use it, whereas OSX moves the failure to the mmap call itself. I've implemented workarounds to smooth over these differences.
- Various error conditions were resulting in the wrong exception type based on different exception codes being returned on OSX than on Linux, e.g. additional error codes needed to be mapped to IOException when rmdir fails.
- Replaced direct usage of getenv through P/Invoke with calls to Environment.GetEnvironmentVariable. (These are a holdover from when we didn't yet have GetEnvironmentVariable available.)
- Fixed up a few places we could be using CheckIo but instead had effectively written out its implementation manually.
Primary test fixes:
- Some of the file system tests are just plain buggy, regardless of platform, with timing issues that are more likely to show up on a debug runtime. I've fixed the ones that manifested while I was doing this testing, but the file system tests really deserved to be overhauled in general.
- Windows' implementation of File/DirectoryInfo returns default values for CreationTime when created for a file that doesn't exist; this appears to be purely for back compat with previously buggy behavior, so I changed the test to only verify this on Windows, rather than implement similar buggy behavior on Linux/OSX.
- A few test cases that were previously exempted for Linux also needed to be exempted for OSX.
- Re-enabled the System.Dynamic.Runtime.Tests now that the associated runtime error that was causing them to fail has been fixed.
Commit migrated from https://github.com/dotnet/corefx/commit/5a912670b442f7f7984b6d7f0be190213f726fd4
This change updates all projects to the latest CoreFx packages which make use of nuget v3 features and thus require project.json. Packages.config remains for the packages which are not yet compatible with the new build task (mainly because we need to resolve to PCL folders).
The entire change was done by a tool in order to not miss any dependencies, and ensure we have project items for the packages.config/project.json. One side effect of using the tool is some reformatting of whitespace in the projects.
Commit migrated from https://github.com/dotnet/corefx/commit/e729c5353070b71aedff8f1300ae838573813faf
Prior to this set of changes, 110 of the FileSystem tests were failing on Linux. After this change, all allowed tests pass.
Primary product fixes:
- Using rmdir/unlink for directory/file deletion rather than using remove
- Disallowing FileStreams to be opened for directories
- Supporting copying files when only target directory (not target name) is specified
- Overhauling directory enumeration to ensure to match Win32 behaviors related to search pattern normalization, input validation, supporting re-iteration through an enumerable, outputting partial paths based on user-supplied path, using a SafeHandle to ensure resources are cleaned up
- Fixing FileSystemObject.LastWriteTime to correctly return the LastWriteTime rather than LastAccessTime
- Fixing FileAttributes.ReadOnly handling due to inappropriate caching
- Validating inputs to FileSystemObject.Attributes, and make sure that changes to attributes are visible afterwards
- Adding support for getting CreationTime if it's supported by the OS
- Marking links with FileAttributes.ReparsePoint
- Working around current runtime bug related to exception handling and finally blocks getting executed twice
Primary test fixes:
- Suppressing tests as platform-specific that dependend on Win32-isms like drive letters, alternate data streams, etc.
- Changing a bunch of '\' usage to instead use Path.DirectorySeparatorChar or Path.Combine
- Adapting to behavioral differences between Windows and Unix, e.g. whether a directory can be deleted if it's readonly, invalid path characters, max path lengths, file sharing differences, etc.
These changes should all accrue to OSX as well, but we'll need to separately do an exercise to clean this library and tests up there for anything OSX-specific.
Commit migrated from https://github.com/dotnet/corefx/commit/dd48c9dc1f0a7142a005ff1d4c162e10facda306
In order for the test category inclusion/exclusion code to work properly, the test projects need to correctly identify the categories of tests that exist in their source files. If a project doesn't identify that it contains outer loop tests, outer loop tests are not excluded when running inner loop tests.
Commit migrated from https://github.com/dotnet/corefx/commit/eb630634d3096a4ab396457b43ac3a7130261e4c
The FileSystem tests are a mess... including on Windows, but especially on Unix. Before the File/Directory/etc. tests got checked in, the FileSystem tests (which then were really only for FileStream and were fairly clean) could run on Unix, with 25 of the 360 tests failing due primarily to lack of support for FileShare options. Now, with ~575 tests, when run on Unix more than 300 fail, runtime assertions occur in multiple places, and worst, all of the files in your working directory end up getting deleted!
This commit has a first set of fixes, primarily involving ensuring that paths are specified appropriately, with hundreds of changes to ensure that the right path separator is used, that particular roots aren't assumed, etc. After this commit, on Unix we're down from > 300 failures to 114 failures, and the suite is able to finish running without deleting the working directory.
Commit migrated from https://github.com/dotnet/corefx/commit/d9465170db0be15a6e8d8ca6ba591a358f709ec5
There are 338 System.IO.FileSystem tests currently passing on Windows. On Linux, 65 of these are currently failing, mostly negative tests expecting a certain exception and getting a different actual one or none at all.
This commit fixes 40 of those, mostly via product fixes, plus a few test tweaks (where the test was based on something specific to Windows), such that now only 25 are failing. Of those 25, 24 are tests for FileSharing that are expecting exceptions not being generated on Linux because that support isn't available in the library; we'll most likely just disable these tests for Linux. The remaining 1 test fails because it's expecting ReadAsync to complete synchronously if the read can be satisfied from the read buffer, and the current ReadAsync/WriteAsync implementations just delegate to the base class for functionality; we already have a work item open to eventually address that.
Commit migrated from https://github.com/dotnet/corefx/commit/8062cc0dbed1ad31b9e6d438ddc71d91ee066031
Several libraries had their code coverage disabled due to unknown problems. The change to a more recent version of OpenCover appears to have addressed whatever those issues were, as the problems no longer repro. This commit just re-enables the code coverage for those libraries.
The only remaining library with its code coverage disabled is System.Diagnostics.Process.dll. It's either hanging or just taking a really long time to complete. Investigation still needed.
Commit migrated from https://github.com/dotnet/corefx/commit/01c18f27d5a6c383701e0407b55e6edfae203309
This change enables code coverage for the corefx project using OpenCover.
* When /p:Coverage=true is passed, we wrap the xunit call in the OpenCover command.
* OpenCover filters test assemblies but no other default filters.
* We disable parallel execution of tests within xunit and parallel project building when running coverage. This appears to cause issues with OpenCover (I see spurious failures in tests) and is actually slower than just running execution serially.
* A few assemblies still have issues even after this. These have coverage disabled with CoverageEnabledForProject. Will open an issue for future investigation.
* After execution is complete, we run the ReportGenerator tool over the set of generated coverage data, creating a full report in bin\tests\coverage.
Commit migrated from https://github.com/dotnet/corefx/commit/60a0bdd4125e39aa1653f2aeffc9eea02f348531
We have a seperate codepath for initializing DirectoryInfos when they are the result of
search. We do this as a performance optimization since we already have the filesystem
data for the directory/file. I was missing the flag that set the internal field as directory/file
in this codepath, which resulted in DirectoryInfo.Exists treating the item as a file and
returning false since it had the Directory attribute set.
I've fixed this omission and added some tests for DirectoryInfo.Exists.
Commit migrated from https://github.com/dotnet/corefx/commit/ea4b8d6b96c9687b431c1c5785a582caa9a22912
We control the targeting centrally and we shouldn't be retargeting
from VS. With the new support for running tests on F5, it is best
to be able to see and edit the command line in the property pages.
Before this, we had an arbitrary mix of the guids being present or
not anyhow. At some point, if we need to set it, we can put it back
across the board and hopefully by then we'll have proper VS test
integration anyhow.
Commit migrated from https://github.com/dotnet/corefx/commit/da9663498c4f5e6bb663e97531afc48964ffbdd0
The System.Runtime.Serialization namespace isn't defined in any of the
NuGet packages and is not used in the project, so it can be removed.
The System.IO.FileSystem tests were missing a reference to
System.Runtime.Handles in packages.config (SafeHandle is defined there).
This fixes compilation errors on the Mono compiler.
Commit migrated from https://github.com/dotnet/corefx/commit/11f161176d4b1823f47d35d651a027a892f4e1ad