Commit Graph

13 Commits

Author SHA1 Message Date
Slava Pestov
6bf9ab19ff Add preliminary library evolution test for resiliently adding a new protocol requirement
This test ensures that the runtime correctly instantiates resilient conformances,
and that IRGen emits the correct metadata, allowing a conformance that was
compiled before a new requirement was added to present a default implementation
of this requirement.

For now, this runs with --no-backward-deployment, so we only test before/before,
before/after and after/after cases.

Getting after/before working is also an expected capability here, but requires
IRGen witness table emission to know which requirements were satisfied by
defaults, so that they can be dropped if they appear at the end of a witness
table. In turn, this requires serializing SILDefaultWitnessTables. This will
be added in a subsequent patch.

In addition to fixing the above case, I need to write additional tests and
possibly fix bugs related to more elaborate cases involving generics, as well as
default witnesses for properties and subscripts.
2016-03-03 07:37:00 -08:00
Slava Pestov
c823974f85 Fix add_conformance evolution tests to pass with optimized builds
Even dynamically casting a generic parameter to a protocol type is only
guaranteed to succeed for conformances available at build time.

Since we can't express conditional availability of conformances yet,
this part of the test is useless, so redo it.
2016-02-13 18:21:58 -08:00
Slava Pestov
59a2e2aff8 Library evolution tests: add test for changing body of a transparent function
I'm going to add some more tests related to @_transparent shortly,
and it is important to verify that bodies of @_transparent functions
are serialized (at least in single-frontend mode, for now).

I realize this test is probably too specific, since in the future
we may sometimes choose not to inline @_transparent functions into
their callers, even if a serialized body is available; but this
will suffice for now.
2016-01-22 16:44:33 -08:00
Slava Pestov
14c9329920 Library evolution tests: preliminary tests for resiliently-sized classes
Note that subclassing of resilient classes doesn't work yet, and
there are no tests for it.
2016-01-22 16:04:38 -08:00
Slava Pestov
c5592e63ff Library evolution tests: split up struct_add_remove_properties into multiple tests 2016-01-22 16:04:29 -08:00
Slava Pestov
b6b5f8bfa9 Add preliminary enum evolution tests
These are passing now that resilient enum case numbering has been
implemented.
2016-01-21 12:10:58 -08:00
Slava Pestov
0159627322 As promised, split up struct_add_remove_conformances library evolution test
We now test four setups, with the four {before, after}^2 runs of each:

a) Client adds conformance -vs- library adds public conformance -- fixed-layout struct
b) Client adds conformance -vs- library removes internal conformance -- fixed-layout struct
c) Client adds conformance -vs- library adds public conformance -- resilient struct
d) Client adds conformance -vs- library removes internal conformance -- resilient struct

The first two pass, but a) requires a hack to ensure we don't
directly reference conformance table, otherwise the 'after_before'
version doesn't link. I think the right idea here is to weakly
reference conformance tables where the deployment target is
lower than the availability of the conformance.

The second two are XFAIL'd until protocol conformance tables can
reference resilient types from other modules. This requires emitting
indirect metadata symbols, since the client doesn't know if the
resilient type's metadata is direct or a template, and the
conformance table cannot use the metadata accessor either.

These tests will also become important if we decide to revisit
synthesized accessors, and make them lazy again for structs.
2016-01-20 19:08:13 -08:00
Slava Pestov
1b2288fa96 Add library evolution test for changing a static struct property from stored to computed 2016-01-16 02:28:39 -08:00
Slava Pestov
7e96a93372 Add library evolution tests for resiliently-sized and resiliently-accessed globals 2016-01-16 02:23:28 -08:00
David Farler
7229ce29df Convert resilient superclass dispatch tests to StdlibUnittest
Also run the full product of before/after combinations.
2016-01-15 22:22:26 -08:00
David Farler
762c1f62d1 Add before/after execution tests for resilient super method dispatch 2016-01-15 19:31:01 -08:00
practicalswift
19fdd8fd0d [gardening] Fix recently introduced typo. 2016-01-13 13:49:11 +01:00
Slava Pestov
e711d5e427 Preliminary evolution tests
Checking these in to get some discussion over FileCheck style and
test file structure going before I write too many more tests.
2016-01-13 01:32:27 -08:00