Commit Graph

640 Commits

Author SHA1 Message Date
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -08:00
Dmitri Gribenko
b90470e2fe Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-19 09:51:53 -08:00
Dmitri Gribenko
98561f6137 stdlib: joinWithSeparator(_:) => join(separator:) 2016-02-18 22:30:57 -08:00
Dmitri Gribenko
a73390c06d stdlib tests: replace '__FILE__' and '__LINE__' with '#file' and '#line' 2016-02-18 18:48:29 -08:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
Dmitri Gribenko
65d840c0ae stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional 2016-02-18 00:40:33 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Dmitri Gribenko
0795970fa7 Merge pull request #1096 from mattrajca/master
Added an an overlay for IOKit that adds the kIOReturnError* constants
2016-02-17 09:11:25 -08:00
Brian Gesiak
42215042ae [validation-test] More granular FixedPoint tests
`FixedPoint.swift.gyb` generates a massive amount of assertions:
one for each `Int` type (such as `UInt8` and `Int64`) as a source,
to one of each `Int` type as a destination, for each of 27 bit
patterns. By my math that's 8 * 8 * 27 == 1728 assertions.
As a result, when one of those assertions fails, it's difficult to
tell what went wrong.

Split each assertion into its own test case. This makes the test
take a little longer to run, but it produces much more valuable
output when it fails.
2016-02-16 12:03:49 -05:00
Dmitri Gribenko
0e1c488f9a stdlib: print, debugPrint: 'toStream:' => 'to:' 2016-02-15 23:48:02 -08:00
Dmitri Gribenko
25cc2d5695 stdlib: add first argument labels to Set and Dictionary 2016-02-15 23:48:02 -08:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
gregomni
10370a5c0f Extend callee diagnoses to non-conforming complex args including generics.
Previously, type checking arguments worked fine if the entire arg was
UnresolvedType, but if the type just contained UnresolvedType, the
constraint system always failed via explicitly constraining to
unresolved.

Now in TypeCheckConstraints, if the solution allows for free variables
that are UnresolvedType, then also convert any incoming UnresolvedTypes
into variables. At worst, in the solution these just get converted back
into the same Unresolved that they started with.

This change allows for incorrect tuple/function type possibilities to
make it back out to CSDiag, where they can be more precisely diagnosed
with callee info. The rest of the changes are to correctly figure
out the failure info when evaluating more types of Types.

New diagnosis for a partial part of an arg type not confroming. Tests
added for that. Expected errors changed in several places where we
now get real types in the diagnosis instead of '(_)' unresolved.
2016-02-14 11:32:14 -08:00
Chris Lattner
a7dea79553 update validation test for diagnostics change. 2016-02-12 17:41:21 -08:00
Brian Gesiak
cc3165a0a9 [validation-test] Fix Swift 3 warnings in .gyb
Silence Swift 3 migration warnings:

- Replace `--` and `++` with `-= 1` and `+= 1`.
- Replace screaming snake case identifiers with `#file` and `#line`.
2016-02-11 11:42:59 -05:00
Max Moiseev
55fde4c923 making tests pass 2016-02-10 16:08:40 -08:00
Guillaume Lessard
99b703e8a4 Improve xfail and skip with better test predicates 2016-02-05 10:21:44 -07:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Slava Pestov
99b0e77d35 Merge pull request #1160 from gregomni/generic-func-args
[Sema] Extend callee diagnosis to complex args including generics, e.g. (Void) -> T
2016-02-03 22:55:15 -08:00
gregomni
6b30695869 Extend callee diagnosis to complex args including generics, e.g. (Void) -> T
Correctly determine callee closeness for func/ops that include generics
as part of more complicated parameters, i.e. tuple or closure args
containing generics as elements or args/results. Still only handling
single archetypes.

Also added code to check generic substitutions already made in the callee
parameters, which further helps diagnosis.
2016-02-03 22:54:19 -08:00
Dmitri Gribenko
0327fc3077 Merge pull request #1187 from glessard/increments
silence some warnings in validation-test/stdlib/Algorithm.swift
2016-02-03 10:37:06 -08:00
Dmitri Gribenko
00bde09962 Merge pull request #1186 from glessard/cite-bugreports
Cite bug reports in xfail annotations
2016-02-03 10:36:47 -08:00
Guillaume Lessard
f6e00cba4f Cite bug reports in xfail annotations 2016-02-03 11:29:38 -07:00
Guillaume Lessard
a4a338beb1 Replace ++ by "+= 1" 2016-02-03 11:23:36 -07:00
David Farler
8a5ed405bf Make var parameters an error for Swift 3
This finishes up revisions to SE-0003 - only var function parameters
are disallowed for Swift 3.
2016-01-30 12:39:17 -08:00
Dmitri Gribenko
27f422fe39 StdlibUnittest: move logging wrappers for collections to StdlibCollectionUnittest 2016-01-29 19:38:37 -07:00
David Farler
3f635d04c7 Reinstante var bindings in refutable patterns, except function parameters.
This reverts commits: b96e06da44,
                      8f2fbdc93a,
                      93b6962478,
                      64024118f4,
                      a759ca9141,
                      3434f9642b,
                      9f33429891,
                      47c043e8a6.

This commit leaves 'var' on function parameters as a warning to be
merged into Swift 2.2. For Swift 3, this will be an error, to be
converted in a follow-up.
2016-01-29 15:27:08 -08:00
Dmitri Gribenko
cf7e3f6df4 stdlib: Range.contains: fix coding style and make the function public
... so that it actually has a chance to get referenced in the witness
table.

But since the function is in a constrained extension, it can't be.
2016-01-29 13:24:59 -08:00
Dmitri Gribenko
a5a70dd14c StdlibUnittest: use ResettableValue more, removing error-prone boilerplate from tests 2016-01-29 13:24:59 -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
bc932451f2 Validation tests for .Never and .Always TestPredicate cases 2016-01-28 23:48:29 -07:00
Ling Wang
1ae71d4915 Merge from upstream and resolve conflicts 2016-01-28 11:13:42 -06:00
Ling Wang
148c821d2c Fix test failure 2016-01-28 09:35:00 -06:00
Austin Zheng
77918a86ac [SR-88] Reinstate Mirror migration changes, fix test issues
This reverts commit 182bb7f812.
2016-01-27 20:40:52 -08:00
Dmitri Gribenko
b4cd0e8e59 Re-enable validation-test/stdlib/XCTest.swift on OS X
The test only fails on iOS.
2016-01-27 14:09:33 -08:00
Ling Wang
29bd8cc1b5 Merge from upstream and resolve conflicts 2016-01-27 16:08:15 -06:00
Brian Gesiak
7138e08227 [validation-test][FreeBSD] xfail Foundation check
The "sorted/strings" test compares string sorting between Foundation
and ICU. Foundation is only available on OS X, so the test is expected
to fail on Linux. Foundation isn't available on FreeBSD either, so
disable it for that platform as well.
2016-01-27 16:46:48 -05:00
Andrew Trick
182bb7f812 Revert "Merge pull request #1058 from austinzheng/az-port-mirror"
This pull request broke the following tests on several build configurations
(eg --preset=buildbot,tools=RA,stdlib=DA)

    1_stdlib/Reflection.swift
    1_stdlib/ReflectionHashing.swift
    1_stdlib/UnsafePointer.swift.gyb

This reverts commit c223a3bf06, reversing
changes made to 5c2bb09b09.
2016-01-27 10:43:08 -08:00
Dmitri Gribenko
88b7d02e6a Merge pull request #1111 from glessard/string-tests-linux-dev
Make String validation tests runnable on Linux
2016-01-27 10:09:01 -08:00
Guillaume Lessard
de21de35d6 Make String validation tests runnable on Linux
Foundation-dependent tests are skipped.
2016-01-27 00:14:28 -07:00
Austin Zheng
10d5b23c30 [SR-88] Reinstate mirror migration commit
Changes:
- Reverted commit reverting original SR-88 commit
- Removed mirror children helper collections and related code
- Rewrote some tests to keep them working properly
- Wrote two more tests for the three pointer APIs to ensure no crashes if created using a value > Int64.max

This reverts commit 8917eb0e5a.
2016-01-26 19:28:32 -08: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
Matt Rajca
ea3894d524 Cleaned up IOKit overlay
- Removed unnecessary #if guard
- Used IOReturn instead of Int32 return type
- Avoided private access control for overlays
- Added a test to ensure the type of the constants matches the return type of a IOKit function
2016-01-26 20:10:21 -06:00
Dmitri Gribenko
9e3f23fc5f Regenerate the generated files after the generator script was updated 2016-01-25 17:42:41 -07:00
Matt Rajca
7e5c9d34ec Added an an overlay for IOKit that adds the kIOReturnError* constants
All of the constants and comments have been taken from IOKit/IOReturn.h: http://www.opensource.apple.com/source/xnu/xnu-792.13.8/iokit/IOKit/IOReturn.h

The type of the kIOReturn* constants is Int32 to match the type of kIOReturnSuccess (which does get imported to Swift since it isn't defined in terms of a macro).

Fixes: https://bugs.swift.org/browse/SR-576
2016-01-25 16:58:31 -06:00
practicalswift
1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Dmitri Gribenko
62f73f4469 Rename CollectionDefaultIterator to IndexingIterator 2016-01-21 11:49:03 -08:00