Commit Graph

1202 Commits

Author SHA1 Message Date
Saleem Abdulrasool
bc58e5bc3f stdlib: disable abort reporting on Windows
Avoid the dialog when an assertion fails on Windows.  This is important to
ensure that the tests do not create a large number of prompts.
2019-01-03 16:56:42 -08:00
Saleem Abdulrasool
b7e21da2d0 StdlibUnittest: add a VEH for TRAP on Windows
Add a vectored exception handler for illegal instructions on Windows.
This allows us to emulate `signal(SIGTRAP, ...)`.  This allows better
coverage of tests.
2019-01-02 09:38:18 -08:00
Saleem Abdulrasool
9421d0189c StdlibUnittest: prevent abort dialog on Windows
Adjust the abort behaviour on Windows.  The aborts would cause a large
number of dialogs to appear.  This reduces the load a bit and is crucial
for getting tests to run without manual intervention.
2019-01-02 09:37:34 -08:00
Saleem Abdulrasool
3027784bf7 StdlibUnittest: add a workraound for DOS lineendings
Windows uses DOS line endings which appear through the PIPE endpoints.
We currently split on line feeds only, leaving the carriage return in
place.  Without this, the messages on the communication pipe would not
be interpreted correctly.
2019-01-02 09:37:34 -08:00
Saleem Abdulrasool
335ea14beb stdlib: port StdlibUnittest to Windows 2019-01-02 09:37:34 -08:00
Saleem Abdulrasool
7ecaeb1727 stdlib: implement _FDStreams in terms of HANDLES
Use HANDLE on Windows to create the FDStreams.  This will be used by the
standard library unit test test harness.
2018-12-21 14:19:03 -08:00
Max Moiseev
ab87c708f2 Merge pull request #21337 from moiseev/atomic-int-reshuffle
[stdlib] tee _stdlib_AtomicInt > SwiftPrivate
2018-12-19 10:00:39 -08:00
Max Moiseev
f370c676c0 Merge pull request #20962 from compnerd/libc-extras
PrivateLibcExtras: Port to Windows
2018-12-19 10:00:15 -08:00
Maxim Moiseev
165fe328c3 [stdlib] tee _stdlib_AtomicInt > SwiftPrivate
Turns out some people used this type despite it being prefixed with
`_stdlib_`, so we have to keep it, with an obsoletion message this time.
Second copy of the same type is kept available past Swift 5 in
SwiftPrivate for use in tests.
2018-12-18 16:12:47 -08:00
Saleem Abdulrasool
39f2ac98b7 SwiftPrivate: fix dependencies on Windows
This module needs MSVCRT and WinSDK on Windows.  Track the dependencies.
2018-12-16 22:26:44 -08:00
Saleem Abdulrasool
d70911e1ff SwiftPrivateLibcExtras: port to Windows
Enable the libc extras to be built for Windows.  This is a dependency
for StdlibUnittests.
2018-12-16 22:11:07 -08:00
Saleem Abdulrasool
3225e36d63 stdlib: reorder add_subdirectory to repair the Windows build
Due to the horrible attrocities against software of the attempt to perform
cross-compilation in the swift build system, we need to emulate the linking
behaviour for Windows with the link against the import library.  The emulation
requires the custom creation of import library targets.  In order to actually
get the linking semantics correct, the dependendency targets must be created
prior to use (unlike standard CMake).  The reordering ensures that we get
correct linkage when building for Windows.

Perform a simple optimization to avoid a number of string comparisions for the
host system.
2018-12-14 13:56:16 -08:00
Ben Cohen
11769d2494 Add tests for withContiguousStorageIfAvailable 2018-12-07 17:30:13 -08:00
Ben Cohen
ad50a39b12 [stdlib] Add withContiguous{Mutable}StorageIfAvailable (#21092)
* Add MutableCollection.withContiguousMutableStorageIfAvailable

* Add withContiguousMutableStorageIfAvailable impls

* Add tests on concrete types

* Add Sequence.withContiguousStorageIfAvailable

* Implement withContiguousStorageIfAvailable in concrete types
2018-12-07 10:01:18 -08:00
Maxim Moiseev
ebf90f78be Make an StdlibUnitTest error message a bit more useful 2018-12-06 14:11:57 -08:00
Xiaodi Wu
9fe28c6e55 [gardening] Fix header comments [NFC] 2018-12-02 15:38:41 -05:00
Saleem Abdulrasool
98d71ff38f SwiftPrivateThreadExtras: clean up using WinSDK SDK overlay
Use the constants rather than hardcoding values.
2018-12-01 11:04:13 -08:00
Saleem Abdulrasool
cc49e686cd Merge pull request #20908 from compnerd/thread-corrections
SwiftPrivateThreadExtras: fix windows build
2018-11-30 10:38:09 -08:00
Karoy Lorentey
1ef6cf4813 Merge pull request #20866 from lorentey/deprecate-hashValue-1
[test] Modernize hashing throughout the test suite
2018-11-30 14:21:04 +00:00
Saleem Abdulrasool
c32daed203 SwiftPrivateThreadExtras: fix windows build
Missed casts and a let vs var issue.  This was missed in the last bundle
of patches.
2018-11-29 22:19:00 -08:00
Saleem Abdulrasool
94173e9cdb SwiftPrivateThreadExtras: correct dependency for Windows
We need the MSVCRT module, add a dependency.
2018-11-29 19:26:59 -08:00
Karoy Lorentey
8e77a2655a [test] StdlibUnittest: Add missing hash(into:) implementations 2018-11-29 15:55:17 +00:00
Saleem Abdulrasool
0aec8376da SwiftPrivateThreadExtras: enable on all platforms
This has been generalized enough to permit building on Windows with
Windows threading primitives.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
ce40d72641 stdlib: implement _stdlib_pthread_join in terms of Windows threading
Implement `_stdlib_pthread_join` in terms of windows threading.
Additionally, rename it to `_stdlib_thread_join`.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
6bf7b9e711 stdlib: implement _stdlib_create_pthread_block in terms of Windows threaing
Port the block based thread constructor to Windows threading model, and
rename it to `_stdlib_create_thread_block`.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
e1d7ee79e4 stdlib: implement ThreadBarriers in terms of Windows threading 2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
5e943981c7 stdlib: rename some variables in _stdlib_barrier 2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
65bdce00b6 stdlib: rename _stdlib_PTHREAD_BARRIER_SERIAL_THREAD -> _stdlib_THREAD_BARRIER_SERIAL_THREAD 2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
7b06586fe1 stdlib: rename _stdlib_pthread_barrier_t to _stdlib_thread_barrier_t 2018-11-26 13:09:49 -08:00
Saleem Abdulrasool
940db1b0cf stdlib: remove pthread_attr_t from _stdlib_pthread_create_block
The attributes were not being used currently.  Since this is a private
interface, remove the parameter as it makes it easier to port to
Windows.
2018-11-26 13:09:31 -08:00
Saleem Abdulrasool
82360c6b27 stdlib: remove pthread_barrier attributes
These were not in use, and removing this from the signature makes it
possible to re-use the exact signature on Windows more easily.
2018-11-26 13:09:31 -08:00
Saleem Abdulrasool
0693bec1f1 sdlib: rename SwiftPrivatePthreadExtras to SwiftPrivateThreadExtras
This is in preparation to make the code here more target agnostic for
porting to the Windows threading primitives.  This is used pretty
extensively in the tests, so disabling tests would lose a chunk of
coverage.
2018-11-26 13:09:31 -08:00
Ben Cohen
df2307e035 [stdlib][DNM] Collapse sequence and collection wrappers (#20221)
* Concretize dropFirst/Last/sufix/prefix from Sequence

Remove split customization point

Eliminate SubSequence from Sequence protocol

Collapse LazyCollection

Collapse LazyMapCollection

Eliminate _SequenceWrapper

Collapse LazyFilterCollection

Collapse LazyDrop/PrefixWhileCollection

Fix tests, ABI stability update

Collapse FlattenSequence

* Add entries to source/ABI compatible expected results.

* Update tests to avoid pre-10.14 objc runtime bug

* Expunge _preprocessingPass
2018-11-14 10:05:58 -08:00
Mike Ash
9266cb7229 Merge branch 'master' into remove-swiftprivate-swiftdarwin-dependency 2018-11-06 19:45:26 -05:00
Max Moiseev
ddcd8d324a Merge pull request #20243 from arguiot/patch-1
Updated SwiftPrivate.swift using String Interpolation
2018-11-06 14:49:15 -08:00
Mike Ash
45693049bf [Stdlib] Remove SwiftPrivate's dependency on Darwin.
Revert #20194, which seems to be more trouble than it's worth. Instead, move the functions that SwiftPrivate needs back into LibcShims.h/cpp as SPI.

rdar://problem/45817565
2018-11-06 17:41:56 -05:00
Maxim Moiseev
ca51626fd3 [stdlib] Move _stdlib_AtomicInt and friends out of the stdlib 2018-11-06 09:53:58 -08:00
Xiaodi Wu
049b89ce4d Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:19:20 +08:00
Xiaodi Wu
977a9558ce Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:19:12 +08:00
Xiaodi Wu
577e5534fd Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:19:06 +08:00
Xiaodi Wu
f76be9b08f Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:59 +08:00
Xiaodi Wu
dc9d2b5da9 Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:51 +08:00
Xiaodi Wu
3228c800a6 Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:46 +08:00
Xiaodi Wu
aede4b07ab Update stdlib/private/SwiftPrivate/SwiftPrivate.swift
Co-Authored-By: arguiot <arguiot@gmail.com>
2018-11-05 07:18:42 +08:00
Michael Ilseman
e6582c37ee [test] Adjust String tests for UTF-8 representation.
Adjust tests for the UTF-8 representation, in preparation for 32-bit
support. Includes UTF-8 literal update.
2018-11-04 10:42:41 -08:00
Lance Parker
7376009ccc Add benchmarks and tests for the normalized iterator (#32)
Add benchmarks and tests for the normalized iterator
2018-11-04 10:42:41 -08:00
Lance Parker
f1a35bd1c9 String comparison iterator for UTF8 strings 2018-11-04 10:42:41 -08:00
Michael Ilseman
4ab45dfe20 [String] Drop in initial UTF-8 String prototype
This is a giant squashing of a lot of individual changes prototyping a
switch of String in Swift 5 to be natively encoded as UTF-8. It
includes what's necessary for a functional prototype, dropping some
history, but still leaves plenty of history available for future
commits.

My apologies to anyone trying to do code archeology between this
commit and the one prior. This was the lesser of evils.
2018-11-04 10:42:40 -08:00
Arthur Guiot
117d7baab8 Fixed indentation to 2 spaces in SwiftPrivate.swift 2018-11-03 11:27:20 +08:00
Arthur Guiot
e6fea9e6ed Fixed header in SwiftPrivate.swift 2018-11-02 23:46:19 +08:00