Commit Graph

830 Commits

Author SHA1 Message Date
Max Moiseev
37bf02f7da [stdlib][swift-3-indexing-model] changes in index(_:stepsFrom:limitedBy:)
- index(_:stepsFrom:limitedBy:) returns Index?
- formIndex(_:stepsFrom:limitedBy) returns Bool
2016-04-14 11:49:27 -07:00
Saleem Abdulrasool
9d987fe785 stdlib: use stubs for unit tests as well
This unifies the behaviour for imports across the private libc extras and the
public libc shims.
2016-04-14 09:45:52 -07:00
practicalswift
dc6c2aeef6 [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 23:03:55 +02:00
Dave Abrahams
1c3d998951 Revert "[gardening] "Type->Type" → "Type -> Type" in Swift code"
This reverts commit 14edeaf67a because
it's breaking tests:
https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastFailedBuild/consoleFull#1361088108ee1a197b-acac-4b17-83cf-a53b95139a76
2016-04-13 10:29:57 -07:00
practicalswift
0d130468b4 Merge pull request #2166 from practicalswift/arrows
[gardening] "Type->Type" → "Type -> Type" & "(t: Type)->Type" → "(t: Type) -> Type" in Swift code
2016-04-13 14:41:30 +02:00
swift-ci
7aba3c27da Merge pull request #2162 from modocache/remove-unused-subprocess 2016-04-13 01:53:25 -07:00
practicalswift
14edeaf67a [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 10:51:53 +02:00
swift-ci
728d21a00d Merge pull request #1442 from SwiftAndroid/master 2016-04-12 23:30:17 -07:00
Chris Lattner
8f1dc858e8 remove dead code. 2016-04-12 21:07:28 -07:00
swift-ci
55ebfd5d3c Merge pull request #2159 from practicalswift/add-whitespace 2016-04-12 19:02:00 -07:00
Zhuowei Zhang
7c502b6344 Port to Android
This adds an Android target for the stdlib. It is also the first
example of cross-compiling outside of Darwin.

Mailing list discussions:

1. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151207/000171.html
2. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000492.html

The Android variant of Swift may be built using the following `build-script`
invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  --android \                                    # Build for Android.
  --android-ndk ~/android-ndk-r10e \             # Path to an Android NDK.
  --android-ndk-version 21 \
  --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
  --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
  --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
  --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```

Android builds have the following dependencies, as can be seen in
the build script invocation:

1. An Android NDK of version 21 or greater, available to download
   here: http://developer.android.com/ndk/downloads/index.html.
2. A libicu compatible with android-armv7.
2016-04-12 19:26:21 -04:00
Brian Gesiak
005d01bce9 [PrivateLibcExtras] Remove unused methods
Remove `runChild()`, which is no longer used anywhere in the
codebase. Also remove `_readAll()`, which was only used within
`runChild()`.
2016-04-12 19:19:26 -04:00
Jordan Rose
b5127aa747 Adjust private API withArrayOfCStrings.
Produce UnsafeMutablePointers instead of UnsafePointers, because that
matches the signatures of posix_spawn, execve, and similar.
2016-04-12 14:30:27 -07:00
practicalswift
c760f6dfbf [gardening] Add whitespace: "foo,bar" → "foo, bar" 2016-04-12 22:31:46 +02:00
Jordan Rose
bc83940301 Make pointer nullability explicit using Optional.
Implements SE-0055: https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md

- Add NULL as an extra inhabitant of Builtin.RawPointer (currently
  hardcoded to 0 rather than being target-dependent).
- Import non-object pointers as Optional/IUO when nullable/null_unspecified
  (like everything else).
- Change the type checker's *-to-pointer conversions to handle a layer of
  optional.
- Use 'AutoreleasingUnsafeMutablePointer<NSError?>?' as the type of error
  parameters exported to Objective-C.
- Drop NilLiteralConvertible conformance for all pointer types.
- Update the standard library and then all the tests.

I've decided to leave this commit only updating existing tests; any new
tests will come in the following commits. (That may mean some additional
implementation work to follow.)

The other major piece that's missing here is migration. I'm hoping we get
a lot of that with Swift 1.1's work for optional object references, but
I still need to investigate.
2016-04-11 20:06:38 -07:00
Max Moiseev
0124bd261f [stdlib][swift-3-indexing-model] un-commenting and un-spliting .lazy usages 2016-04-11 17:58:52 -07:00
Jordan Rose
b911fda8ea [StdlibUnittest] Add expectNotEqual(expected: T?, actual: T?)
Also simplify the implementation of expectEqual(T?, T?).
2016-04-11 17:55:10 -07:00
Dmitri Gribenko
d52cbab5c2 Merge commit '0ff3239b962218267d37307e53906b31315a1cfc' into swift-3-indexing-model
This commit is the parent of the commit that implemented SE-0046
Establish consistent label behavior across all parameters including
first labels
2016-04-09 16:18:33 -07:00
Dmitri Gribenko
f4987d02ec stdlib: new indexing model: Forward more methods in AnyCollection 2016-04-08 20:29:10 -07:00
Dmitri Gribenko
4efc16b5f1 StdlibUnittest: strengthen constraints in check*AssociatedTypes() 2016-04-08 18:46:00 -07:00
Dmitri Gribenko
81fa3ee1ad StdlibCollectionUnittest: logging collections: update property names to match actual Collection API 2016-04-08 17:40:39 -07:00
Harlan Haskins
5d888873da [StdlibUnittest] Teach interpreter to run crash tests 2016-04-08 13:12:53 -07:00
Max Moiseev
6c56af5c1b [stdlib] splitting expressions with lazy to improve compilation time 2016-04-08 11:06:05 -07:00
Trent Nadeau
f96ad263a8 Added @discardableResult attr to mutating functions 2016-04-07 23:27:38 +00:00
Harlan
e6395343cf Update autoreleasepool definition in RaceTest
Missed in SE-0046 migration
2016-04-07 13:54:02 -07:00
practicalswift
66183cdbf7 [gardening] Fix unjustified spacing 2016-04-07 10:10:24 +02:00
Dmitri Gribenko
79c75f0c1a StdlibCollectionUnittest: simplify code 2016-04-06 23:31:31 -07:00
Dmitri Gribenko
6131df64d2 stdlib: make _preprocessingPass rethrowing and add tests 2016-04-06 23:22:26 -07:00
Dmitri Gribenko
55fa27008f StdlibCollectionUnittest: remove dead code
None of the minimal or defaulted collections raise expectation failures
when indexed out of bounds.  This idea seemed to be good on the surface,
but turned out not that nice or useful in practice.
2016-04-06 22:31:41 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dave Abrahams
5864117b1b [stdlib] De-underscore Range.init(uncheckedBounds:) 2016-04-06 09:20:30 -07:00
Dave Abrahams
db03708a3d [stdlib] De-underscore Range protocols
There's really no excuse for keeping these hidden; they appear in public
APIs.
2016-04-05 16:32:15 -07:00
Dmitri Gribenko
0bab6fc461 StdlibUnittest: add a doc comment to LifetimeTracked, and remove a fixme 2016-04-05 15:39:30 -07:00
Slava Pestov
11cff083d8 StdlibUnittest: Add a default case to a switch over a resilient enum
I'm not completely satisfied with this fix because we get a compiler
warning when compiling without -enable-resilience. Perhaps we need
a policy change that a default case in a switch only generates a
warning if the enum is *explicitly* @_fixed_layout (or eventually,
@closed or however this attribute ends up being written).
2016-04-05 00:28:34 -07:00
Dmitri Gribenko
9c392bfdcb StdlibCollectionUnittest: generalize MutableCollection.SubSequence.subscript(_: Range)/Set tests 2016-04-04 18:38:11 -07:00
Dmitri Gribenko
0a0825d18d Merge pull request #1972 from apple/StdlibUnittest-make-classes-final
StdlibUnittest: make TestSuite and other helper classes final
2016-04-04 15:10:46 -07:00
Dmitri Gribenko
6985b958fd Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-04 11:42:17 -07:00
Dmitri Gribenko
b34c419a5e StdlibCollectionUnittest: implement fast index(_:stepsFrom:) entry points in minimal collections 2016-04-04 10:46:57 -07:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Dmitri Gribenko
ffc0cab597 StdlibCollectionUnittest: remove two slow tests 2016-04-01 23:05:55 -07:00
Dmitri Gribenko
e43e25e3b7 StdlibUnittest: add optimized overloads for expectEqualsUnordered() 2016-04-01 23:05:19 -07:00
Dmitri Gribenko
a53fb16591 StdlibCollectionUnittest: use parameterized tests for out-of-range subscript tests
This change decreases the testing time a little bit.
2016-04-01 14:14:58 -07:00
Dmitri Gribenko
8891f437c9 StdlibCollectionUnittest: remove some redundant range checks to speed up tests 2016-04-01 14:14:57 -07:00
Dmitri Gribenko
69e921a36f StdlibUnittest: implement slice subscript writeback in minimal collections 2016-04-01 14:14:57 -07:00
Dmitri Gribenko
f784fd9a08 StdlibUnittest: fix infinite recursion in range checking in minimal collections 2016-04-01 14:14:57 -07:00
Dmitri Gribenko
067b244c3f StdlibCollectionUnittest: stricter range checking in minimal collections 2016-04-01 14:12:19 -07:00
Dmitri Gribenko
2b9737cc9c StdlibCollectionUnittest: implement out-of-range tests for slicing subscript 2016-04-01 14:12:18 -07:00
Dmitri Gribenko
6477740cda StdlibCollectionUnittest: share data sets between out-of-bounds and slicing tests 2016-04-01 14:12:18 -07:00
Dmitri Gribenko
bad2ff1bb7 StdlibUnittest: add assertions for range checks 2016-04-01 14:12:17 -07:00
Max Moiseev
171169b01f [stdlib][swift-3-indexing-model] fixing Arrays tests 2016-04-01 14:12:17 -07:00