tree: d0975189ac09c6f0a2c5f51861273a7366c938b6 [path history] [tgz]
  1. Inputs/
  2. README.md
  3. test_backward_deploy_always_emit_into_client.swift
  4. test_backward_deploy_class.swift
  5. test_backward_deploy_enum.swift
  6. test_backward_deploy_protocol.swift
  7. test_backward_deploy_struct.swift
  8. test_backward_deploy_top_level.swift
  9. test_bitwise_takable.swift
  10. test_change_default_argument_to_magic.swift
  11. test_class_add_convenience_init.swift
  12. test_class_add_deinit.swift
  13. test_class_add_property.swift
  14. test_class_add_property_attribute.swift
  15. test_class_add_property_subclass.swift
  16. test_class_change_lazy_to_computed.swift
  17. test_class_change_size.swift
  18. test_class_change_stored_to_computed.swift
  19. test_class_change_stored_to_observed.swift
  20. test_class_fixed_layout_add_virtual_method.swift
  21. test_class_fixed_layout_add_virtual_method_subclass.swift
  22. test_class_fixed_layout_superclass_reorder_methods.swift
  23. test_class_insert_superclass.swift
  24. test_class_remove_property.swift
  25. test_class_resilient_add_override.swift
  26. test_class_resilient_add_virtual_method.swift
  27. test_class_resilient_add_virtual_method_subclass.swift
  28. test_class_resilient_superclass_methods.swift
  29. test_class_resilient_superclass_properties.swift
  30. test_class_resilient_superclass_reorder_methods.swift
  31. test_conformance_reference.swift
  32. test_enum_add_cases.swift
  33. test_enum_add_cases_trap.swift
  34. test_enum_change_size.swift
  35. test_enum_reorder_cases.swift
  36. test_function_change_transparent_body.swift
  37. test_generic_resilient_struct_add_property.swift
  38. test_global_change_size.swift
  39. test_global_stored_to_computed.swift
  40. test_keypath_default_argument.swift
  41. test_keypaths.swift.gyb
  42. test_move_method_to_extension.swift
  43. test_protocol_add_requirements.swift
  44. test_protocol_reorder_requirements.swift
  45. test_rth.swift
  46. test_struct_add_initializer.swift
  47. test_struct_add_property.swift
  48. test_struct_add_property_attribute.swift
  49. test_struct_change_lazy_to_computed.swift
  50. test_struct_change_size.swift
  51. test_struct_change_stored_to_computed.swift
  52. test_struct_change_stored_to_computed_static.swift
  53. test_struct_change_stored_to_observed.swift
  54. test_struct_fixed_layout_add_conformance.swift
  55. test_struct_fixed_layout_remove_conformance.swift
  56. test_struct_remove_property.swift
  57. test_struct_resilient_add_conformance.swift
  58. test_struct_resilient_remove_conformance.swift
  59. test_struct_static_stored_to_computed.swift
validation-test/Evolution/README.md

Resilient Library Evolution Tests

This directory tests for the correctness of resilience, which is a broad term for Swift maximizing binary compatibility of a dependency while maintaining the freedom to do things that would normally break clients in other languages, such as changing the layout of nominal types. The detailed explanation of resilience is out of scope of this little readme and can be found in docs/LibraryEvolution.rst.

Each main test file should compile against “before” and “after” versions of the corresponding library file. The old and new versions are selected via the BEFORE or AFTER preprocessor variables.

In the library, going from BEFORE to AFTER must be an ABI-compatible change, as documented in the library evolution specification.

In the main program, going from BEFORE to AFTER does not have to be backward compatible.

In the main file, use your test library's getVersion helper function to know which version of the library to expect at runtime.

There are four valid combinations for each test:

  1. Main file compiled against old library, linked against old library a.k.a. “before before”
  2. Main file compiled against old library, linked against new library, a.k.a. “before after”
  3. Main file compiled against new library, linked against old library, a.k.a. “after before”
  4. Main file compiled against new library, linked against new library, a.k.a. “after after”

The version of the library available at compile time determines which serialized declarations and transparent function bodies are visible.

When adding a new test, see the boilerplate at the top of each file for the general pattern for this kind of test. Use the StdlibUnittest library for assertions.