921 Commits
Author SHA1 Message Date
Eirik Tsarpalis 0936916dc1 Ensure console is initialized before writing to stdout (#46852) (#46867) 2021-01-14 13:51:57 -08:00
db79f63ca9 [release/5.0] Update dependencies from dotnet/arcade (#43185)
* Update dependencies from https://github.com/dotnet/arcade build 20201006.7

Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.ApiCompat
 From Version 5.0.0-beta.20474.4 -> To Version 5.0.0-beta.20506.7

* React to TargetFramework.Sdk change

* Roslyn update response (#43056)

* Update function pointer syntax usage to official.

* Fix warnings with new Roslyn

Co-authored-by: Jan Kotas <[email protected]>

* Adjust for roslyn change on ref parameters and NotNullIfNotNull (#42707)

* Adjust for roslyn change on ref parameters

* Adjust for roslyn change on NotNullIfNotNull

* Fix all configurations build

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Aaron Robinson <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: Julien Couvreur <[email protected]>
Co-authored-by: Santiago Fernandez Madero <[email protected]>
2020-10-10 10:53:43 +02:00
github-actions[bot]andEirik Tsarpalis 467647115c [release/5.0-rc2] Revert "Make Console.ReadKey() distinguish between CR and LF inputs" (#42477)
* Revert "Make Console.ReadKey() distinguish between CR and LF inputs (#37491)"

This reverts commit a62bfcbd6e.

* Account for terminals that have ICRNL disabled

* Add manual tests that validates the current \n ReadKey() behaviour on Unix

Co-authored-by: Eirik Tsarpalis <[email protected]>
2020-09-23 14:47:11 -07:00
github-actions[bot]andTom Deseyn 9229d2e30c Console.Unix: fix inverted TreatControlCAsInput (#42449)
The logical negation was unintentionally removed while refactoring.

Co-authored-by: Tom Deseyn <[email protected]>
2020-09-18 17:52:01 -07:00
github-actions[bot]andTom Deseyn 7b7dad97a9 [release/5.0-rc2] Console.Unix: fix terminal settings during Console.KeyAvailable (#42381)
* Console.Unix: fix terminal settings during Console.KeyAvailable

Arguments passed to configure the terminal are in the wrong order.
This causes Enter keys to be returned as ConsoleKey.J instead of
ConsoleKey.Enter.

* Add test

Co-authored-by: Tom Deseyn <[email protected]>
2020-09-17 15:45:06 -07:00
320a99eb3e [release/5.0-rc2] Backport Browser Unsupported Attribute Changes Properly (#42071)
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Maxim Lipnin <[email protected]>
2020-09-11 20:46:12 +02:00
github-actions[bot]andTom Deseyn 67deb1d9be Console.Unix: fix window size not always being invalidated (#41462)
Ensure signal handlers are setup to invalidate cached values
for window size.

Co-authored-by: Tom Deseyn <[email protected]>
2020-09-01 09:15:55 -07:00
Tom DeseynandEirik Tsarpalis 1e6e8d9c8f Console.Unix: make Console.OpenStandardInput Stream aware of terminal (#39192)
* Console.Unix: make Console.OpenStandardInput Stream aware of terminal

When performing OpenStandardInput against a terminal, perform Reads on a
line-by-line basis and perform appropriate processing and echoing.

* Add test

* fix manual tests for Windows

Co-authored-by: Eirik Tsarpalis <[email protected]>
2020-08-14 17:24:32 +02:00
Adam Sitnik d2c0ed643e update System.Console manual test instructions for macOS (#40773) 2020-08-13 14:31:45 +01:00
Adam Sitnik 531f1af183 make ConsoleKeyInfo implement IEquatable<ConsoleKeyInfo> (#40660)
* make ConsoleKeyInfo implement IEquatable<ConsoleKeyInfo>, fixes #2127

* remove unnecessary cast
2020-08-11 21:08:27 +02:00
Adam Sitnik efafca9bd8 use new OperatingSystem APIs in test projects that target NetCoreAppCurrent only (#40522)
* use new OperatingSystem APIs in test projects that target NetCoreAppCurrent only

* use `||` instead of `|`
2020-08-10 17:50:42 +02:00
Eirik Tsarpalis ff47b4bb93 [System.Console] Fix manual test (#39460)
* do not report '\n' as Ctrl+Enter on unix

* add macos instructions

* add windows test instructions
2020-08-06 12:28:06 +01:00
Adam Sitnik d306c6f31d Mark existing Windows-specific APIs without a version number, fixes #40095 (#40375) 2020-08-05 18:24:03 +02:00
Adam Sitnik 06963eaedf Rename MinimumOSPlatformAttribute and RemovedInOSPlatformAttribute (#40371)
* rename attributes:

* MinimumOSPlatformAttribute -> SupportedOSPlatformAttribute
* RemovedInOSPlatformAttribute -> UnsupportedOSPlatformAttribute

* update src and ref files

* update .targets file

* update comment ;)
2020-08-05 13:47:50 +02:00
Viktor Hofer 809a06f451 Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
Adam SitnikandViktor Hofer 52d4d8c057 mark Windows-specific APIs as such (#39265)
* move all OSPlatformAttributes to a single file so they can be easily referenced in < .NET 5 libraries

* Adds System.Runtime.Versioning*Platform* annotation attributes to < .NET 5 builds

* introduce MinimiumSupportedWindowsPlatform

* introduce IsWindowsSpecific setting that adds MinimumOSPlatform attribute for Windows Specific libraries

* mark all Windows-specific libraries as such

* annotate Windows-specific System.Console methods and properites

* annotate Windows-specific DpapiProtectedConfigurationProvider type

* annotate throwing Windows-specific APIs from System.Diagnostics.Process namespace

* annotate throwing Windows-specific APIs from System.IO.MemoryMappedFiles namespace

* annotate Windows-specific APIs from System.IO.Pipes namespace

* the new attributes should support enums

* annotate Windows-specific APIs from HttpListenerTimeoutManager class

* annotate Windows-specific APIs from System.Net.Sockets namespace

* annotate Windows-specific APIs from System.Runtime.InteropServices namespace

* annotate Windows-specific APIs from System.Security.Cryptography.Csp namespace

* annotate Windows-specific APIs from System.Security.Cryptography.X509Certificates namespace

* annotate Windows-specific APIs from System.Threading namespace

* address code review feedback: dont introduce new constants, reuse existing SYSTEM_PRIVATE_CORELIB

* code review: import the namespace, simplify the attribute name

* add missing Socket.DuplicateAndClose and Socket(SocketInformation)

* fix the test name (it does not throw)

* add missing DriveInfo.set_VolumeLabel

* add System.IO.FileSystem File Encrypt and Descrypt methods

* simplify the < .NET 5 check

* enable nullable in explicit way as it's not enabled in all the projects where this file is included

* include platform attributes in projects that ask for it in explicit way

* set IncludePlatformAttributes to true for projects that include files from other projects

* use suggestions from Viktor and Santi

Co-authored-by: Viktor Hofer <[email protected]>
2020-07-17 15:11:50 +02:00
Stephen ToubandAaron Robinson 84c1f62cc2 Sprinkle SuppressGCTransition across Unix shim P/Invokes (#39206)
* Sprinkle SuppressGCTransition across Unix shim P/Invokes

Did a quick audit and added it to all the trivial functions that just return a constant or return some static or map one value to another or such things.

* Address PR feedback

* Update src/libraries/Native/Unix/System.Native/pal_io.c

Co-authored-by: Aaron Robinson <[email protected]>

Co-authored-by: Aaron Robinson <[email protected]>
2020-07-16 10:57:47 -04:00
Anirudh AgnihotryandSantiago Fernandez Madero b62b16acf5 addressing some missing feedback Relating to Browser (#38968)
* addressing some missing feedback

* Apply suggestions from code review

Co-authored-by: Santiago Fernandez Madero <[email protected]>

* remove odbc32 from ref

* fix stuff

Co-authored-by: Santiago Fernandez Madero <[email protected]>
2020-07-09 23:45:40 -07:00
Stephen Toub ea2b09beea Add and use Environment.ProcessId (#38908)
* Add and use Environment.ProcessId

* Split newly added tests
2020-07-09 18:09:05 -04:00
Stephen Toub 0bc1a6fb13 Disable HandlerInvokedForSigQuit test on macOS (#39003) 2020-07-09 16:07:15 -04:00
Tom Deseyn 2b7a301271 Console.Unix tests: don't run tests when SIGINT/SIGQUIT disposition is ignored (#38334)
* Console.Unix tests: don't run tests when SIGINT/SIGQUIT disposition is ignored

* Add SkipOnMono to HandlerInvokedForSigQuit test
2020-07-08 17:33:22 +02:00
Stephen Toub 6072e4d3a7 Update license headers (#38793) 2020-07-08 09:23:11 -04:00
Anirudh Agnihotry 5ce04ccc9a Make browser peer for windows_nt and unix (#37944)
Fixes https://github.com/dotnet/runtime/issues/38559
2020-07-08 12:59:37 +02:00
Egor Bogatov 9a665f2300 [mono] Change default output encoding for ConsolePal.WebAssembly.cs to utf8 (#38641)
* Change default output encoding to utf8 for wasm
2020-07-01 19:12:56 +03:00
Stephen Toub 3c9fcce29d Disable P/Invoke analyzer (#38550) 2020-06-29 18:06:21 -04:00
Eirik Tsarpalis a62bfcbd6e Make Console.ReadKey() distinguish between CR and LF inputs (#37491)
* termios: disable CR/LF mapping flags

* fix mapping logic for '\n' characters

* only disable cr/lf conversions on Console.ReadKey paths

* add comments

* address feedback

* address feedback

* move character conversions to the managed layer

* fix issue

* add key chord manual tests and doc manual testing

* ensure terminal is initialized for Console.OpenStandardInput

* Enable ICRNL when reading from UnixConsoleStream

* add a manual test for OpenStandardInput

* remove CR to LF conversion for Console.ReadLine

* rename argument

* add CR-to-LF transformation to Console.ReadOrPeek

* use ConditionalFact attribute in test

* remove dead code
2020-06-25 20:51:00 +01:00
Maxim Lipnin b2890c6b3b Disable TermInfo library tests on WASM (#38092)
We disable TermInfo library tests because the respective functionality doesn't make sense on WASM.
2020-06-19 12:21:30 +02:00
Maxim Lipnin ba1bef6eb5 Align some Console properties on iOS/Android/WASM with other Unix implementations (#38088) 2020-06-18 22:54:46 +02:00
Maxim Lipnin 0de50030b8 [wasm] Disable some existing System.Console library tests throwing PNSE (#37975)
* [wasm] Disable existing System.Console library tests which fail on WASM with PlatformNotSupportedException; add several tests to reflect WASM PNSE-behavior

* Address feedback
2020-06-18 13:41:38 +02:00
Santiago Fernandez Madero 07f9116469 Add support to map test support files to wasm vfs in WasmAppBuilder (#37938)
* Add support to map test support files to wasm vfs in WasmAppBuilder

* PR Feedback

* Remove workaround for System.Reflection.Metadata.Tests

* Add BCL and BuildReference assets to VFS

* PR Feedback and fix more test projects

* Avoid potential null ref
2020-06-18 01:28:07 -07:00
Maxim Lipnin a9bba780d6 [wasm] Make some System.Console test pass with accordance to WASM PNSE behavior (#37645)
* Add a separate wasm-specific test

* Address feedback
2020-06-16 13:03:42 +02:00
Stephen Toub cd02b0612b Consistently use inline stackallocs with ValueStringBuilder (#37795)
Primarily for style consistency.
2020-06-12 16:49:10 -04:00
Alexander Köplinger da10ba8ca7 Use ConditionalFact/Theory for skipping RemoteExecutor on unsupported platforms (#37479)
RemoteExecutor doesn't work on platforms that can't spawn processes like iOS/Android/WebAssembly.
2020-06-09 12:40:44 +02:00
Stephen Toub ad3b8ed1e8 Update comments on GetCursorPosition (#37609) 2020-06-08 16:52:19 -04:00
Stephen Toub 78ae7733f0 Add Console.GetCursorPosition (#37559) 2020-06-08 14:27:27 -04:00
Stephen Toub a6d8a529ee Fix broken System.Console tests (#37558) 2020-06-08 11:05:10 -04:00
Stephen Toub 1705e687a8 Add non-generic TaskCompletionSource (#37452)
- Adds the type, almost an exact copy of `TaskCompletionSource<TResult>`, but creating a `Task` instead of a `Task<TResult>`.  Primary benefits here are symmetry, smaller `Task` object, and not forcing a developer to specify an unnecessary type name.
- Adds tests for both TCS and TCS<TResult>.
- Switches a bunch of usage of the generic type over to the non-generic, both in src and tests.
2020-06-05 10:50:51 -04:00
Zoltan Varga 3ab330be92 Use the wasm version of System.Console on wasm. (#37221) 2020-05-31 15:54:23 -04:00
Krzysztof Wicher 5cfda7737f make Poll enums shared 2020-05-12 15:01:20 -07:00
Egor Bogatov ef2ea8a6a2 Integrate Android into /t:Test (#35640)
Integrate Android into the "Test" workflow, e.g.:
```
./build.sh -os Android -arch arm64 -subset Mono+Libs

cd src/libraries/System.Buffers/tests

dotnet build /p:TargetOS=Android /p:TargetArchitecture=arm64 /t:Test
```
^ should run tests for any test suite on an active device or emulator.
2020-04-30 11:44:50 +02:00
Zoltan Varga adcdef86bb Add a WebAssembly version of System.Console. (#35555) 2020-04-28 20:33:57 -04:00
Egor BogatovandStephen Toub f283945906 [mono] Implement System.Console for Android (#35415)
* Implement ConsolePal for Android

Co-authored-by: Stephen Toub <[email protected]>
2020-04-27 17:49:53 +03:00
Marcus Turewicz 890fab0a64 Use attribute Link syntax for Common files (#35436)
* Change <Link>...</Link> to Link="..."

* Format existing Link="..."
2020-04-25 05:26:50 -07:00
Marek Safar ed1b8aa3c5 Don't re-initialize static fields in Console (#35409)
the compiler is not capable removing the initialization
2020-04-24 14:14:15 -04:00
Tom DeseynandStephen Toub 59a24e56e7 Console.Unix: avoid deadlock between LazyInitializer and Console.Out (#34297)
* Console.Unix: avoid deadlock between LazyInitializer and Console.Out

* Add assert for InternalSyncObject

* Console: use Interlocked for lazy initialization

* Cleanup unused 'using'

* Limit locking to event handlers

* Fix AllowNull -> NotNull

* Localize LazyInitializer.EnsureInitialized logic

* Remove lazy initialize delegates

* Use static local functions for initializing

* Remove unused EnsureInitializedDisposableCore

* Remove unused arg from EnsureInitializedStdInReader

* Also EnsureInitialize when not redirected

* Dispose Console Streams with their Reader/Writer

* Fix s_out -> s_error

* leaveOpen streams, fix Encoding set race

* Fix races between Encoding en initializers of In/Out/Error

* Remove EnsureInitialized

* Cleanup

* Rename static local initializer functions to EnsureInitialized

* Use lock in Input/OutputEncoding

* Rename InternalSyncObject to s_syncObject

* Cleanup space

* Fix _isStdErrRedirected -> _isStdInRedirected

* Remove space

* Improve comments

* Fix potential CancelKeyPress deadlock

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <[email protected]>

* Remove unnecessary null forgiving

* Add comment about why we're not Disposing StdInReader

* Add Volatile.Writes for Volatile.Read fields

* More Volatile.Writes

* Add back lock to SetIn

Co-authored-by: Stephen Toub <[email protected]>
2020-04-13 13:14:12 -04:00
Maxim Lipnin ab6e225d0c [mono] Remove CoreFX.issues_windows.rsp file (#32592)
Changes:
- enabled `runtime (Libraries Test Run release mono Windows_NT x64 Debug)` CI lane (Windows Nano Server CI leg is disabled);
- enabled the tests that pass;
- marked failing test assemblies/classes/methods with `ActiveIssue` attribute using respective GH issues;
- removed CoreFX.issues_windows.rsp file and related mono rsp arguments.

Fixes #1980
2020-04-10 12:41:57 +02:00
Jo Shields 952eecabbd Initial addition of tvOS Mono (#34475) 2020-04-08 02:00:28 +02:00
Viktor Hofer d0dc66bc0b Rename CoreFx.Private.TestUtilities and reference it in slns (#34656)
* Rename CoreFx.Private.TestUtilities to TestUtilities

* Add TestUtilities reference to slns
2020-04-08 01:26:53 +02:00
Egor Bogatov 9c23058949 [mono] Implement System.Console for iOS (#33827)
* Add iOS version of System.Console
2020-03-21 17:01:13 +03:00
tub5andBen Rothermel d2a3709b9e Fix very minor typo (#33423)
Co-authored-by: Ben Rothermel <[email protected]>
2020-03-10 08:11:02 -07:00