Commit Graph

362 Commits

Author SHA1 Message Date
Dave Abrahams
7221cd84df [stdlibunittest] Add expectations to TypeIndexed
Swift SVN r30138
2015-07-13 06:40:44 +00:00
Dmitri Hrybenko
4cfe818c43 StdlibUnittest: extract collection tests into a reusable generic testsuite
Swift SVN r30124
2015-07-12 01:04:38 +00:00
Dmitri Hrybenko
1d38db56da StdlibUnittest: add {Minimal|Default}***MutableCollection types
Swift SVN r30115
2015-07-11 08:48:38 +00:00
Dave Abrahams
069ba3ecf6 [stdlibunittest] Gyb-away code duplication in logging wrappers
Swift SVN r30110
2015-07-11 04:02:11 +00:00
Dave Abrahams
645e62769f [stdlibunittest] LoggingCollection should log *all* SequenceType operations.
Swift SVN r30108
2015-07-11 03:25:40 +00:00
Dave Abrahams
9d07acd368 [stdlib] SequenceType's _initializeTo should return the end position
Otherwise, the length of the sequence is in principle lost.  If you know
you have a sequence of less than 100 elements, you still want to know
exactly how many elements you initialized from it.

Swift SVN r30104
2015-07-11 01:43:27 +00:00
Dave Abrahams
6ab88e2ade [stdlibunittest] Add/use checkRandomAccessIndex
Swift SVN r30077
2015-07-10 18:51:19 +00:00
Dave Abrahams
c1f371a5b8 [stdlibunittest] Add checkStrideable
Also, apply it, in a rudimentary way, to our floating point types.

Swift SVN r30068
2015-07-10 14:27:11 +00:00
Dave Abrahams
c2b3005dba [stdlibunittest] Add/use checkComparable that tests laws
Swift SVN r30042
2015-07-09 21:40:58 +00:00
Dave Abrahams
7a614f76fc [stdlibunittest] Add/Use checkBidirectionalIndex
Swift SVN r30022
2015-07-09 17:10:27 +00:00
Dave Abrahams
76ec395dae [stdlibunittest] WIP Adding axiom checking
Check that the expected laws hold for models of Equatable, Hashable,
Incrementable, and ForwardIndexType.

Swift SVN r29988
2015-07-08 20:04:37 +00:00
Dave Abrahams
ef198daa2b [stdlibunittest] Finish threading new trace facility through
Swift SVN r29955
2015-07-08 02:52:27 +00:00
Jordan Rose
1edf9b3ae8 Check access for associated type requirements, too.
This is a straight-up "oops". You could always get to these typealiases via
the protocol, but like the member requirements you should have to say so.

Swift SVN r29952
2015-07-08 00:43:37 +00:00
Dave Abrahams
ce93b0a9e0 [stdlibunittest] Still more de-boilerplating WIP
Swift SVN r29951
2015-07-08 00:28:33 +00:00
Dave Abrahams
70ee2adc84 [stdlibunittest] More de-boilerplating WIP
Step 2.

Swift SVN r29936
2015-07-07 04:54:03 +00:00
Dave Abrahams
9abf32d521 [stdlibunittest] WIP uniformity/de-boilerplating
The way we pass and compose source locations, messages, etc. needs to be
brought under control before too many more tests get written.  This is
the first step.

Swift SVN r29928
2015-07-07 00:46:54 +00:00
David Farler
4d17bf0691 Remove SinkType and SinkOf
Remove these standard library types in favor of (T) -> () closures.

It was originally believed that generic optimizations would make these
types profitable, however:

// FIXME: Insert benchmarks here.

rdar://problem/21663799

Swift SVN r29927
2015-07-07 00:36:12 +00:00
Dmitri Hrybenko
4603431bd4 StdlibUnittest: implement more strict checks for using invalid indices
Add a shared buffer to every range replaceable mutable collection to
track logical mutations, and invalidate all indices on every mutation.

Swift SVN r29917
2015-07-06 16:12:03 +00:00
David Farler
402bbd3813 RangeReplaceableCollectionType review changes
- Clean up tests
  - Create API-specific test structures with clearer labels
  - Use `OpaqueValue`s in test collections
  - Make tests non-generic to allow array literal declarations
  - Remove some unused functions
  - Test return values for mutating functions that return a value
  - Add expect* test source locations
- Add _customRemoveLast ad-hoc default implementation for `removeLast`
- Add default implementation for reserveCapacity that does nothing.

Swift SVN r29905
2015-07-03 02:14:22 +00:00
Dmitri Hrybenko
1edcc49ff9 stdlib: remove Slice.Element typealias
It is misleading in generic code.  A testcase that was failing:

  expectEqualType(C.Generator.Element.self, Slice<C>.Element.self)

Swift SVN r29887
2015-07-02 06:44:38 +00:00
David Farler
060b1ab61b Remove redundant MinimalCollection for RangeReplaceable tests
There are usable variants gybbed into StdlibUnittest.

Swift SVN r29864
2015-07-01 23:44:15 +00:00
David Farler
438119d558 Fold ExtensibleCollectionType into RangeRaplaceableCollectionType
ExtensibleCollectionType's operations can all be represented by the
primitive range replacement operation, so fold it into
RangeReplaceableCollectionType.

In addition, provide default implementations of
RangeReplaceableCollectionType's methods.

- New tests added for combinations of (static, generic) calls and
  (default, custom) implementations.
- Mark free Swift functions as unavailable with a message to direct the
  developer to the protocol methods.
- Mark ExtensibleCollectionType as available with a message added to
  direct the developer to the right protocol.

rdar://problem/18220295

Swift SVN r29857
2015-07-01 22:33:04 +00:00
Dmitri Hrybenko
fc0fa96371 stdlib: de-underscore Indexable and add tests for it
Swift SVN r29847
2015-07-01 18:31:31 +00:00
Dmitri Hrybenko
76f5706b50 stdlib: de-underscore the Slice type and add tests for it
Swift SVN r29846
2015-07-01 18:31:29 +00:00
Dmitri Hrybenko
80b1380fe8 stdlib: fold Sliceable into CollectionType and de-underscore SubSequence
Swift SVN r29845
2015-07-01 18:31:25 +00:00
Dave Abrahams
10d7c3db50 [stdlibunittest] Use a legitimate TypeIdentifier
...instead of ObjectIdentifier, to wrap Any.Type, and add protocol
conformances.  ObjectIdentifier doesn't print nicely, because there's
really no type information left, and TypeIdentifier makes for better
output when tests fail.

Swift SVN r29813
2015-06-30 22:36:41 +00:00
Dave Abrahams
4bc3815135 [stdlibunittest] Missed update to CMakeLists.txt
Swift SVN r29791
2015-06-29 20:47:10 +00:00
Dave Abrahams
8c855e1ecf [stdlibunittest] automatic LifetimeTracked checking/setup
In setup and teardown, we can initialize and check for leaks

Swift SVN r29789
2015-06-29 20:45:50 +00:00
Dave Abrahams
e3ab9d4e27 [stdlibunittest] Make some globals class static
Swift SVN r29788
2015-06-29 20:45:49 +00:00
Dave Abrahams
7aed41190f [stdlibunittest] Automatically reset common test environment
Swift SVN r29787
2015-06-29 20:45:48 +00:00
Dave Abrahams
a35204ca55 [stdlibunittest] logging sequence/generator wrappers
Swift SVN r29786
2015-06-29 20:45:46 +00:00
Dave Abrahams
dcd46ea6df [stdlib] A system for concise testing of customization points.
This approach should help us massively reduce the amount of code it
takes to verify that the architecture of our protocols works as
expected.  Pair-programmed with Dmitri Hrybenko.

Swift SVN r29752
2015-06-27 02:31:26 +00:00
Dmitri Hrybenko
d3dff3e3a5 stdlib: rename generic parameters from T to Element
... for EmptyGenerator and EmptyCollection.

Part of rdar://21429126

Swift SVN r29622
2015-06-24 20:41:53 +00:00
Dmitri Hrybenko
57d85f70d7 stdlib: eliminate redundant implementations of 'generate()'
Swift SVN r29617
2015-06-24 20:41:47 +00:00
Dave Abrahams
46e6f767c1 StdlibUnittest: debugDescription for MinimalSequence
Swift SVN r29478
2015-06-18 05:05:09 +00:00
Dmitri Hrybenko
8387fc45b5 StdlibUnittest: add a facility to activate autorelease pools only on platforms that don't implement the return-autoreleased optimization
Swift SVN r29295
2015-06-04 09:06:16 +00:00
Dmitri Hrybenko
918c61f8bb stdlib: fix coding style in LifetimeTracked.swift
Swift SVN r29294
2015-06-04 09:06:09 +00:00
Greg Parker
48817b766e [test] Add watchOS to StdlibUnittest.
Swift SVN r29228
2015-06-02 08:30:10 +00:00
Joe Groff
72d82d1808 Darwin/Glibc overlays: Conditionalize SIG_* tokens.
Darwin libc and glibc use different typedefs for the signal handler type, and SIG_HOLD has different values. Conditionalize the definitions in their respective overlays.

Swift SVN r28921
2015-05-22 17:02:00 +00:00
Jordan Rose
cb4a1ad009 StdlibUnittest: Add another silly type annotation to make compiles faster.
No intended functionality change.

Swift SVN r28851
2015-05-20 21:28:34 +00:00
Dmitri Hrybenko
fe239e3d03 stdlib: de-underscore sort() and partition() methods
Swift SVN r28839
2015-05-20 19:34:36 +00:00
Dmitri Hrybenko
53f3ccf850 stdlib: change CollectionType.count() into a property
Swift SVN r28829
2015-05-20 09:14:43 +00:00
Dmitri Hrybenko
308f966359 StdlibUnittest: use correct assertions in MinimalRandomAccessIndex
Swift SVN r28815
2015-05-20 03:01:01 +00:00
Dmitri Hrybenko
d80baf7e1e stdlib: fix coding style
Swift SVN r28696
2015-05-18 04:37:28 +00:00
Slava Pestov
44efd2d777 MsgPack: use throw for backtracking instead of optionals
This is an experiment to play around with using 'try' for this type
of thing, as well as to catch bugs.

Swift SVN r28695
2015-05-18 02:38:41 +00:00
Dmitri Hrybenko
25d9a4fe32 stdlib: protocol extensions: de-underscore filter()
The API was adjusted according to the API review previously.

Swift SVN r28592
2015-05-15 00:37:01 +00:00
Chris Willmore
edce320567 Fix copy-paste error when detecting TVOS simulator environment in stdlib
unit tests.

Swift SVN r28546
2015-05-14 00:35:02 +00:00
Chris Willmore
9ac141e21b Add TVOS device testing support to the Swift project:
* Add --tvos option to swift-ios-test utility
* Mark failing tests appropriately
* Add support for TVOS predicates to stdlib unit tests

<rdar://problem/19854476> Swift: TV OS Testing Support

Swift SVN r28543
2015-05-14 00:12:17 +00:00
Dmitri Hrybenko
843d8a4eb7 stdlib: protocol extensions: de-underscore map()
Swift SVN r28502
2015-05-13 01:58:46 +00:00
Dmitri Hrybenko
0d42ed3eb2 StdlibUnittest: provide explanatory output about failing crash tests
Swift SVN r28404
2015-05-10 23:17:44 +00:00