Commit Graph

362 Commits

Author SHA1 Message Date
Slava Pestov
55644c1540 stdlib: Remove Self parameter from SequenceType._preprocessingPass
This code as written is not sound and should not type check
for non-final classes conforming to SequenceType (eg, NSArray).

Instead, capture the base of the call from the preprocess closure
passed in. The closure is @noescape, so it should be equivalent.
2016-01-29 12:18:39 -08:00
Dmitri Gribenko
fbbb42a5db Merge pull request #1130 from glessard/noobjc-testpredicate
Add cases .ObjCRuntime and .NativeRuntime to StdlibUnittest's TestPredicate
2016-01-29 10:36:28 -08:00
Dmitri Gribenko
7368b08d86 Merge pull request #1133 from glessard/always-never-testpredicate
Add .Always and .Never cases to StdlibUnittest's TestPredicate
2016-01-28 23:19:55 -08:00
Guillaume Lessard
b7f19d6889 Add .Always and .Never cases to StdlibUnittest's TestPredicate 2016-01-28 23:03:00 -07:00
Dmitri Gribenko
a415ade5ae Merge pull request #854 from an0/master
Add O(1) `contains()` implementation for Range with Comparable Element
2016-01-28 21:41:31 -08:00
Guillaume Lessard
6879dbd553 Add runtime-related cases to StdlibUnittest's TestPredicate 2016-01-28 20:16:11 -07:00
Doug Gregor
2a42664129 Use #selector in StdlibUnitTest's Foundation extras 2016-01-28 11:23:14 -08:00
Ling Wang
148c821d2c Fix test failure 2016-01-28 09:35:00 -06:00
Ling Wang
29bd8cc1b5 Merge from upstream and resolve conflicts 2016-01-27 16:08:15 -06:00
practicalswift
4d683be9e0 [gardening] Fix recently introduced incorrect headers 2016-01-27 11:56:10 +01:00
Dmitri Gribenko
b2290992fa Allow StdlibCollectionUnittest to be built on Linux and FreeBSD 2016-01-26 22:02:17 -07:00
Dmitri Gribenko
4c590585e0 Move Default* and Minimal* colections to StdlibCollectionUnittest
New StdlibUnittest build times:

* DebugAssert compiler and library: 50s
* ReleaseAssert compiler and library: 75s
2016-01-26 18:58:04 -08:00
Dmitri Gribenko
aeeb9c1325 Move collection testing code from StdlibUnittest to a new library
This brings down StdlibUnittest build time to 90 seconds with either
a DebugAssert or a ReleaseAssert compiler.

The new library, StdlibCollectionTests, is only built when running
validation tests.
2016-01-26 18:58:03 -08:00
Dmitri Gribenko
c497ea9da9 Revert "[SR-610][Stdlib] Use for-in to iterate over CollectionType elements" 2016-01-25 18:08:21 -08:00
Dmitri Gribenko
deac7566b0 CMake: remove stale comment 2016-01-25 17:19:58 -07:00
Károly Lőrentey
015004e3d5 [SR-610][stdlib] Use _initialize_to in _copyCollectionToNativeArrayBuffer
The Generator interface is specialized for iteration and is often faster than indexing.

Using _initialize_to results in a ~10% speedup for Dictionary. For collections with more complex iteration state (such as search trees with O(log(n)) indexing), this leads to a complexity class improvement.

This requires a small change to the testsuite, because the generate() method of Defaulted*RangeReplaceableSlice called Array(self), which now leads to infinite recursion.

https://bugs.swift.org/browse/SR-610
2016-01-25 19:47:43 +01:00
Trent Nadeau
160efd1023 Updated constraints and docs for popFirst/popLast. Added tests. 2016-01-23 18:01:06 +00:00
practicalswift
ca9e488f30 [gardening] Add "-*- swift -*-" to *.swift.gyb. Remove from *.swift. 2016-01-23 10:27:03 +01:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Erik Eckstein
716d0d7c17 Add a build option to compiler StdlibUnittest with -sil-serialize-all
This is the configurable version of 29214253e5
By default it's off.
2016-01-22 17:12:31 -08:00
Joe Pamer
5f29594cbf Revert "Reinstate "Compile StdlibUnittest with -sil-serialize-all."""
This reverts commit 29214253e5.

This change massively regresses test execution times for DebugAssert builds, where we won't currently benefit from this added validation.
Moving forward, we'll scope this exclusively to optimized builds.
2016-01-22 11:55:08 -08:00
Max Moiseev
70d346c083 [stdlib] test for negative count in RangeReplaceableCollection.init 2016-01-21 15:21:06 -08:00
Max Moiseev
e3bb2a0972 [stdlib] adding init(repeating:length:) to RangeReplaceableCollection 2016-01-21 12:27:09 -08:00
Erik Eckstein
29214253e5 Reinstate "Compile StdlibUnittest with -sil-serialize-all.""
This reinstates commit 79517a8edf.

Let's try again. All blocking problems should be resolved now.
Compiling StdlibUnittest with -sil-serialize-all gives a much higher test coverage because we can inline and optimize unittest code togeter with the test file.
It already helped to uncover some compiler bugs which we wouldn't have found without this change.

On the downside, a test-run in optimized mode takes considerable longer than before, because some tests need much longer to compile.
2016-01-21 12:18:39 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Chris Lattner
671eb1f4dd Merge pull request #976 from gregomni/associatedtype-in-stdlib
[stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
2016-01-17 14:09:06 -08:00
Anton Blanchard
b1827d8a8f Add powerpc64le Linux support
This patch adds powerpc64le Linux support. While the patch also adds
the matching powerpc64 bits, there are endian issues that need to be
sorted out.

The PowerPC LLVM changes for the swift ABI (eg returning three element
non-homogeneous aggregates) are still in the works, but a simple LLVM
fix to allow those aggregates results in swift passing all but 8
test cases.
2016-01-15 06:48:31 +00:00
gregomni
e2dee6b9dd [stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
Fixes deprecation warnings arising from addition of new
‘associatedtype’ keyword in sr-511.
2016-01-14 09:39:15 -08:00
Brian Gesiak
e4ef6ea4a4 [StdlibUnittest] Fix "'++' is deprecated" warning
`++` operators were being used for the implementation of a
StdlibUnittest helper function, in environments where the
Objective-C runtime was unavailable. Replace these with
successor functions.
2016-01-13 15:48:21 -08:00
Max Moiseev
08e1e4a043 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-11 16:51:11 -08:00
Dmitri Gribenko
f1be251514 Merge pull request #930 from dcci/define
[stdlib] Add missing defines for FreeBSD.
2016-01-09 16:08:37 -08:00
Davide Italiano
4fa7505b8b [stdlib] Add missing defines for FreeBSD.
This makes RaceTest and StdlibCoreExtras working there.
2016-01-10 00:07:47 +00:00
Greg Parker
c9f4dc0044 [test] Fail if a test file uses StdlibUnittest but runs no tests.
This catches accidental omission of runAllTests(). Previously
such test files would silently test nothing and succeed.
2016-01-09 03:27:56 -08:00
Davide Italiano
51736f16b4 [Glibc] Define 'extern char **environment' correctly on FreeBSD. 2016-01-08 21:52:14 +00:00
Davide Italiano
0001c9e227 [CMake] Spell freebsd correctly.
Case sensitiveness matters in this case.
2016-01-08 02:00:25 +00:00
Davide Italiano
f1b3965586 [stdlib] Port StdlibUnittest to FreeBSD. 2016-01-07 21:05:32 +00:00
Doug Gregor
1a38e0ad3b Merge branch 'master' into swift-3-api-guidelines 2016-01-06 15:32:55 -08:00
Max Moiseev
31f17e212c [stdlib] using static method dispatch instead of failable casts
Overriding `AnySequence.dropFirst` and `AnySequence.prefix` to delegate
these operations to an underlying sequence, thus simplifying default
implementations in `Sequence`.
2016-01-06 13:22:24 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Ling Wang
bb7119f4ae Add O(1) contains() implementation for Range with Comparable Element 2016-01-01 19:43:01 -06:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Dmitri Gribenko
9b15d03b73 StdlibUnittest: don't pass the name of the executable on the command line
Also, add a test for the command line of the child process.
2015-12-24 02:27:57 -08:00
Arsen Gasparyan
9203f36630 Refactoring 2015-12-24 12:18:59 +03:00
Arsen Gasparyan
31750a1690 Pass env variable through StdlibUnittest 2015-12-24 11:55:01 +03:00
Dmitri Gribenko
b1fdf56f5c stdlib: mark _preprocessingPass with @noescape 2015-12-23 14:56:15 -08:00
Dmitri Gribenko
2c20730419 stdlib: use more idiomatic closure syntax 2015-12-23 14:56:15 -08:00
Dmitri Gribenko
3877d04a73 Merge pull request #731 from ken0nek/add-spaces-before-and-after-arrow
Add spaces before and after closure arrow
2015-12-23 10:53:22 -08:00
Max Moiseev
200be71583 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-23 10:28:04 -08:00
Doug Gregor
5b35c786b8 Standard library unit testing: use static "#if" for OS kind determination.
There is absolutely no point in making this a runtime check, because
the library will be built differently on the different platforms
anyway. We only need to determine the version at runtime.
2015-12-22 16:18:28 -08:00