Browse Source

New Sheeeeeeeeet Lib.

marinofaggiana 5 years ago
parent
commit
ae93a251ca
100 changed files with 5477 additions and 6768 deletions
  1. 8 8
      Cartfile
  2. 8 8
      Cartfile.resolved
  3. 4 5
      Carthage/Checkouts/Sheeeeeeeeet/.gitignore
  4. 7 12
      Carthage/Checkouts/Sheeeeeeeeet/.swiftlint.yml
  5. 29 19
      Carthage/Checkouts/Sheeeeeeeeet/Fastlane/Fastfile
  6. 148 146
      Carthage/Checkouts/Sheeeeeeeeet/RELEASE_NOTES.md
  7. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Group.png
  8. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Logo.sketch
  9. 4 4
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet.podspec
  10. 0 24
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Info.plist
  11. 0 19
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Sheeeeeeeeet.h
  12. 1 1
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker.podspec
  13. 7 2
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLAlbumPopView.swift
  14. 101 39
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLAssetsCollection.swift
  15. 3 0
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLCollectionTableViewCell.swift
  16. 16 14
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLCollectionTableViewCell.xib
  17. 1 2
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift
  18. 42 10
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotoLibrary.swift
  19. 131 13
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift
  20. 13 15
      Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotosPickerViewController.xib
  21. 453 192
      Carthage/Checkouts/realm-cocoa/.jenkins.yml
  22. 5 0
      Carthage/Checkouts/realm-cocoa/.swiftlint.yml
  23. 232 1
      Carthage/Checkouts/realm-cocoa/CHANGELOG.md
  24. 3 1
      Carthage/Checkouts/realm-cocoa/Configuration/Base.xcconfig
  25. 5 3
      Carthage/Checkouts/realm-cocoa/Configuration/Realm/Realm.xcconfig
  26. 69 45
      Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability
  27. 18 46
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMObjectServerTests.mm
  28. 235 447
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMPermissionsAPITests.m
  29. 3 7
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMPermissionsTests.mm
  30. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftObjectServerTests.swift
  31. 22 101
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftPermissionsAPITests.swift
  32. 7 7
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftPermissionsTests.swift
  33. 6 0
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/test-ros-server.js
  34. 54 81
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/RealmCore.cmake
  35. 3 0
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/Sanitizers.cmake
  36. 0 2
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMakeLists.txt
  37. 3 3
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/Dockerfile
  38. 6 6
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/Jenkinsfile
  39. 2 2
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/dependencies.list
  40. 12 1
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/.gitattributes
  41. 4 3
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/.gitignore
  42. 221 150
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/.travis.yml
  43. 207 262
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/CMakeLists.txt
  44. 52 17
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/appveyor.yml
  45. BIN
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/catch-hand-icon.png
  46. BIN
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/catch-icon-tiny.png
  47. BIN
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/catch-logo-small.png
  48. 17 9
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/conanfile.py
  49. 60 20
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/contrib/ParseAndAddCatchTests.cmake
  50. 76 16
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/assertions.md
  51. 0 143
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/build-systems.md
  52. 106 9
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/command-line.md
  53. 5 1
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/commercial-users.md
  54. 186 64
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/configuration.md
  55. 126 17
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/contributing.md
  56. 11 9
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/event-listeners.md
  57. 74 27
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/limitations.md
  58. 95 18
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/logging.md
  59. 102 15
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/matchers.md
  60. 55 18
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/opensource-users.md
  61. 73 14
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/own-main.md
  62. 737 96
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/release-notes.md
  63. 37 28
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/release-process.md
  64. 6 5
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/reporters.md
  65. 12 4
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/slow-compiles.md
  66. 198 11
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/test-cases-and-sections.md
  67. 112 1
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/test-fixtures.md
  68. 97 27
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/tostring.md
  69. 66 36
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/tutorial.md
  70. 18 18
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/why-catch.md
  71. 371 139
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/catch.hpp
  72. 0 272
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/catch_session.hpp
  73. 0 1054
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/external/clara.h
  74. 0 168
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/external/tbc_text_format.h
  75. 0 202
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_approx.hpp
  76. 13 83
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_assertionresult.h
  77. 0 109
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_assertionresult.hpp
  78. 84 113
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_capture.hpp
  79. 14 8
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_clara.h
  80. 0 240
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_commandline.hpp
  81. 27 81
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_common.h
  82. 0 119
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_common.hpp
  83. 216 200
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_compiler_capabilities.h
  84. 74 110
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_config.hpp
  85. 0 67
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_console_colour.hpp
  86. 0 192
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_console_colour_impl.hpp
  87. 26 13
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_context.h
  88. 0 110
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_context_impl.hpp
  89. 4 16
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_debugger.h
  90. 0 131
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_debugger.hpp
  91. 6 5
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_default_main.hpp
  92. 0 25
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_errno_guard.hpp
  93. 0 220
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_evaluate.hpp
  94. 0 73
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_exception_translator_registry.hpp
  95. 0 174
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_expression_lhs.hpp
  96. 0 200
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_fatal_condition.hpp
  97. 163 139
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_generators.hpp
  98. 0 86
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_generators_impl.hpp
  99. 8 85
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_impl.hpp
  100. 56 9
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_interfaces_capture.h

+ 8 - 8
Cartfile

@@ -1,25 +1,25 @@
-github "nextcloud/ios-communication-library" "v0.1"
-github "tilltue/TLPhotoPicker" "1.9.3"
+github "nextcloud/ios-communication-library" "develop"
+github "tilltue/TLPhotoPicker" "2.0.7"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
-github "danielsaidi/Sheeeeeeeeet" "2.0.2"
+github "danielsaidi/Sheeeeeeeeet" "3.0.9"
 github "MortimerGoro/MGSwipeTableCell" "1.6.8"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "calimarkus/JDStatusBarNotification" "1.6.0"
 github "ChangbaDevs/KTVHTTPCache" "2.0.1"
 github "jdg/MBProgressHUD" "1.1.0"
-github "realm/realm-cocoa" "v3.17.3"
+github "realm/realm-cocoa" "v4.1.1"
 github "SVGKit/SVGKit" "3.x"
-github "WeTransfer/WeScan" "v1.1.0"
+github "WeTransfer/WeScan" "1.2.0"
 github "malcommac/SwiftRichString"
 github "yannickl/QRCodeReader.swift" "10.1.1"
-github "weichsel/ZIPFoundation" "0.9.9"
+github "weichsel/ZIPFoundation" "0.9.10"
 github "rechsteiner/Parchment" "v1.7.0"
-github "WenchaoD/FSCalendar" "2.8.0"
+github "WenchaoD/FSCalendar" "2.8.1"
 github "AssistoLab/DropDown" "v2.3.13"
 github "krzyzanowskim/OpenSSL" "1.0.218"
 github "Alamofire/Alamofire" "5.0.0-rc.2"
 github "https://github.com/yahoojapan/SwiftyXMLParser" "5.1.0"
-github "SwiftyJSON/SwiftyJSON" "4.3.0"
+github "SwiftyJSON/SwiftyJSON" "5.0.0"
 
 github "https://github.com/marinofaggiana/FastScroll" "master"
 github "https://github.com/marinofaggiana/AFNetworking" "master"

+ 8 - 8
Cartfile.resolved

@@ -4,11 +4,11 @@ github "ChangbaDevs/KTVHTTPCache" "2.0.1"
 github "CocoaLumberjack/CocoaLumberjack" "3.6.0"
 github "MortimerGoro/MGSwipeTableCell" "1.6.8"
 github "SVGKit/SVGKit" "8560ef56bd61e34d5cd8d9739954f9765e3ac794"
-github "SwiftyJSON/SwiftyJSON" "4.3.0"
-github "WeTransfer/WeScan" "v1.1.0"
-github "WenchaoD/FSCalendar" "2.8.0"
+github "SwiftyJSON/SwiftyJSON" "5.0.0"
+github "WeTransfer/WeScan" "1.2.0"
+github "WenchaoD/FSCalendar" "2.8.1"
 github "calimarkus/JDStatusBarNotification" "1.6.0"
-github "danielsaidi/Sheeeeeeeeet" "2.0.2"
+github "danielsaidi/Sheeeeeeeeet" "3.0.9"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "jdg/MBProgressHUD" "1.1.0"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
@@ -16,10 +16,10 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.0.3"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/FastScroll" "81967c2309d29bc2c330d422da612160a30bade8"
-github "nextcloud/ios-communication-library" "v0.1"
-github "realm/realm-cocoa" "v3.17.3"
+github "nextcloud/ios-communication-library" "9e7b4a9ceded729d9199d3565d095ca37fa35263"
+github "realm/realm-cocoa" "v4.1.1"
 github "rechsteiner/Parchment" "v1.7.0"
-github "tilltue/TLPhotoPicker" "1.9.3"
-github "weichsel/ZIPFoundation" "0.9.9"
+github "tilltue/TLPhotoPicker" "2.0.7"
+github "weichsel/ZIPFoundation" "0.9.10"
 github "yahoojapan/SwiftyXMLParser" "5.1.0"
 github "yannickl/QRCodeReader.swift" "10.1.1"

+ 4 - 5
Carthage/Checkouts/Sheeeeeeeeet/.gitignore

@@ -1,9 +1,8 @@
-# Xcode
-#
-# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
-
-# OS X
+# SPM defaults
 .DS_Store
+/.build
+/Packages
+xcuserdata/
 
 ## Build generated
 build/

+ 7 - 12
Carthage/Checkouts/Sheeeeeeeeet/.swiftlint.yml

@@ -1,26 +1,21 @@
 disabled_rules:
-  - cyclomatic_complexity
   - file_length
   - function_body_length
-  - identifier_name
   - line_length
-  - shorthand_operator
+  - todo
   - trailing_whitespace
   - type_body_length
   - type_name
   - vertical_whitespace
   - void_return
+  - weak_delegate
 
-excluded:
-  - Pods
-  - Carthage
+included:
+  - Sources
+  - Tests
 
-# This is a strange one, since it also includes init functions
-function_parameter_count:
-  warning: 8
-  error: 8
-
-variable_name:
+identifier_name:
   excluded:
+    - id
     - ok
     - vc

+ 29 - 19
Carthage/Checkouts/Sheeeeeeeeet/Fastlane/Fastfile

@@ -1,10 +1,29 @@
-fastlane_version "2.30.2"
+fastlane_version "2.129.0"
 
 default_platform :ios
 
 platform :ios do
 
 
+  # Dependencies ***********************
+
+  desc "Resolve External Dependencies (the shell script makes Bitrise work)"
+  lane :resolve_dependencies do
+    sh("cd .. && xcodebuild -showBuildSettings -project Sheeeeeeeeet.xcodeproj -scheme Sheeeeeeeeet")
+    spm(command: "resolve")
+  end
+
+
+  # Test =======================
+  
+  desc "Run unit tests"
+  lane :test do
+    swiftlint(strict: true)
+    resolve_dependencies
+    run_tests(scheme: "Sheeeeeeeeet")
+  end
+
+
   # Version ================
 
   desc "Create a new version"
@@ -12,15 +31,17 @@ platform :ios do
     ensure_git_status_clean
     ensure_git_branch(branch: 'master')
     test
-    version = version_bump_podspec(path: "Sheeeeeeeeet.podspec", version_number: options[:name])
+
+    bump_type = options[:type]
+    if bump_type == nil or bump_type.empty?
+      bump_type = "patch"
+    end
+    
+    version = version_bump_podspec(path: "Sheeeeeeeeet.podspec", bump_type: bump_type)
     increment_version_number(version_number: version)
 
     git_commit(
-      path: [
-        "Sheeeeeeeeet.podspec",
-        "*/Info.plist",
-        "*/*.pbxproj",
-        "Fastlane/"],
+      path: "*",
       message: "Bump to #{version}"
     )
 
@@ -29,15 +50,4 @@ platform :ios do
     push_to_git_remote()
     pod_push()
   end
-
-  
-  # Test =======================
-
-  desc "Run unit tests"
-  lane :test do
-    scan(
-      project: "Sheeeeeeeeet.xcodeproj",
-      scheme: "Sheeeeeeeeet"
-    )    
-  end
-end
+end

+ 148 - 146
Carthage/Checkouts/Sheeeeeeeeet/RELEASE_NOTES.md

@@ -1,130 +1,180 @@
 # Release Notes
 
 
+## 3.0.9
+
+This version adjusts the secondary action to be a regular menu item action.
+
+
+## 3.0.8
+
+This version adjusts the secondary action signature to also provide the affected item. It's a breaking change, but a small one, so deal with it I guess  ¯\_(ツ)_/¯
+
+This version also make sthe `ActionSheetItemHandler` protocol implementations `open` so they're possible to override.
+
+
+## 3.0.7
+
+This version adds a new `SecondaryActionItem` which lets you specify a secondary action for an item.
+
+It also adds a new `MenuCreator` protocol that can be implemented to postpone the creation of a menu, which may be good for prestanda when adding a context menu to every item in a large view collection.
+
+
+## 3.0.6
+
+This version solves an App Store submission rejection that occurred when an app pulled in Sheeeeeeeeet with Carthage.
+
+
+## 3.0.5
+
+This version changes `ContextMenuDelegateRetainer`'s `contextMenuDelegate` to an `Any` instead of its concrete type, to make it possible to use it on older iOS versions. This should not have any side-effects, since it's only used to retain the instance, never use it.
+
+
+## 3.0.4
+
+This version makes the `ActionSheet`'s `backgroundView` property public.
+
+
+## 3.0.3
+
+This version fixes some subtitle problems, where section titles and mutli select toggles didn't display their subtitles.
+
+It also fixes some behavior issues, where subtitles were incorrectly tinted.
+
+
+## 3.0.2
+
+This version adjusts the popover height calculations to include the height of a visible header. This solves the problem where the popover content would always scroll when a header was used.
+
+The version also adjusts the item height calculations, so that you no longer have to register a height for each item. This solves the problem with all items getting a zero size by default. Now, `height` is recursively resolved to the closest parent height if you haven't overridden `appearance().height` for your custom item.
+
+
+## 3.0.1
+
+This version adjusts the subtitle style to use `subtitle` instead of `value1`.
+
+It also adds a new `preferredActionSheetCellStyle` property to `MenuItem`, which you can override for your custom items.
+
+
+## 3.0.0
+
+Sheeeeeeeeet 3 contains many breaking changes, but once you understand the model changes, you will hopefully see the improvements it brings and be able to migrate your apps pretty easily. See [this migration guide][Migration-Guide] for help.
+
+This version separates the menu data model from the custom action sheet implementation, so that you can create menus without caring about how they will be presented.
+
+The new `Menu` type and all `MenuItem` types are decoupled from the presentation. This means that you can use them in more ways, for instance in custom and native action sheets, context menus etc.
+
+With these changes, you now create `ActionSheet`s with a `Menu` instead of `ActionSheetItem`s. Due to this, the `3.0` release of Sheeeeeeeeet has many breaking changes:
+ 
+ * All `ActionSheetItem` have been replaced by the new `MenuItem` types. Most of these items have the same name as the old ones, but without the `ActionSheet` prefix.
+ * `ActionSheetDangerButton` corresponds to the new `DestructiveButton` class.
+ * `ActionSheetCustomItemContentCell` has been moved and renamed to `CustomItemType`.
+ * `ActionSheetCollectionItemContentCell` has been moved and renamed to `CollectionItemType`.
+ 
+ There are also some breaking changes that involve how you work with action sheets:
+
+ * Item heights are no longer static, but an action sheet cell appearance proxy property.
+ * The action sheet header behavior is now specified in a `headerViewConfiguration` property.
+ * `CustomItem` (`ActionSheetCustomItem`) has been made non-generic.
+ * `isOkButton` and `isCancelButton` is gone. Use type checking instead, e.g. `is OkButton`.
+
+Bonus features:
+
+* The popover presenter now supports header views. It no longer hides the header by default.
+* `Menu` can be used to create action sheets, which you then present and configure like before.
+* `Menu` can be directly presented as a custom action sheet, without creating an `ActionSheet`.
+* `Menu` can be added as an iOS 13 context menu to any view.
+* `Menu` can be presented as a native `UIAlertController`.
+
+Some of the presentations above require that all items in the menu can be represented in that context.
+
+
+## 2.1.0
+
+This version adds Xcode 11 and iOS 13 support, including support for dark mode and high contrast color variants.
+
+There is a new `ActionSheetColor` enum with sheet-specific semantic colors. It uses the new, adaptive system colors in iOS 13 and falls back to older, non-adaptive colors in iOS 12 and below. You can either use the enum directly or use the static `UIColor` extension `.sheetColor(...)`.
+
+The appearance model has been extended with new a appearance type, which you can use to style your sheets. There is an `ActionSheetAppearance` base class as well as a standard `StandardActionSheetAppearance` appearance which applies a standard look, including dark mode support, high contrast color variants and SFSymbol icons on iOS 13.
+
+There are adjustments to how sheets can be dismissed. The `isDismissableWithTapOnBackground` has been renamed to `isDismissable`, since it also affects if the system can dismiss the action sheet.
+
+
 ## 2.0.2
 
-This version makes table view footer view sizes smaller to avoid a scroll offset
-issue that could occur when rotating devices that displayed sheets with a single
-custom item.
+This version makes table view footer view sizes smaller to avoid a scroll offset issue that could occur when rotating devices that displayed sheets with a single custom item.
 
 
 ## 2.0.1
 
-This version adjusts accessibility traits for selected select items and improves
-the overall accessibility experience when working with selectable items.
+This version adjusts accessibility traits for selected select items and improves the overall accessibility experience when working with selectable items.
 
 
 ## 2.0.0
 
-This version upgrades Sheeeeeeeeet and its unit test dependencies to Swift 5. The
-version contains no breaking changes.
+This version upgrades Sheeeeeeeeet and its unit test dependencies to Swift 5. It contains no breaking changes.
 
 
 ## 1.4.1
 
-This version makes `currentContext` the default presentation mode for the default
-presenter. This is due to accessibility issues with using `keyWindow` while being
-ina modal presentation. I will change how the default presenteras presents action
-sheets, but that is a future improvement.
+This version makes `currentContext` the default presentation mode for the default presenter. This is due to accessibility issues with using `keyWindow` while being ina modal presentation. I will change how the default presenteras presents action sheets, but that is a future improvement.
 
 
 ## 1.4.0
 
-This version removes the old deprecated appearance model, so if your app uses it,
-it's time to start using the appearance proxy model. Just follow the readme, and
-you'll be done in no time.
+This version removes the old deprecated appearance model, so if your app uses it, it's time to start using the appearance proxy model. Just follow the readme, and you'll be done in no time.
 
-This version also change which presenter to use, so that apps behaves correct on
-iPads in split screen. We still have to come up with a way to switch between the
-default and popover presenters when the split screen size changes, but that is a
-future improvement.
+This version also change which presenter to use, so that apps behaves correct on iPads in split screen. We still have to come up with a way to switch between the default and popover presenters when the split screen size changes, but that is a future improvement.
 
 
 ## 1.3.3
 
-This version adds a new `headerViewLandscapeMode` property to `ActionSheet`. You
-can set it to `.hidden` to let action sheets hide their header view in landscape
-orientation. This will free up more screen estate for the action sheet's options.
+This version adds a new `headerViewLandscapeMode` property to `ActionSheet`. You can set it to `.hidden` to let action sheets hide their header view in landscape orientation. This will free up more screen estate for the action sheet's options.
 
 
 ## 1.3.3
 
-This version adds a new `headerViewLandscapeMode` property to `ActionSheet`. You
-can set it to `.hidden` to let action sheets hide their header view in landscape
-orientation. This will free up more screen estate for the action sheet's options.
+This version adds a new `headerViewLandscapeMode` property to `ActionSheet`. You can set it to `.hidden` to let action sheets hide their header view in landscape orientation. This will free up more screen estate for the action sheet's options.
 
 
 ## 1.3.2
 
-This version makes the `ActionSheet` `backgroundView` outlet public, so that you
-can add your own custom effects to it. The other outlets are still internal.
+This version makes the `ActionSheet` `backgroundView` outlet public, so that you can add your own custom effects to it. The other outlets are still internal.
 
-The version also fixes a bug that caused action sheets to be misplaced when they
-were presented from a custom presentation controller. This fix also adds a brand
-new `presentationStyle` property to `StandardActionSheetPresenter`, which can be
-either `keyWindow` (default) or `currentContext`. Setting it to `keyWindow` will
-present the action sheet in the app's key window (full screen), while setting it
-to `currentContext` will present it in the presenting view controller's view (it
-looks straaange, but perhaps you can find a nice use case for it).
+The version also fixes a bug that caused action sheets to be misplaced when they were presented from a custom presentation controller. This fix also adds a brand new `presentationStyle` property to `StandardActionSheetPresenter`, which can be either `keyWindow` (default) or `currentContext`. Setting it to `keyWindow` will present the action sheet in the app's key window (full screen), while setting it to `currentContext` will present it in the presenting view controller's view (it looks straaange, but perhaps you can find a nice use case for it).
 
 
 ## 1.3.1
 
-This version fixes an iOS 9 bug that caused the popover to become square with no
-arrow. It was caused by the popover presenter, that set the background color for
-the popover after it had been presented, which is not supported in iOS 9. It now
-sets the bg color for all iOS versions before it presents the popover, then only
-refreshes it for iOS 10 and later.
+This version fixes an iOS 9 bug that caused the popover to become square with no arrow. It was caused by the popover presenter, that set the background color for the popover after it had been presented, which is not supported in iOS 9. It now sets the bg color for all iOS versions before it presents the popover, then only refreshes it for iOS 10 and later.
 
-This version fixes another iOS 9 bug that caused the item cell separator line to
-behave strangely and not honor the insets set using the appearance proxy. I have
-added a fix to the item cell class, that only runs for iOS 9.
+This version fixes another iOS 9 bug that caused the item cell separator line to behave strangely and not honor the insets set using the appearance proxy. I have added a fix to the item cell class, that only runs for iOS 9.
 
 
 ## 1.3.0
 
 This version removes the last separator line from the item and button table view.
 
-This version also changes the default behavior of the popover presenter. It used
-to keep the popover presented as the device orientation changed, but this can be
-wrong in many cases. For instance, in collection or table views, the orientation
-change may cause cells to shuffle around as they are reused. If a reused cell is
-used as the popover source view, and the popover is still presented, the popover
-will point to the cell, but the cell model will have changed. In this case, your
-action sheet will appear to point to a specific object, but will be contextually
-bound to another one. 
+This version also changes the default behavior of the popover presenter. It used to keep the popover presented as the device orientation changed, but this can be wrong in many cases. For instance, in collection or table views, the orientation change may cause cells to shuffle around as they are reused. If a reused cell is used as the popover source view, and the popover is still presented, the popover will point to the cell, but the cell model will have changed. In this case, your action sheet will appear to point to a specific object, but will be contextually bound to another one. 
 
-Another way that orientation changes may mess with popovers are if a source view
-is removed from the view hierarchy when the orientation changes. If your popover
-is still presented, but the source view is removed, the popover arrow will point
-to a random point, e.g. the top-left part of the screen.
+Another way that orientation changes may mess with popovers are if a source view is removed from the view hierarchy when the orientation changes. If your popover is still presented, but the source view is removed, the popover arrow will point to a random point, e.g. the top-left part of the screen.
 
-To solve these bugs, I have added new orientation change handling in the popover
-presenter. It has a new `isListeningToOrientationChanges` property, as well as a
-`handleOrientationChange` and `setupOrientationChangeDetection` function. If you
-want to, you can override these functions to customize their behavior, otherwise
-just set `isListeningToOrientationChanges` to `false` to make the popover behave
-like before.
+To solve these bugs, I have added new orientation change handling in the popover presenter. It has a new `isListeningToOrientationChanges` property, as well as a `handleOrientationChange` and `setupOrientationChangeDetection` function. If you want to, you can override these functions to customize their behavior, otherwise just set `isListeningToOrientationChanges` to `false` to make the popover behave like before.
 
 
 ## 1.2.4
 
-This version fixes the https://github.com/danielsaidi/Sheeeeeeeeet/issues/64 bug,
-which caused an iPad popover to become a bottom action sheet on black background,
-if the idiom changes from pad to phone while the action sheet is open. I now let
-the popover remain as long as the action sheet is open.
+This version fixes the https://github.com/danielsaidi/Sheeeeeeeeet/issues/64 bug, which caused an iPad popover to become a bottom action sheet on black background, if the idiom changes from pad to phone while the action sheet is open. I now let the popover remain as long as the action sheet is open.
 
 
 ## 1.2.3
 
-This version reloads data when scrolling to row to solve a bug that could happen
-on some iPad devices.
+This version reloads data when scrolling to row to solve a bug that could happen on some iPad devices.
 
 
 ## 1.2.2
 
-This hotfix adds two new properties to `ActionSheetSelectItem`, that can be used
-to style the selected fonts: `selectedTitleFont` and `selectedSubtitleFont`.
+This hotfix adds two new properties to `ActionSheetSelectItem`, that can be used to style the selected fonts: `selectedTitleFont` and `selectedSubtitleFont`.
 
 
 ## 1.2.1
@@ -134,27 +184,17 @@ This hotfix fixes a font bug in the title item and color bugs in the select item
 
 ## 1.2.0
 
-This is a huge update, that completely rewrites how action sheet appearances are
-handled. Instead of the old appearance model, Sheeeeeeeeet now relies on the iOS
-appearance proxy model as much as possible.
+This is a huge update, that completely rewrites how action sheet appearances are handled. Instead of the old appearance model, Sheeeeeeeeet now relies on the iOS appearance proxy model as much as possible.
 
-The old appearance model is still around, but has been marked as deprecated, and
-will be removed in `1.4.0`. Make sure that you switch over to the new appearance
-model as soon as possible. Have a look at the example app and [here][Appearance]
-to see how you should customize the action sheet appearance from now on.
+The old appearance model is still around, but has been marked as deprecated, and will be removed in `1.4.0`. Make sure that you switch over to the new appearance model as soon as possible. Have a look at the example app and [here][Appearance] to see how you should customize the action sheet appearance from now on. 
 
 In short, item appearance customizations are handled in three different ways now:
 
-* Item appearances such as colors and fonts, are customized with cell properties,
-for instance: `ActionSheetSelectItemCell.appearance().titleColor = .green`.
-* Item heights are now customized by setting the `height` property of every item
-type you want to customize, for instance: `ActionSheetTitle.height = 22`.
-* Action sheet margins, insets etc. are now customized by setting the properties
-of each `ActionSheet` instance. If you want to change the default values for all
-action sheets in your app, you have to subclass `ActionSheet`.
+* Item appearances such as colors and fonts, are customized with cell properties, for instance: `ActionSheetSelectItemCell.appearance().titleColor = .green`.
+* Item heights are now customized by setting the `height` property of every item type you want to customize, for instance: `ActionSheetTitle.height = 22`.
+* Action sheet margins, insets etc. are now customized by setting the properties of each `ActionSheet` instance. If you want to change the default values for all action sheets in your app, you have to subclass `ActionSheet`.
 
-All built-in action sheet items now have their own cells. Your custom items only
-have to use custom cells if you want to apply custom item appearances to them.
+All built-in action sheet items now have their own cells. Your custom items only have to use custom cells if you want to apply custom item appearances to them.
 
 Sheeeeeeeeet now contains several new views, which are used by the action sheets:
 
@@ -164,75 +204,54 @@ Sheeeeeeeeet now contains several new views, which are used by the action sheets
   * `ActionSheetBackgroundView`
   * `ActionSheetStackView`
 
-The new classes make it easy to modify the appearance of these views, since they
-have appearance properties as well. For instance, to change the corner radius of
-the table views, just type: `ActionSheetTableView.appearance().cornerRadius = 8`.
+The new classes make it easy to modify the appearance of these views, since they have appearance properties as well. For instance, to change the corner radius of the table views, just type: `ActionSheetTableView.appearance().cornerRadius = 8`.
 
 `ActionSheet` has two new extensions: 
   * `items<T>(ofType:)`
   * `scrollToFirstSelectedItem(at:)`
 
-This new version has also rebuilt all unit tests from scratch. They are now more
-robust and easier to maintain.
+This new version has also rebuilt all unit tests from scratch. They are now more robust and easier to maintain.
 
 
 ## 1.1.0
 
-This version increases the action sheet integrity by restricting what you can do
-with it. This involves some breaking changes, but they should not affect you. If
-you think any new rule is bad or affect you, please let me know.
+This version increases the action sheet integrity by restricting what you can do with it. This involves some breaking changes, but they should not affect you. If you think any new rule is bad or affect you, please let me know.
 
 
 **New Features**
 
-@sebbo176 has added support for subtitles in the various select items, which now
-also changes the cell style of an item if the subtitle is set. He has also added
-an unselected icon to the select items, which means that you can now have images
-for unselected items as well (e.g. an unchecked checkbox).
+@sebbo176 has added support for subtitles in the various select items, which now also changes the cell style of an item if the subtitle is set. He has also added an unselected icon to the select items, which means that you can now have images for unselected items as well (e.g. an unchecked checkbox).
 
 
 **Breaking Changes - ActionSheet:**
 
-* The `items` and `buttons` properties are now `internal(set)`, which means that
-they can only be set with `init(...)` or with `setup(items:)`. This protects the
-integrity of the item and button separation logic.
-
-* The code no longer contains any `didSet` events, since these events called the
-same functionality many times. Call `refresh` if you change any outlets manually
-from now on.
-
-* Since the `didSet` events have been removed, `refreshHeaderVisibility` is only
-called once and has therefore been moved into `refreshHeader`.
-
-* Since the `didSet` events have been removed, `refreshButtonsVisibility` is now
-only called once and has therefore been moved into `refreshButtons`.
-
+* The `items` and `buttons` properties are now `internal(set)`, which means that they can only be set with `init(...)` or with `setup(items:)`. This protects the integrity of the item and button separation logic.
+* The code no longer contains any `didSet` events, since these events called the same functionality many times. Call `refresh` if you change any outlets manually from now on.
+* Since the `didSet` events have been removed, `refreshHeaderVisibility` is only called once and has therefore been moved into `refreshHeader`.
+* Since the `didSet` events have been removed, `refreshButtonsVisibility` is now only called once and has therefore been moved into `refreshButtons`.
 * A small delay in `handleTap(on:)`, that should not be needed, has been removed.
+
 Let me know if it causes any side-effects.
 
 
 
 ## 1.0.3
 
-This version removes a debug print that I used to ensure that action sheets were
-properly deinitialized after being dismissed.
+This version removes a debug print that I used to ensure that action sheets were properly deinitialized after being dismissed.
 
 
 
 ## 1.0.2
 
-This version adds new background color properties to the action sheet appearance
-class. They can be used to set the background color of an entire sheet.
+This version adds new background color properties to the action sheet appearance class. They can be used to set the background color of an entire sheet.
 
-This version fixes a bug, where the background color behind an action sheet went
-black when the action sheet was presented in a split view.
+This version fixes a bug, where the background color behind an action sheet went black when the action sheet was presented in a split view.
 
 
 
 ## 1.0.1
 
-This version fixes a bug, where the presenters incorrectly updated the scrolling
-behavior of the action sheet when rotating the device.
+This version fixes a bug, where the presenters incorrectly updated the scrolling behavior of the action sheet when rotating the device.
 
 
 
@@ -240,28 +259,15 @@ behavior of the action sheet when rotating the device.
 
 Sheeeeeeeeet 1.0.0 is finally here, with many internal changes and some external.
 
-This version decouples action sheets from their presentation to great extent. An
-action sheet still styles its items and components, but the presenters now takes
-care of a lot more than before. The sheet setup is now also based on constraints
-instead of manual calculations, which means that popover scrolling etc. works by
-how the constraints are setup, instead of relying on manual calculations.
+This version decouples action sheets from their presentation to great extent. An action sheet still styles its items and components, but the presenters now takes care of a lot more than before. The sheet setup is now also based on constraints instead of manual calculations, which means that popover scrolling etc. works by how the constraints are setup, instead of relying on manual calculations.
 
-This should result in much more robust action sheets, but it requires testing on
-a wide range of devices and orientations, so please let me know if there are any
-issues with this approach.
+This should result in much more robust action sheets, but it requires testing on a wide range of devices and orientations, so please let me know if there are any issues with this approach.
 
-`IMPORTANT` The button item values have changed. Insted of `true` and `nil` they
-now have a strong `ButtonType` value. You can still create custom buttons with a
-custom value, though. You can also use the new `isOkButton` and `isCancelButton`
-extensions to quickly see if a user tapped "OK" or "Cancel".
+`IMPORTANT` The button item values have changed. Insted of `true` and `nil` they now have a strong `ButtonType` value. You can still create custom buttons with a custom value, though. You can also use the new `isOkButton` and `isCancelButton` extensions to quickly see if a user tapped "OK" or "Cancel".
 
 ### Breaking changes
 
-Since the presentation logic has been rewritten from scratch, you have to adjust
-your code to fit the new structure, if you have subclassed any presenter or made
-presentation tweaks in your sheets. The changes are too many and extensive to be
-listed here, so please have a look at the new structure. There is much less code,
-so changing your code to the new standard should be easy.
+Since the presentation logic has been rewritten from scratch, you have to adjust your code to fit the new structure, if you have subclassed any presenter or made presentation tweaks in your sheets. The changes are too many and extensive to be listed here, so please have a look at the new structure. There is much less code, so changing your code to the new standard should be easy.
 
 * `ActionSheetButton` and its sublasses has new values.
 * `ActionSheet.itemTapAction` has been removed
@@ -274,30 +280,25 @@ so changing your code to the new standard should be easy.
 ### New features
 
 * `ActionSheetAppearance` has new properties, which adds new way to style sheets.
-* `ActionSheetButton` adds `isOkButton` and `isCancelButton` extension functions
-to `ActionSheetItem`. They can be used to quickly check if a cancel or ok button
-was tapped, instead of having to check if the item can be cast to a button type. 
+* `ActionSheetButton` adds `isOkButton` and `isCancelButton` extension functions to `ActionSheetItem`. They can be used to quickly check if a cancel or ok button was tapped, instead of having to check if the item can be cast to a button type. 
 
 ### Bug fixes
 
-* The big presentation adjustments solves the scrolling issues that occured with
-popovers and many items.
-* The `hideSeparator()` function is adjusted to behave correctly when the device
-is rotated.
+* The big presentation adjustments solves the scrolling issues that occured with popovers and many items.
+* The `hideSeparator()` function is adjusted to behave correctly when the device is rotated.
 
 ### Deprecated logic
 
-Instead of deprecating presentation-related properties and functions that are no
-longer used or available, I removed them completely. Let me know if you used any
-properties that are no longer available.
+Instead of deprecating presentation-related properties and functions that are no longer used or available, I removed them completely. Let me know if you used any properties that are no longer available.
 
 * `ActionSheetItem.setupItemsAndButtons(with:)` is renamed to `setup(items:)`
 * `ActionSheetItem.itemSelectAction` is renamed to `selectAction`
 
-Perform the deprecation warnings, and you should be all good. Deprecated members
-will be removed in the next minor version.
+Perform the deprecation warnings, and you should be all good. Deprecated members will be removed in the next minor version.
+
 
 
+# Legacy versions
 
 ## 0.11.0
 
@@ -555,3 +556,4 @@ moving action sheets into their own separate classes.
 
 
 [Appearance]: https://github.com/danielsaidi/Sheeeeeeeeet/blob/master/Readmes/Appearance.md
+[Migration-Guide]: https://github.com/danielsaidi/Sheeeeeeeeet/blob/master/Readmes/Migration-Guide.md

BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Group.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Logo.sketch


+ 4 - 4
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet.podspec

@@ -2,7 +2,8 @@
 
 Pod::Spec.new do |s|
   s.name             = 'Sheeeeeeeeet'
-  s.version          = '2.0.2'
+  s.version          = '3.0.9'
+  s.swift_versions   = ['5.1']
   s.summary          = 'Sheeeeeeeeet is a Swift library for custom iOS action sheets.'
 
   s.description      = <<-DESC
@@ -17,8 +18,7 @@ custom types are more specific to your app or domain.
   s.source           = { :git => 'https://github.com/danielsaidi/Sheeeeeeeeet.git', :tag => s.version.to_s }
   s.social_media_url = 'https://twitter.com/danielsaidi'
 
+  s.swift_version = '5.1'
   s.ios.deployment_target = '9.0'
-
-  s.source_files = 'Sheeeeeeeeet/**/*.swift'
-  s.resources    = 'Sheeeeeeeeet/**/*.xib'
+  s.source_files = 'Sources/Sheeeeeeeeet/**/*.swift'
 end

+ 0 - 24
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Info.plist

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>$(DEVELOPMENT_LANGUAGE)</string>
-	<key>CFBundleExecutable</key>
-	<string>$(EXECUTABLE_NAME)</string>
-	<key>CFBundleIdentifier</key>
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>$(PRODUCT_NAME)</string>
-	<key>CFBundlePackageType</key>
-	<string>FMWK</string>
-	<key>CFBundleShortVersionString</key>
-	<string>2.0.2</string>
-	<key>CFBundleVersion</key>
-	<string>1</string>
-	<key>NSPrincipalClass</key>
-	<string></string>
-</dict>
-</plist>

+ 0 - 19
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Sheeeeeeeeet.h

@@ -1,19 +0,0 @@
-//
-//  Sheeeeeeeeet.h
-//  Sheeeeeeeeet
-//
-//  Created by Daniel Saidi on 2017-11-18.
-//  Copyright © 2017 Daniel Saidi. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-//! Project version number for Sheeeeeeeeet.
-FOUNDATION_EXPORT double SheeeeeeeeetVersionNumber;
-
-//! Project version string for Sheeeeeeeeet.
-FOUNDATION_EXPORT const unsigned char SheeeeeeeeetVersionString[];
-
-// In this header, you should import all the public headers of your framework using statements like #import <Sheeeeeeeeet/PublicHeader.h>
-
-

+ 1 - 1
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'TLPhotoPicker'
-  s.version          = '1.9.3'
+  s.version          = '2.0.6'
   s.summary          = 'multiple phassets picker for iOS lib. like facebook'
 
 # This description is used to generate tags and improve search results.

+ 7 - 2
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLAlbumPopView.swift

@@ -25,8 +25,10 @@ extension PopupViewProtocol where Self: UIView {
         return frame
     }
     func setupPopupFrame() {
-        if self.originalFrame != self.popupView.frame {
+        if self.originalFrame == CGRect.zero {
             self.originalFrame = self.popupView.frame
+        }else {
+            self.originalFrame.size.height = self.popupView.frame.height
         }
     }
     func show(_ show: Bool, duration: TimeInterval = 0.1) {
@@ -52,7 +54,7 @@ extension PopupViewProtocol where Self: UIView {
     }
 }
 
-open class TLAlbumPopView: UIView,PopupViewProtocol {
+open class TLAlbumPopView: UIView, PopupViewProtocol {
     @IBOutlet open var bgView: UIView!
     @IBOutlet open var popupView: UIView!
     @IBOutlet var popupViewHeight: NSLayoutConstraint!
@@ -70,6 +72,9 @@ open class TLAlbumPopView: UIView,PopupViewProtocol {
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapBgView))
         self.bgView.addGestureRecognizer(tapGesture)
         self.tableView.register(UINib(nibName: "TLCollectionTableViewCell", bundle: TLBundle.bundle()), forCellReuseIdentifier: "TLCollectionTableViewCell")
+        if #available(iOS 13.0, *) {
+            self.popupView.backgroundColor = .systemBackground
+        }
     }
     
     @objc func tapBgView() {

+ 101 - 39
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLAssetsCollection.swift

@@ -71,7 +71,7 @@ public struct TLPHAsset {
     }
     
     public func photoSize(options: PHImageRequestOptions? = nil ,completion: @escaping ((Int)->Void), livePhotoVideoSize: Bool = false) {
-        guard let phAsset = self.phAsset, self.type == .photo else { completion(-1); return }
+        guard let phAsset = self.phAsset, self.type == .photo || self.type == .livePhoto else { completion(-1); return }
         var resource: PHAssetResource? = nil
         if phAsset.mediaSubtypes.contains(.photoLive) == true, livePhotoVideoSize {
             resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .pairedVideo }.first
@@ -138,11 +138,48 @@ public struct TLPHAsset {
         return nil
     }
     
+    private func tempCopyLivePhotos(phAsset: PHAsset,
+                                    livePhotoRequestOptions: PHLivePhotoRequestOptions? = nil,
+                                    localURL: URL,
+                                    completionBlock:@escaping (() -> Void)) -> PHImageRequestID? {
+        var requestOptions = PHLivePhotoRequestOptions()
+        if let options = livePhotoRequestOptions {
+            requestOptions = options
+        }else {
+            requestOptions.isNetworkAccessAllowed = true
+        }
+        return PHImageManager.default().requestLivePhoto(for: phAsset,
+                                                         targetSize: UIScreen.main.bounds.size,
+                                                         contentMode: .default,
+                                                         options: requestOptions)
+        { (livePhotos, infoDict) in
+            if let livePhotos = livePhotos {
+                let assetResources = PHAssetResource.assetResources(for: livePhotos)
+                var videoResources: PHAssetResource?
+                assetResources.forEach { (resource) in
+                    if resource.type == .pairedVideo {
+                        PHAssetResourceManager.default().writeData(for: resource, toFile: localURL, options: nil) { (error) in
+                            DispatchQueue.main.async {
+                                completionBlock()
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    
     @discardableResult
     //convertLivePhotosToJPG
     // false : If you want mov file at live photos
     // true  : If you want png file at live photos ( HEIC )
-    public func tempCopyMediaFile(videoRequestOptions: PHVideoRequestOptions? = nil, imageRequestOptions: PHImageRequestOptions? = nil, exportPreset: String = AVAssetExportPresetHighestQuality, convertLivePhotosToJPG: Bool = false, progressBlock:((Double) -> Void)? = nil, completionBlock:@escaping ((URL,String) -> Void)) -> PHImageRequestID? {
+    public func tempCopyMediaFile(videoRequestOptions: PHVideoRequestOptions? = nil,
+                                  imageRequestOptions: PHImageRequestOptions? = nil,
+                                  livePhotoRequestOptions: PHLivePhotoRequestOptions? = nil,
+                                  exportPreset: String = AVAssetExportPresetHighestQuality,
+                                  convertLivePhotosToJPG: Bool = false,
+                                  progressBlock:((Double) -> Void)? = nil,
+                                  completionBlock:@escaping ((URL,String) -> Void)) -> PHImageRequestID? {
         guard let phAsset = self.phAsset else { return nil }
         var type: PHAssetResourceType? = nil
         if phAsset.mediaSubtypes.contains(.photoLive) == true, convertLivePhotosToJPG == false {
@@ -165,6 +202,12 @@ public struct TLPHAsset {
             }
         }
         guard let localURL = writeURL,let mimetype = MIMEType(writeURL) else { return nil }
+        if type == .pairedVideo {
+            return tempCopyLivePhotos(phAsset: phAsset,
+                                      livePhotoRequestOptions: livePhotoRequestOptions,
+                                      localURL: localURL,
+                                      completionBlock: { completionBlock(localURL, mimetype) })
+        }
         switch phAsset.mediaType {
         case .video:
             var requestOptions = PHVideoRequestOptions()
@@ -179,7 +222,10 @@ public struct TLPHAsset {
                     progressBlock?(progress)
                 }
             }
-            return PHImageManager.default().requestExportSession(forVideo: phAsset, options: requestOptions, exportPreset: exportPreset) { (session, infoDict) in
+            return PHImageManager.default().requestExportSession(forVideo: phAsset,
+                                                                 options: requestOptions,
+                                                                 exportPreset: exportPreset)
+            { (session, infoDict) in
                 session?.outputURL = localURL
                 session?.outputFileType = AVFileType.mov
                 session?.exportAsynchronously(completionHandler: {
@@ -201,7 +247,9 @@ public struct TLPHAsset {
                     progressBlock?(progress)
                 }
             }
-            return PHImageManager.default().requestImageData(for: phAsset, options: requestOptions, resultHandler: { (data, uti, orientation, info) in
+            return PHImageManager.default().requestImageData(for: phAsset,
+                                                             options: requestOptions)
+            { (data, uti, orientation, info) in
                 do {
                     var data = data
                     let needConvertLivePhotoToJPG = phAsset.mediaSubtypes.contains(.photoLive) == true && convertLivePhotosToJPG == true
@@ -213,61 +261,63 @@ public struct TLPHAsset {
                         completionBlock(localURL, mimetype)
                     }
                 }catch { }
-            })
+            }
         default:
             return nil
         }
     }
     
-    //Apparently, this method is not be safety to export a video.
-    //There is many way that export a video.
-    //This method was one of them.
-    public func exportVideoFile(options: PHVideoRequestOptions? = nil, progressBlock:((Float) -> Void)? = nil, completionBlock:@escaping ((URL,String) -> Void)) {
-        guard let phAsset = self.phAsset, phAsset.mediaType == .video else { return }
-        var type = PHAssetResourceType.video
-        guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == type }).first else { return }
+    private func videoFilename(phAsset: PHAsset) -> URL? {
+        guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == .video }).first else {
+            return nil
+        }
+        var writeURL: URL?
         let fileName = resource.originalFilename
-        var writeURL: URL? = nil
         if #available(iOS 10.0, *) {
             writeURL = FileManager.default.temporaryDirectory.appendingPathComponent("\(fileName)")
         } else {
             writeURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("\(fileName)")
         }
-        guard let localURL = writeURL,let mimetype = MIMEType(writeURL) else { return }
+        return writeURL
+    }
+    
+    //Apparently, This is not the only way to export video.
+    //There is many way that export a video.
+    //This method was one of them.
+    public func exportVideoFile(options: PHVideoRequestOptions? = nil,
+                                outputURL: URL? = nil,
+                                outputFileType: AVFileType = .mov,
+                                progressBlock:((Double) -> Void)? = nil,
+                                completionBlock:@escaping ((URL,String) -> Void)) {
+        guard
+            let phAsset = self.phAsset,
+            phAsset.mediaType == .video,
+            let writeURL = outputURL ?? videoFilename(phAsset: phAsset),
+            let mimetype = MIMEType(writeURL)
+            else {
+                return
+        }
         var requestOptions = PHVideoRequestOptions()
         if let options = options {
             requestOptions = options
         }else {
             requestOptions.isNetworkAccessAllowed = true
         }
-        //iCloud download progress
-        //options.progressHandler = { (progress, error, stop, info) in
-            
-        //}
-        PHImageManager.default().requestAVAsset(forVideo: phAsset, options: options) { (avasset, avaudioMix, infoDict) in
-            guard let avasset = avasset else { return }
+        requestOptions.progressHandler = { (progress, error, stop, info) in
+            DispatchQueue.main.async {
+                progressBlock?(progress)
+            }
+        }
+        PHImageManager.default().requestAVAsset(forVideo: phAsset, options: requestOptions) { (avasset, avaudioMix, infoDict) in
+            guard let avasset = avasset else {
+                return
+            }
             let exportSession = AVAssetExportSession.init(asset: avasset, presetName: AVAssetExportPresetHighestQuality)
-            exportSession?.outputURL = localURL
-            exportSession?.outputFileType = AVFileType.mov
+            exportSession?.outputURL = writeURL
+            exportSession?.outputFileType = outputFileType
             exportSession?.exportAsynchronously(completionHandler: {
-                completionBlock(localURL,mimetype)
+                completionBlock(writeURL, mimetype)
             })
-            func checkExportSession() {
-                DispatchQueue.global().async { [weak exportSession] in
-                    guard let exportSession = exportSession else { return }
-                    switch exportSession.status {
-                    case .waiting,.exporting:
-                        DispatchQueue.main.async {
-                            progressBlock?(exportSession.progress)
-                        }
-                        Thread.sleep(forTimeInterval: 1)
-                        checkExportSession()
-                    default:
-                        break
-                    }
-                }
-            }
-            checkExportSession()
         }
     }
     
@@ -339,6 +389,18 @@ public struct TLAssetsCollection {
         }
     }
     
+    func findIndex(phAsset: PHAsset) -> IndexPath? {
+        guard let sections = self.sections else {
+            return nil
+        }
+        for (offset, section) in sections.enumerated() {
+            if let index = section.assets.firstIndex(where: { $0.phAsset == phAsset }) {
+                return IndexPath(row: index, section: offset)
+            }
+        }
+        return nil
+    }
+    
     mutating func reloadSection(groupedBy: PHFetchedResultGroupedBy) {
         var groupedSections = self.section(groupedBy: groupedBy)
         if self.useCameraButton {

+ 3 - 0
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLCollectionTableViewCell.swift

@@ -18,5 +18,8 @@ open class TLCollectionTableViewCell: UITableViewCell {
         if #available(iOS 11.0, *) {
             self.thumbImageView.accessibilityIgnoresInvertColors = true
         }
+        if #available(iOS 13.0, *) {
+            self.contentView.backgroundColor = .systemBackground
+        }
     }
 }

+ 16 - 14
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLCollectionTableViewCell.xib

@@ -1,12 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
-        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -16,24 +13,27 @@
             <rect key="frame" x="0.0" y="0.0" width="375" height="75"/>
             <autoresizingMask key="autoresizingMask"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9FY-S1-KKQ" id="UUZ-nI-xH1">
-                <rect key="frame" x="0.0" y="0.0" width="375" height="74.5"/>
+                <rect key="frame" x="0.0" y="0.0" width="375" height="75"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4Dk-kD-sMy">
-                        <rect key="frame" x="5" y="12.5" width="50" height="50"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4Dk-kD-sMy">
+                        <rect key="frame" x="15" y="12.5" width="50" height="50"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="50" id="yiu-ZU-58w"/>
+                            <constraint firstAttribute="width" constant="50" id="zAc-Fo-aGe"/>
+                        </constraints>
                     </imageView>
                     <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="7nv-2U-xMp">
-                        <rect key="frame" x="69" y="19" width="248" height="36.5"/>
+                        <rect key="frame" x="75" y="19.5" width="235" height="36.5"/>
                         <subviews>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Camera Roll" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ES8-Tq-6Wz">
-                                <rect key="frame" x="0.0" y="0.0" width="248" height="17"/>
+                                <rect key="frame" x="0.0" y="0.0" width="235" height="17"/>
                                 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="9999" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NuJ-3w-ZAP">
-                                <rect key="frame" x="0.0" y="22" width="248" height="14.5"/>
+                                <rect key="frame" x="0.0" y="22" width="235" height="14.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                 <color key="textColor" red="0.43137254901960786" green="0.43137254901960786" blue="0.43137254901960786" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
@@ -42,9 +42,11 @@
                     </stackView>
                 </subviews>
                 <constraints>
+                    <constraint firstItem="4Dk-kD-sMy" firstAttribute="leading" secondItem="UUZ-nI-xH1" secondAttribute="leading" constant="15" id="7W9-hT-caE"/>
                     <constraint firstItem="7nv-2U-xMp" firstAttribute="centerY" secondItem="UUZ-nI-xH1" secondAttribute="centerY" id="E6U-ch-GDV"/>
-                    <constraint firstItem="7nv-2U-xMp" firstAttribute="leading" secondItem="UUZ-nI-xH1" secondAttribute="leadingMargin" constant="61" id="Jsu-Hd-Sg3"/>
                     <constraint firstAttribute="trailingMargin" secondItem="7nv-2U-xMp" secondAttribute="trailing" constant="50" id="T3U-hj-718"/>
+                    <constraint firstItem="4Dk-kD-sMy" firstAttribute="centerY" secondItem="UUZ-nI-xH1" secondAttribute="centerY" id="ZHB-JZ-YKE"/>
+                    <constraint firstItem="7nv-2U-xMp" firstAttribute="leading" secondItem="4Dk-kD-sMy" secondAttribute="trailing" constant="10" id="i0n-S1-xnn"/>
                 </constraints>
             </tableViewCellContentView>
             <connections>

+ 1 - 2
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift

@@ -139,6 +139,7 @@ open class TLPhotoCollectionViewCell: UICollectionViewCell {
             player.pause()
             self.player = nil
         }
+        self.livePhotoView?.livePhoto = nil
         self.livePhotoView?.isHidden = true
         self.livePhotoView?.stopPlayback()
         self.livePhotoView?.delegate = nil
@@ -169,8 +170,6 @@ open class TLPhotoCollectionViewCell: UICollectionViewCell {
     override open func prepareForReuse() {
         super.prepareForReuse()
         stopPlay()
-        self.livePhotoView?.isHidden = true
-        self.livePhotoView?.delegate = nil
         self.durationView?.isHidden = true
         self.durationView?.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6)
         self.selectedHeight?.constant = 10

+ 42 - 10
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotoLibrary.swift

@@ -21,6 +21,8 @@ class TLPhotoLibrary {
     lazy var imageManager: PHCachingImageManager = {
         return PHCachingImageManager()
     }()
+    internal var assetCollections: [PHFetchResult<PHAssetCollection>] = []
+    internal var albums: PHFetchResult<PHCollection>? = nil
     
     deinit {
         //        print("deinit TLPhotoLibrary")
@@ -131,9 +133,13 @@ extension PHFetchOptions {
 //MARK: - Load Collection
 extension TLPhotoLibrary {
     func getOption(configure: TLPhotosPickerConfigure) -> PHFetchOptions {
-        
-        let options = configure.fetchOption ?? PHFetchOptions()
-        options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
+        let options: PHFetchOptions
+        if let fetchOption = configure.fetchOption {
+            options = fetchOption
+        }else {
+            options = PHFetchOptions()
+            options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
+        }
         if let mediaType = configure.mediaType {
             let mediaPredicate = NSPredicate(format: "mediaType = %i", mediaType.rawValue)
             options.merge(predicate: mediaPredicate)
@@ -160,11 +166,18 @@ extension TLPhotoLibrary {
     }
     
     func fetchCollection(configure: TLPhotosPickerConfigure) {
+        self.albums = nil
+        self.assetCollections = []
         let useCameraButton = configure.usedCameraButton
         let options = getOption(configure: configure)
+        let fetchCollectionOption = configure.fetchCollectionOption
         
         func getAlbum(subType: PHAssetCollectionSubtype, result: inout [TLAssetsCollection]) {
-            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .album, subtype: subType, options: nil)
+            let collectionOption = fetchCollectionOption[.assetCollections(.album)]
+            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .album,
+                                                                          subtype: subType,
+                                                                          options: collectionOption)
+            self.assetCollections.append(fetchCollection)
             var collections = [PHAssetCollection]()
             fetchCollection.enumerateObjects { (collection, index, _) in 
                 if configure.allowedAlbumCloudShared == false && collection.assetCollectionSubtype == .albumCloudShared {
@@ -175,6 +188,7 @@ extension TLPhotoLibrary {
             for collection in collections {
                 if !result.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
                     var assetsCollection = TLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
                     assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
                     if assetsCollection.count > 0 {
                         result.append(assetsCollection)
@@ -184,10 +198,22 @@ extension TLPhotoLibrary {
         }
         
         @discardableResult
-        func getSmartAlbum(subType: PHAssetCollectionSubtype, useCameraButton: Bool = false, result: inout [TLAssetsCollection]) -> TLAssetsCollection? {
-            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: subType, options: nil)
-            if let collection = fetchCollection.firstObject, !result.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
+        func getSmartAlbum(subType: PHAssetCollectionSubtype,
+                           useCameraButton: Bool = false,
+                           result: inout [TLAssetsCollection])
+            -> TLAssetsCollection?
+        {
+            let collectionOption = fetchCollectionOption[.assetCollections(.smartAlbum)]
+            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .smartAlbum,
+                                                                          subtype: subType,
+                                                                          options: collectionOption)
+            self.assetCollections.append(fetchCollection)
+            if
+                let collection = fetchCollection.firstObject,
+                result.contains(where: { $0.localIdentifier == collection.localIdentifier }) == false
+            {
                 var assetsCollection = TLAssetsCollection(collection: collection)
+                assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
                 assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
                 if assetsCollection.count > 0 || useCameraButton {
                     result.append(assetsCollection)
@@ -196,7 +222,7 @@ extension TLPhotoLibrary {
             }
             return nil
         }
-        if let fetchCollectionTypes: [(PHAssetCollectionType,PHAssetCollectionSubtype)] = configure.fetchCollectionTypes {
+        if let fetchCollectionTypes = configure.fetchCollectionTypes {
             DispatchQueue.global(qos: .userInteractive).async { [weak self] in
                 var assetCollections = [TLAssetsCollection]()
                 for (type,subType) in fetchCollectionTypes {
@@ -214,8 +240,11 @@ extension TLPhotoLibrary {
             DispatchQueue.global(qos: .userInteractive).async { [weak self] in
                 var assetCollections = [TLAssetsCollection]()
                 //Camera Roll
-                let camerarollCollection = getSmartAlbum(subType: .smartAlbumUserLibrary, useCameraButton: useCameraButton, result: &assetCollections)
+                let camerarollCollection = getSmartAlbum(subType: .smartAlbumUserLibrary,
+                                                         useCameraButton: useCameraButton,
+                                                         result: &assetCollections)
                 if var cameraRoll = camerarollCollection {
+                    cameraRoll.title = configure.customLocalizedTitle[cameraRoll.title] ?? cameraRoll.title
                     cameraRoll.useCameraButton = useCameraButton
                     assetCollections[0] = cameraRoll
                     DispatchQueue.main.async {
@@ -237,10 +266,13 @@ extension TLPhotoLibrary {
                     getSmartAlbum(subType: .smartAlbumVideos, result: &assetCollections)
                 }
                 //Album
-                let albumsResult = PHCollectionList.fetchTopLevelUserCollections(with: nil)
+                let collectionOption = fetchCollectionOption[.topLevelUserCollections]
+                let albumsResult = PHCollectionList.fetchTopLevelUserCollections(with: collectionOption)
+                self?.albums = albumsResult
                 albumsResult.enumerateObjects({ (collection, index, stop) -> Void in
                     guard let collection = collection as? PHAssetCollection else { return }
                     var assetsCollection = TLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
                     assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
                     if assetsCollection.count > 0, !assetCollections.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
                         assetCollections.append(assetsCollection)

+ 131 - 13
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift

@@ -49,9 +49,8 @@ extension TLPhotosPickerLogDelegate {
     func selectedAlbum(picker: TLPhotosPickerViewController, collections: [TLAssetsCollection], at: Int) { }
 }
 
-
 public struct TLPhotosPickerConfigure {
-    public var defaultCameraRollTitle = "Camera Roll"
+    public var customLocalizedTitle: [String: String] = ["Camera Roll": "Camera Roll"]
     public var tapHereToChange = "Tap here to change"
     public var cancelTitle = "Cancel"
     public var doneTitle = "Done"
@@ -72,6 +71,7 @@ public struct TLPhotosPickerConfigure {
     public var singleSelectedMode = false
     public var maxSelectedAssets: Int? = nil
     public var fetchOption: PHFetchOptions? = nil
+    public var fetchCollectionOption: [FetchCollectionType: PHFetchOptions] = [:]
     public var selectedColor = UIColor(red: 88/255, green: 144/255, blue: 255/255, alpha: 1.0)
     public var cameraBgColor = UIColor(red: 221/255, green: 223/255, blue: 226/255, alpha: 1)
     public var cameraIcon = TLBundle.podBundleImage(named: "camera")
@@ -82,18 +82,40 @@ public struct TLPhotosPickerConfigure {
     public var fetchCollectionTypes: [(PHAssetCollectionType,PHAssetCollectionSubtype)]? = nil
     public var groupByFetch: PHFetchedResultGroupedBy? = nil
     public var supportedInterfaceOrientations: UIInterfaceOrientationMask = .portrait
+    public var popup: [PopupConfigure] = []
     public init() {
         
     }
 }
 
+public enum FetchCollectionType {
+    case assetCollections(PHAssetCollectionType)
+    case topLevelUserCollections
+}
 
-public struct Platform {
+extension FetchCollectionType: Hashable {
+    private var identifier: String {
+        switch self {
+        case let .assetCollections(collectionType):
+            return "assetCollections\(collectionType.rawValue)"
+        case .topLevelUserCollections:
+            return "topLevelUserCollections"
+        }
+    }
     
+    public func hash(into hasher: inout Hasher) {
+        hasher.combine(self.identifier)
+    }
+}
+
+public enum PopupConfigure {
+    case animation(TimeInterval)
+}
+
+public struct Platform {
     public static var isSimulator: Bool {
         return TARGET_OS_SIMULATOR != 0 // Use this line in Xcode 7 or newer
     }
-    
 }
 
 
@@ -118,7 +140,7 @@ open class TLPhotosPickerViewController: UIViewController {
     
     public weak var delegate: TLPhotosPickerViewControllerDelegate? = nil
     public weak var logDelegate: TLPhotosPickerLogDelegate? = nil
-    public var selectedAssets = [TLPHAsset]()
+    open var selectedAssets = [TLPHAsset]()
     public var configure = TLPhotosPickerConfigure()
     public var customDataSouces: TLPhotopickerDataSourcesProtocol? = nil
     
@@ -197,6 +219,23 @@ open class TLPhotosPickerViewController: UIViewController {
         return self.configure.supportedInterfaceOrientations
     }
     
+    open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        super.traitCollectionDidChange(previousTraitCollection)
+        if #available(iOS 13.0, *) {
+            let userInterfaceStyle = self.traitCollection.userInterfaceStyle
+            let image = TLBundle.podBundleImage(named: "pop_arrow")
+            if userInterfaceStyle.rawValue == 2 {
+                self.popArrowImageView.image = image?.colorMask(color: .systemBackground)
+                self.view.backgroundColor = .black
+                self.collectionView.backgroundColor = .black
+            }else {
+                self.popArrowImageView.image = image?.colorMask(color: .white)
+                self.view.backgroundColor = .white
+                self.collectionView.backgroundColor = .white
+            }
+        }
+    }
+    
     override open func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
         self.stopPlay()
@@ -248,6 +287,13 @@ open class TLPhotosPickerViewController: UIViewController {
     }
     
     private func findIndexAndReloadCells(phAsset: PHAsset) {
+        if
+            self.configure.groupByFetch != nil,
+            let indexPath = self.focusedCollection?.findIndex(phAsset: phAsset)
+        {
+            self.collectionView.reloadItems(at: [indexPath])
+            return
+        }
         if
             var index = self.focusedCollection?.fetchResult?.index(of: phAsset),
             index != NSNotFound
@@ -320,7 +366,7 @@ extension TLPhotosPickerViewController {
         self.indicator.startAnimating()
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(titleTap))
         self.titleView.addGestureRecognizer(tapGesture)
-        self.titleLabel.text = self.configure.defaultCameraRollTitle
+        self.titleLabel.text = self.configure.customLocalizedTitle["Camera Roll"]
         self.subTitleLabel.text = self.configure.tapHereToChange
         self.cancelButton.title = self.configure.cancelTitle
         self.doneButton.title = self.configure.doneTitle
@@ -415,7 +461,7 @@ extension TLPhotosPickerViewController {
         self.focusedCollection?.fetchResult = self.photoLibrary.fetchResult(collection: collection, configure: self.configure)
         reloadIndexPaths.append(IndexPath(row: getfocusedIndex(), section: 0))
         self.albumPopView.tableView.reloadRows(at: reloadIndexPaths, with: .none)
-        self.albumPopView.show(false, duration: 0.2)
+        self.albumPopView.show(false, duration: self.configure.popup.duration)
         self.updateTitle()
         self.reloadCollectionView()
         self.collectionView.contentOffset = collection.recentPosition
@@ -431,7 +477,7 @@ extension TLPhotosPickerViewController {
     // User Action
     @objc func titleTap() {
         guard collections.count > 0 else { return }
-        self.albumPopView.show(self.albumPopView.isHidden)
+        self.albumPopView.show(self.albumPopView.isHidden, duration: self.configure.popup.duration)
     }
     
     @IBAction open func cancelButtonTap() {
@@ -692,14 +738,57 @@ extension TLPhotosPickerViewController: PHLivePhotoViewDelegate {
 
 // MARK: - PHPhotoLibraryChangeObserver
 extension TLPhotosPickerViewController: PHPhotoLibraryChangeObserver {
+    private func getChanges(_ changeInstance: PHChange) -> PHFetchResultChangeDetails<PHAsset>? {
+        func isChangesCount<T>(changeDetails: PHFetchResultChangeDetails<T>?) -> Bool {
+            guard let changeDetails = changeDetails else {
+                return false
+            }
+            let before = changeDetails.fetchResultBeforeChanges.count
+            let after = changeDetails.fetchResultAfterChanges.count
+            return before != after
+        }
+        
+        func isAlbumsChanges() -> Bool {
+            guard let albums = self.photoLibrary.albums else {
+                return false
+            }
+            let changeDetails = changeInstance.changeDetails(for: albums)
+            return isChangesCount(changeDetails: changeDetails)
+        }
+        
+        func isCollectionsChanges() -> Bool {
+            for fetchResultCollection in self.photoLibrary.assetCollections {
+                let changeDetails = changeInstance.changeDetails(for: fetchResultCollection)
+                if isChangesCount(changeDetails: changeDetails) == true {
+                    return true
+                }
+            }
+            return false
+        }
+        
+        if isAlbumsChanges() || isCollectionsChanges() {
+            DispatchQueue.main.async {
+                self.albumPopView.show(false, duration: self.configure.popup.duration)
+                self.photoLibrary.fetchCollection(configure: self.configure)
+            }
+            return nil
+        }else {
+            guard let changeFetchResult = self.focusedCollection?.fetchResult else { return nil }
+            guard let changes = changeInstance.changeDetails(for: changeFetchResult) else { return nil }
+            return changes
+        }
+    }
+    
     public func photoLibraryDidChange(_ changeInstance: PHChange) {
-        guard getfocusedIndex() == 0 else {
-            return
+        var addIndex = 0
+        if getfocusedIndex() == 0 {
+            addIndex = self.usedCameraButton ? 1 : 0
         }
-        let addIndex = self.usedCameraButton ? 1 : 0
         DispatchQueue.main.async {
-            guard let changeFetchResult = self.focusedCollection?.fetchResult else { return }
-            guard let changes = changeInstance.changeDetails(for: changeFetchResult) else { return }
+            guard let changes = self.getChanges(changeInstance) else {
+                return
+            }
+            
             if changes.hasIncrementalChanges, self.configure.groupByFetch == nil {
                 var deletedSelectedAssets = false
                 var order = 0
@@ -1084,3 +1173,32 @@ extension TLPhotosPickerViewController: UITableViewDelegate,UITableViewDataSourc
         return cell
     }
 }
+
+extension Array where Element == PopupConfigure {
+    var duration: TimeInterval {
+        var result: TimeInterval = 0.1
+        self.compactMap{ $0 as? PopupConfigure }.forEach{
+            if case let .animation(duration) = $0 {
+                result = duration
+            }
+        }
+        return result
+    }
+}
+
+extension UIImage {
+    public func colorMask(color:UIColor) -> UIImage {
+        var result: UIImage?
+        let rect = CGRect(x:0, y:0, width:size.width, height:size.height)
+        UIGraphicsBeginImageContextWithOptions(rect.size, false, scale)
+        if let c = UIGraphicsGetCurrentContext() {
+            self.draw(in: rect)
+            c.setFillColor(color.cgColor)
+            c.setBlendMode(.sourceAtop)
+            c.fill(rect)
+            result = UIGraphicsGetImageFromCurrentImageContext()
+        }
+        UIGraphicsEndImageContext()
+        return result ?? self
+    }
+}

+ 13 - 15
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotosPickerViewController.xib

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -38,7 +36,7 @@
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <navigationBar contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X8O-Gg-slz">
-                    <rect key="frame" x="0.0" y="20" width="375" height="44"/>
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
                     <items>
                         <navigationItem id="5CU-MZ-p1K">
                             <nil key="title"/>
@@ -98,7 +96,7 @@
                     </items>
                 </navigationBar>
                 <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="4gR-Bn-quP">
-                    <rect key="frame" x="0.0" y="64" width="375" height="603"/>
+                    <rect key="frame" x="0.0" y="44" width="375" height="623"/>
                     <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                     <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="5" minimumInteritemSpacing="5" id="VDa-Pp-VBq">
                         <size key="itemSize" width="50" height="50"/>
@@ -112,10 +110,10 @@
                     </connections>
                 </collectionView>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HPm-Vc-F86">
-                    <rect key="frame" x="0.0" y="64" width="375" height="603"/>
+                    <rect key="frame" x="0.0" y="44" width="375" height="623"/>
                     <subviews>
                         <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="gi6-Sw-3Zf">
-                            <rect key="frame" x="137.5" y="239" width="100" height="125.5"/>
+                            <rect key="frame" x="137.5" y="249" width="100" height="125.5"/>
                             <subviews>
                                 <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="YDZ-o1-AXT">
                                     <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
@@ -140,20 +138,20 @@
                     </constraints>
                 </view>
                 <activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="AEv-G6-dRI">
-                    <rect key="frame" x="177" y="323" width="20" height="20"/>
+                    <rect key="frame" x="177.5" y="323.5" width="20" height="20"/>
                 </activityIndicatorView>
                 <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jcn-hC-Umh" customClass="TLAlbumPopView" customModule="TLPhotoPicker" customModuleProvider="target">
-                    <rect key="frame" x="0.0" y="64" width="375" height="603"/>
+                    <rect key="frame" x="0.0" y="44" width="375" height="623"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GKD-We-AdT">
-                            <rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
                             <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.29999999999999999" colorSpace="calibratedRGB"/>
                         </view>
                         <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eL2-gJ-b87">
                             <rect key="frame" x="1" y="17" width="373" height="130"/>
                             <subviews>
                                 <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="75" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="grw-Nk-Sxr">
-                                    <rect key="frame" x="10" y="0.0" width="363" height="130"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="373" height="130"/>
                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                 </tableView>
                             </subviews>
@@ -162,12 +160,12 @@
                                 <constraint firstItem="grw-Nk-Sxr" firstAttribute="top" secondItem="eL2-gJ-b87" secondAttribute="top" id="DAx-an-6Qt"/>
                                 <constraint firstAttribute="height" constant="130" id="cet-yf-3jU"/>
                                 <constraint firstAttribute="trailing" secondItem="grw-Nk-Sxr" secondAttribute="trailing" id="nM5-IG-MPJ"/>
-                                <constraint firstItem="grw-Nk-Sxr" firstAttribute="leading" secondItem="eL2-gJ-b87" secondAttribute="leading" constant="10" id="o4b-cS-L3T"/>
+                                <constraint firstItem="grw-Nk-Sxr" firstAttribute="leading" secondItem="eL2-gJ-b87" secondAttribute="leading" id="o4b-cS-L3T"/>
                                 <constraint firstAttribute="bottom" secondItem="grw-Nk-Sxr" secondAttribute="bottom" id="sPK-1G-qLo"/>
                             </constraints>
                         </view>
                         <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="5zn-je-qLx">
-                            <rect key="frame" x="180" y="10" width="14" height="7"/>
+                            <rect key="frame" x="180.5" y="10" width="14" height="7"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="7" id="eZN-nB-EHu"/>
                                 <constraint firstAttribute="width" constant="14" id="hWo-ji-iBX"/>

+ 453 - 192
Carthage/Checkouts/realm-cocoa/.jenkins.yml

@@ -1,308 +1,569 @@
+
 # Yaml Axis Plugin
 # https://wiki.jenkins-ci.org/display/JENKINS/Yaml+Axis+Plugin
+# This is a generated file produced by scripts/pr-ci-matrix.rb.
 
-xcode_version:
-  - 9.4
-  - 10.0
-  - 10.1
-  - 10.2.1
-  - 10.3
-target:
-  - osx
-  - docs
-  - ios-static
-  - ios-dynamic
-  - ios-swift
-  - osx-swift
-  - watchos
-  - cocoapods-ios
-  - cocoapods-osx
-  - cocoapods-watchos
-  - swiftlint
-  - tvos
-  - osx-encryption
-  - osx-object-server
-  - swiftpm
-
-  # These are disabled because the machinen with the devices attached is currently offline
-  # - ios-device-objc-ios8
-  # - ios-device-objc-ios10
-  # - tvos-device
-  # These are disabled because they were very unreliable on CI
-  # - ios-device-swift-ios8
-  # - ios-device-swift-ios10
-configuration:
-  - Debug
-  - Release
-
-# Combinations have to be excluded in a way that's hard to read.
-# This table shows which jobs will run:
-
-# +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-# | Configuration Matrix | osx | docs | ios-static | ios-dynamic | ios-swift | osx-swift | watchos | cocoapods-ios | cocoapods-osx | cocoapods-watchos | swiftlint | swiftpm | tvos | osx-encryption | osx-object-server | ios-device-objc-ios8 | ios-device-swift-ios8 | ios-device-objc-ios10 | ios-device-swift-ios10 | tvos-device |
-# | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | ------------- | ------------- | ----------------- | --------- | ------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
-# | 9.4   | Debug        | X   |      | X          |             |           |           |         |               |               |                   |           |         |      |                |                   |                      |                       |                       |                        |             |
-# | 9.4   | Release      | X   |      | X          | X           | X         | X         | X       | X             | X             | X                 |           |         | X    | X              | X                 | X                    |                       | X                     |                        |             |
-# | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | ------------- | ------------- | ----------------- | --------- | ------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
-# | 10.0  | Debug        | X   |      |            |             |           |           |         |               |               |                   |           |         |      |                |                   |                      |                       |                       |                        |             |
-# | 10.0  | Release      | X   |      | X          | X           | X         | X         | X       | X             | X             | X                 |           |         | X    |                |                   |                      |                       |                       |                        |             |
-# | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | ------------- | ------------- | ----------------- | --------- | ------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
-# | 10.1  | Debug        | X   |      |            |             |           |           |         |               |               |                   |           |         |      |                |                   |                      |                       |                       |                        |             |
-# | 10.1  | Release      | X   |      | X          | X           | X         | X         | X       | X             | X             | X                 |           |         | X    |                |                   |                      |                       |                       |                        |             |
-# | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | ------------- | ------------- | ----------------- | --------- | ------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
-# | 10.2.1| Debug        | X   |      |            |             |           |           |         |               |               |                   |           |         |      |                |                   |                      |                       |                       |                        |             |
-# | 10.2.1| Release      | X   |      | X          | X           | X         | X         | X       | X             | X             | X                 |           |         | X    |                |                   |                      |                       |                       |                        |             |
-# | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | ------------- | ------------- | ----------------- | --------- | ------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
-# | 10.3  | Debug        | X   |      |            | X           | X         | X         | X       |               |               |                   |           |         | X    |                |                   |                      |                       |                       |                        |             |
-# | 10.3  | Release      | X   | X    | X          | X           | X         | X         | X       | X             | X             | X                 | X         | X       | X    | X              | X                 |                      |                       | X                     |                        | X           |
-# +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+xcode_version: 
+ - 10.0
+ - 10.1
+ - 10.2.1
+ - 10.3
+ - 11.1
+ - 11.2
+target: 
+ - docs
+ - swiftlint
+ - osx
+ - osx-encryption
+ - osx-object-server
+ - ios-static
+ - ios-dynamic
+ - watchos
+ - tvos
+ - ios-swift
+ - osx-swift
+ - tvos-swift
+ - cocoapods-osx
+ - cocoapods-ios
+ - cocoapods-ios-dynamic
+ - cocoapods-watchos
+ - swiftpm
+ - swiftpm-address
+ - swiftpm-thread
+configuration: 
+ - Debug
+ - Release
 
 exclude:
-  ################
-  # docs
-  ################
-  # Just run on 10.4 Release
-  - xcode_version: 9.4
+
+  - xcode_version: 10.0
     target: docs
+    configuration: Debug
+
   - xcode_version: 10.0
     target: docs
+    configuration: Release
+
   - xcode_version: 10.1
     target: docs
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: docs
+    configuration: Release
+
   - xcode_version: 10.2.1
     target: docs
-  - target: docs
     configuration: Debug
 
-  ################
-  # ios-static
-  ################
-  # Skip Debug on everything but 9.4
+  - xcode_version: 10.2.1
+    target: docs
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: docs
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: docs
+    configuration: Release
+
+  - xcode_version: 11.1
+    target: docs
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: docs
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: docs
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: swiftlint
+    configuration: Release
+
+  - xcode_version: 10.1
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: swiftlint
+    configuration: Release
+
+  - xcode_version: 10.2.1
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: swiftlint
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: swiftlint
+    configuration: Release
+
+  - xcode_version: 11.1
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: swiftlint
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: osx-encryption
+    configuration: Release
+
+  - xcode_version: 10.2.1
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: osx-encryption
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: osx-encryption
+    configuration: Release
+
+  - xcode_version: 11.1
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: osx-encryption
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: osx-object-server
+    configuration: Release
+
+  - xcode_version: 10.2.1
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: osx-object-server
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: osx-object-server
+    configuration: Release
+
+  - xcode_version: 11.1
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: osx-object-server
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: osx-object-server
+    configuration: Debug
+
   - xcode_version: 10.0
     target: ios-static
     configuration: Debug
+
   - xcode_version: 10.1
     target: ios-static
     configuration: Debug
+
   - xcode_version: 10.2.1
     target: ios-static
     configuration: Debug
+
   - xcode_version: 10.3
     target: ios-static
     configuration: Debug
 
-  ################
-  # ios-dynamic
-  ################
-  # Skip Debug on everything but 10.3
-  - xcode_version: 9.4
-    target: ios-dynamic
+  - xcode_version: 11.1
+    target: ios-static
     configuration: Debug
+
   - xcode_version: 10.0
     target: ios-dynamic
     configuration: Debug
+
   - xcode_version: 10.1
     target: ios-dynamic
     configuration: Debug
+
   - xcode_version: 10.2.1
     target: ios-dynamic
     configuration: Debug
 
-  ################
-  # ios-swift
-  ################
-  # Skip Debug on everything but 10.3
-  - xcode_version: 9.4
-    target: ios-swift
+  - xcode_version: 10.3
+    target: ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: tvos
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: tvos
     configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: tvos
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: tvos
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: tvos
+    configuration: Debug
+
   - xcode_version: 10.0
     target: ios-swift
     configuration: Debug
+
   - xcode_version: 10.1
     target: ios-swift
     configuration: Debug
+
   - xcode_version: 10.2.1
     target: ios-swift
     configuration: Debug
 
-  ################
-  # osx-swift
-  ################
-  # Skip Debug on everything but 10.3
-  - xcode_version: 9.4
-    target: osx-swift
+  - xcode_version: 10.3
+    target: ios-swift
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: ios-swift
     configuration: Debug
+
   - xcode_version: 10.0
     target: osx-swift
     configuration: Debug
+
   - xcode_version: 10.1
     target: osx-swift
     configuration: Debug
+
   - xcode_version: 10.2.1
     target: osx-swift
     configuration: Debug
 
-  ################
-  # watchos
-  ################
-  # Skip Debug on everything but 10.3
-  - xcode_version: 9.4
-    target: watchos
+  - xcode_version: 10.3
+    target: osx-swift
     configuration: Debug
+
+  - xcode_version: 11.1
+    target: osx-swift
+    configuration: Debug
+
   - xcode_version: 10.0
-    target: watchos
+    target: tvos-swift
     configuration: Debug
+
   - xcode_version: 10.1
-    target: watchos
+    target: tvos-swift
     configuration: Debug
+
   - xcode_version: 10.2.1
-    target: watchos
+    target: tvos-swift
     configuration: Debug
 
-  ################
-  # cocoapods
-  ################
-  # Skip Debug
-  - target: cocoapods-ios
-    configuration: Debug
-  - target: cocoapods-osx
+  - xcode_version: 10.3
+    target: tvos-swift
     configuration: Debug
-  - target: cocoapods-watchos
+
+  - xcode_version: 11.1
+    target: tvos-swift
     configuration: Debug
 
-  ################
-  # swiftlint
-  ################
-  # Just run on 10.3 Release
-  - xcode_version: 9.4
-    target: swiftlint
   - xcode_version: 10.0
-    target: swiftlint
+    target: cocoapods-osx
+    configuration: Debug
+
   - xcode_version: 10.1
-    target: swiftlint
+    target: cocoapods-osx
+    configuration: Debug
+
   - xcode_version: 10.2.1
-    target: swiftlint
-  - target: swiftlint
+    target: cocoapods-osx
     configuration: Debug
 
-  ################
-  # swiftpm
-  ################
-  # Just run on 10.2/10.3 Release
-  - xcode_version: 9.4
-    target: swiftpm
-  - xcode_version: 10.0
-    target: swiftpm
-  - xcode_version: 10.1
-    target: swiftpm
-  - target: swiftpm
+  - xcode_version: 10.3
+    target: cocoapods-osx
     configuration: Debug
 
-  ################
-  # tvos
-  ################
-  # Skip Debug on everything but 10.3
-  - xcode_version: 9.4
-    target: tvos
+  - xcode_version: 11.1
+    target: cocoapods-osx
     configuration: Debug
+
+  - xcode_version: 11.2
+    target: cocoapods-osx
+    configuration: Debug
+
   - xcode_version: 10.0
-    target: tvos
+    target: cocoapods-ios
     configuration: Debug
+
   - xcode_version: 10.1
-    target: tvos
+    target: cocoapods-ios
     configuration: Debug
+
   - xcode_version: 10.2.1
-    target: tvos
+    target: cocoapods-ios
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: cocoapods-ios
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: cocoapods-ios
+    configuration: Debug
+
+  - xcode_version: 11.2
+    target: cocoapods-ios
     configuration: Debug
 
-  ################
-  # osx-encryption
-  ################
-  # Just run on 9.4/10.3 Release
   - xcode_version: 10.0
-    target: osx-encryption
+    target: cocoapods-ios-dynamic
+    configuration: Debug
+
   - xcode_version: 10.1
-    target: osx-encryption
+    target: cocoapods-ios-dynamic
+    configuration: Debug
+
   - xcode_version: 10.2.1
-    target: osx-encryption
-  - target: osx-encryption
+    target: cocoapods-ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: cocoapods-ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: cocoapods-ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 11.2
+    target: cocoapods-ios-dynamic
     configuration: Debug
 
-  ################
-  # osx-object-server
-  ################
-  # Just run on 9.4/10.3 Release
   - xcode_version: 10.0
-    target: osx-object-server
+    target: cocoapods-watchos
+    configuration: Debug
+
   - xcode_version: 10.1
-    target: osx-object-server
+    target: cocoapods-watchos
+    configuration: Debug
+
   - xcode_version: 10.2.1
-    target: osx-object-server
-  - target: osx-object-server
+    target: cocoapods-watchos
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: cocoapods-watchos
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: cocoapods-watchos
+    configuration: Debug
+
+  - xcode_version: 11.2
+    target: cocoapods-watchos
     configuration: Debug
 
-  ################
-  # ios-device-objc-ios8
-  ################
-  # Just run on 9.4/10.3 Release
   - xcode_version: 10.0
-    target: ios-device-objc-ios8
-  - xcode_version: 10.1
-    target: ios-device-objc-ios8
-  - xcode_version: 10.2.1
-    target: ios-device-objc-ios8
-  - target: ios-device-objc-ios8
+    target: swiftpm
     configuration: Debug
 
-  ################
-  # ios-device-swift-ios8
-  ################
-  # Just run on 9.4/10.3 Release
   - xcode_version: 10.0
-    target: ios-device-swift-ios8
+    target: swiftpm
+    configuration: Release
+
   - xcode_version: 10.1
-    target: ios-device-swift-ios8
-  - xcode_version: 10.2.1
-    target: ios-device-swift-ios8
-  - target: ios-device-swift-ios8
+    target: swiftpm
     configuration: Debug
 
-  ################
-  # ios-device-objc-ios10
-  ################
-  # Just run on 9.3/10.3 Release
-  - xcode_version: 10.0
-    target: ios-device-objc-ios10
   - xcode_version: 10.1
-    target: ios-device-objc-ios10
+    target: swiftpm
+    configuration: Release
+
   - xcode_version: 10.2.1
-    target: ios-device-objc-ios10
-  - target: ios-device-objc-ios10
+    target: swiftpm
+    configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: swiftpm
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: swiftpm
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: swiftpm
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: swiftpm
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: swiftpm
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: swiftpm-address
     configuration: Debug
 
-  ################
-  # ios-device-swift-ios10
-  ################
-  # Just run on 9.4/10.3 Release
   - xcode_version: 10.0
-    target: ios-device-swift-ios10
+    target: swiftpm-address
+    configuration: Release
+
   - xcode_version: 10.1
-    target: ios-device-swift-ios10
+    target: swiftpm-address
+    configuration: Debug
+
+  - xcode_version: 10.1
+    target: swiftpm-address
+    configuration: Release
+
   - xcode_version: 10.2.1
-    target: ios-device-swift-ios10
-  - target: ios-device-swift-ios10
+    target: swiftpm-address
+    configuration: Debug
+
+  - xcode_version: 10.2.1
+    target: swiftpm-address
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: swiftpm-address
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: swiftpm-address
+    configuration: Release
+
+  - xcode_version: 11.1
+    target: swiftpm-address
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: swiftpm-address
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: swiftpm-address
     configuration: Debug
 
-  ################
-  # tvos-device
-  ################
-  # Just run on 10.2 Release
-  - xcode_version: 9.4
-    target: tvos-device
   - xcode_version: 10.0
-    target: tvos-device
+    target: swiftpm-thread
+    configuration: Debug
+
+  - xcode_version: 10.0
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 10.1
+    target: swiftpm-thread
+    configuration: Debug
+
   - xcode_version: 10.1
-    target: tvos-device
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 10.2.1
+    target: swiftpm-thread
+    configuration: Debug
+
   - xcode_version: 10.2.1
-    target: tvos-device
-  - target: tvos-device
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 10.3
+    target: swiftpm-thread
+    configuration: Debug
+
+  - xcode_version: 10.3
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 11.1
+    target: swiftpm-thread
+    configuration: Debug
+
+  - xcode_version: 11.1
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 11.2
+    target: swiftpm-thread
     configuration: Debug

+ 5 - 0
Carthage/Checkouts/realm-cocoa/.swiftlint.yml

@@ -2,6 +2,11 @@ included:
   - Realm/ObjectServerTests
   - RealmSwift
   - Realm/Swift
+  - examples/installation/watchos/swift
+  - examples/installation/osx/swift
+  - examples/installation/ios/swift
+  - examples/ios/swift
+  - examples/tvos/swift
 identifier_name:
   min_length: # not possible to disable this partial rule, so set it to zero
     warning: 0

+ 232 - 1
Carthage/Checkouts/realm-cocoa/CHANGELOG.md

@@ -1,3 +1,234 @@
+4.1.1 Release notes (2019-11-18)
+=============================================================
+
+### Fixed
+
+* The UpdatePolicy passed to `realm.add()` or `realm.create()` was not properly
+  propagated when adding objects within a `List`, which could result in
+  spurious change notifications when using `.modified`.
+  ([#6321](https://github.com/realm/realm-cocoa/issues/6321), since v3.16.0)
+* Fix a rare deadlock when a Realm collection or object was observed, then
+  `refresh()` was explicitly called, and then the NotificationToken from the
+  observation was destroyed on a different thread (since 0.98.0).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.2.
+
+4.1.0 Release notes (2019-11-13)
+=============================================================
+
+### Enhancements
+
+* Improve performance of queries over a link where the final target property
+  has an index.
+* Restore support for storing `@objc enum` properties on RealmSwift.Object
+  subclasses (broken in 4.0.0), and add support for storing them in
+  RealmOptional properties.
+
+### Fixed
+
+* The sync client would fail to reconnect after failing to integrate a
+  changeset. The bug would lead to further corruption of the client’s Realm
+  file. ([RSYNC-48](https://jira.mongodb.org/browse/RSYNC-48), since v3.2.0).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.2.
+
+### Internal
+
+* Upgraded realm-core from 5.23.5 to 5.23.6.
+* Upgraded realm-sync from 4.7.11 to 4.8.2
+
+4.0.0 Release notes (2019-11-08)
+=============================================================
+
+### Breaking Changes
+
+* All previously deprecated functionality has now been removed entirely.
+* The schema discovery logic for RealmSwift.Object subclasses has been
+  rewritten in Swift. This should not have any effect on valid class
+  definitions, but there may be types of invalid definitions which previously
+  worked by coincidence and no longer do.
+* `SyncSubscription` no longer has a generic type parameter, as the type was
+  not actually used for anything.
+* The following Swift types have changed from `final class` to `struct`:
+    - AnyRealmCollection
+    - LinkingObjects
+    - ObjectiveCSupport
+    - Realm
+    - Results
+    - SyncSubscription
+    - ThreadSafeReference
+  There is no intended change in semantics from this, but certain edge cases
+  may behave differently.
+* The designated initializers defined by RLMObject and Object other than
+  zero-argument `init` have been replaced with convenience initializers.
+* The implementation of the path-based permissions API has been redesigned to
+  accomodate changes to the server. This should be mostly a transparent change,
+  with two main exceptions:
+  1. SyncPermission objects are no longer live Realm objects, and retrieving
+  permissions gives an Array<SyncPermission> rather than Results<SyncPermission>.
+  Getting up-to-date permissions now requires calling retrievePermissions() again
+  rather than observing the permissions.
+  2. The error codes for permissions functions have changed. Rather than a
+  separate error type and set of error codes, permission functions now produce
+  SyncAuthErrors.
+
+### Enhancements
+
+* Improve performance of initializing Realm objects with List properties.
+
+### Fixed
+
+* None.
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.2.
+
+3.21.0 Release notes (2019-11-04)
+=============================================================
+
+### Enhancements
+
+* Add prebuilt binaries for Xcode 11.2.
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.2.
+
+3.20.0 Release notes (2019-10-21)
+=============================================================
+
+### Enhancements
+
+* Add support for custom refresh token authentication. This allows a user to be
+  authorized with an externally-issued refresh token when ROS is configured to
+  recognize the external issuer as a refresh token validator.
+  ([PR #6311](https://github.com/realm/realm-cocoa/pull/6311)).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.
+
+3.19.1 Release notes (2019-10-17)
+=============================================================
+
+### Enhancements
+
+* Improve performance of sync changeset integration. Transactions involving a
+  very large number of objects and cheap operations on each object are as much
+  as 20% faster.
+
+### Fixed
+
+* Fix a crash when a RLMArray/List of primitives was observed and then the
+  containing object was deleted before the first time that the background
+  notifier could run.
+  ([Issue #6234](https://github.com/realm/realm-cocoa/issues/6234, since 3.0.0)).
+* Remove an incorrect assertion that would cause crashes inside
+  `TableInfoCache::get_table_info()`, with messages like "Assertion failed: info.object_id_index == 0 [3, 0]".
+  (Since 3.18.0, [#6268](https://github.com/realm/realm-cocoa/issues/6268) and [#6257](https://github.com/realm/realm-cocoa/issues/6257)).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.0.
+
+### Internal
+
+* Upgrade to REALM_SYNC_VERSION=4.7.11
+
+3.19.0 Release notes (2019-09-27)
+=============================================================
+
+### Enhancements
+
+* Expose ObjectSchema.objectClass in Swift as looking up the class via
+  NSClassFromString() can be complicated for Swift types.
+  ([PR #6244](https://github.com/realm/realm-cocoa/pull/6244)).
+* Add support for suppressing notifications using closure-based write/transaction methods.
+  ([PR #6252](https://github.com/realm/realm-cocoa/pull/6252)).
+
+### Fixed
+
+* IN or chained OR equals queries on an unindexed string column would fail to
+  match some results if any of the strings were 64 bytes or longer.
+  ([Core #3386](https://github.com/realm/realm-core/pull/3386), since 3.14.2).
+* Query Based Sync subscriptions for queries involving a null timestamp were
+  not sent to the server correctly and would match no objects.
+  ([Core #3389](https://github.com/realm/realm-core/pull/3388), since 3.17.3).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.0.
+
+### Internal
+
+* Upgrade to REALM_CORE_VERSION=5.23.5
+* Upgrade to REALM_SYNC_VERSION=4.7.8
+
+3.18.0 Release notes (2019-09-13)
+=============================================================
+
+The file format for synchronized Realms has changed. Old Realms will be
+automatically upgraded when they are opened. Once upgraded, the files will not
+be openable by older versions of Realm. The upgrade should not take a
+significant amount of time to run or run any risk of errors.
+
+This does not effect non-synchronized Realms.
+
+### Enhancements
+
+* Improve performance of queries on Date properties
+  ([Core #3344](https://github.com/realm/realm-core/pull/3344), [Core #3351](https://github.com/realm/realm-core/pull/3351)).
+* Syncronized Realms are now more aggressive about trimming local history that
+  is no longer needed. This should reduce file size growth in write-heavy
+  workloads. ([Sync #3007](https://github.com/realm/realm-sync/issues/3007)).
+* Add support for building Realm as an xcframework.
+  ([PR #6238](https://github.com/realm/realm-cocoa/pull/6238)).
+* Add prebuilt libraries for Xcode 11 to the release package.
+  ([PR #6248](https://github.com/realm/realm-cocoa/pull/6248)).
+* Add a prebuilt library for Catalyst/UIKit For Mac to the release package
+  ([PR #6248](https://github.com/realm/realm-cocoa/pull/6248)).
+
+### Fixed
+
+* If a signal interrupted a msync() call, Realm would throw an exception and
+  the write transaction would fail. This behavior has new been changed to retry
+  the system call instead. ([Core #3352](https://github.com/realm/realm-core/issues/3352))
+* Queries on the sum or average of an integer property would sometimes give
+  incorrect results. ([Core #3356](https://github.com/realm/realm-core/pull/3356)).
+* Opening query-based synchronized Realms with a small number of subscriptions
+  performed an unneccesary write transaction. ([ObjectStore #815](https://github.com/realm/realm-object-store/pull/815)).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.0
+
+### Deprecations
+
+* `RLMIdentityProviderNickname` has been deprecated in favor of `RLMIdentityProviderUsernamePassword`.
+* `+[RLMIdentityProvider credentialsWithNickname]` has been deprecated in favor of `+[RLMIdentityProvider credentialsWithUsername]`.
+* `Sync.nickname(String, Bool)` has been deprecated in favor of `Sync.usernamePassword(String, String, Bool)`.
+
 3.17.3 Release notes (2019-07-24)
 =============================================================
 
@@ -17,7 +248,7 @@
 ### Enhancements
 
 * Add support for canceling asynchronous opens using a new AsyncOpenTask
-  returned from the asyncOpen() call. ([PR #6913](https://github.com/realm/realm-cocoa/pull/6187)).
+  returned from the asyncOpen() call. ([PR #6193](https://github.com/realm/realm-cocoa/pull/6193)).
 * Importing the Realm SPM package can now be done by pinning to a version
   rather than a branch.
 

+ 3 - 1
Carthage/Checkouts/realm-cocoa/Configuration/Base.xcconfig

@@ -45,7 +45,9 @@ GCC_WARN_UNUSED_VARIABLE = YES;
 SWIFT_COMPILATION_MODE = wholemodule;
 SWIFT_OPTIMIZATION_LEVEL = -Owholemodule;
 WARNING_CFLAGS = -Wmismatched-tags -Wunused-private-field -Wpartial-availability;
-OTHER_CFLAGS = -fvisibility-inlines-hidden;
+OTHER_CFLAGS = -fvisibility-inlines-hidden $(REALM_CATALYST_FLAGS);
+OTHER_LDFLAGS = $(REALM_CATALYST_FLAGS);
+OTHER_SWIFT_FLAGS = $(REALM_CATALYST_FLAGS);
 
 OTHER_CPLUSPLUSFLAGS = $(inherited) -isystem core/include;
 HEADER_SEARCH_PATHS = $(inherited) Realm/ObjectStore/src;

+ 5 - 3
Carthage/Checkouts/realm-cocoa/Configuration/Realm/Realm.xcconfig

@@ -11,7 +11,8 @@ DEFINES_MODULE = YES;
 DYLIB_COMPATIBILITY_VERSION = 1;
 DYLIB_CURRENT_VERSION = 1;
 DYLIB_INSTALL_NAME_BASE = @rpath;
-MACH_O_TYPE = mh_dylib;
+REALM_OBJC_MACH_O_TYPE = mh_dylib;
+MACH_O_TYPE = $(REALM_OBJC_MACH_O_TYPE);
 FRAMEWORK_VERSION = A;
 
 APPLICATION_EXTENSION_API_ONLY = YES;
@@ -27,8 +28,9 @@ LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = $(inherited) @executable_path/Frameworks
 LD_RUNPATH_SEARCH_PATHS[sdk=watch*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks;
 LD_RUNPATH_SEARCH_PATHS[sdk=appletv*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks;
 
-OTHER_LDFLAGS[sdk=macosx*] = -lrealm$(REALM_LIBRARY_SUFFIX);
-OTHER_LIBTOOLFLAGS[sdk=macosx*] = -lrealm$(REALM_LIBRARY_SUFFIX);
+REALM_PLATFORM_SUFFIX = $(PLATFORM_NAME);
+OTHER_LDFLAGS[sdk=macosx*] = -lrealm-$(REALM_PLATFORM_SUFFIX)$(REALM_LIBRARY_SUFFIX) $(REALM_CATALYST_FLAGS);
+OTHER_LIBTOOLFLAGS[sdk=macosx*] = -lrealm-$(REALM_PLATFORM_SUFFIX)$(REALM_LIBRARY_SUFFIX) $(REALM_CATALYST_FLAGS);
 OTHER_LDFLAGS[sdk=iphone*] = -lrealm-ios$(REALM_LIBRARY_SUFFIX);
 OTHER_LIBTOOLFLAGS[sdk=iphone*] = -lrealm-ios$(REALM_LIBRARY_SUFFIX);
 OTHER_LDFLAGS[sdk=watch*] = -lrealm-watchos$(REALM_LIBRARY_SUFFIX);

+ 69 - 45
Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability

@@ -1,8 +1,10 @@
-xcodeVersions = ['9.4', '10.0', '10.1', '10.2.1', '10.3']
-platforms = ['osx', 'ios', 'watchos', 'tvos']
-platformNames = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS']
-carthageXcodeVersion = '10.3'
-docsSwiftVersion = '5.0.1'
+xcodeVersions = ['10.0', '10.1', '10.2.1', '10.3', '11.1', '11.2']
+platforms = ['osx', 'ios', 'watchos', 'tvos', 'catalyst']
+carthagePlatforms = ['osx', 'ios', 'watchos', 'tvos']
+platformNames = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS', 'catalyst': 'Catalyst']
+carthageXcodeVersion = '11.2'
+objcXcodeVersion = '10.1'
+docsSwiftVersion = '5.1'
 
 def installationTest(platform, test, language) {
   return {
@@ -15,36 +17,26 @@ def installationTest(platform, test, language) {
       }
 
       sh """
-      archive=\$(echo \$PWD/realm-${language}-*.zip)
+      export REALM_XCODE_VERSION=${carthageXcodeVersion}
+      if [ "${platform}" != osx ]; then
+        ./scripts/reset-simulators.sh
+      fi
       cd examples/installation
 
+      archive=\$(echo \$PWD/realm-${language}-*.zip)
       if [[ -f \$archive ]]; then
         mv \$archive .
-        unzip realm-${language}-*zip
-        find . -name 'realm-${language}-*' -print0 | xargs -J% mv % realm-${language}-latest
+        unzip realm-${language}-*.zip
+        rm realm-${language}-*.zip
+        mv realm-${language}-* realm-${language}-latest
       fi
 
-      export REALM_XCODE_VERSION=${carthageXcodeVersion}
       ./build.sh test-${platform}-${language}-${test}
       """
     }
   }
 }
 
-def buildObjC(platform, outputDirectory=null) {
-  return {
-    node('osx') {
-      deleteDir()
-      unstash 'source'
-      sh "XCMODE=xcpretty ./build.sh package-${platform}"
-      dir(outputDirectory ?: "build/${platform}") {
-        stash includes: "realm-framework-${platform}.zip", name: "${platform}-objc"
-      }
-    }
-  }
-}
-
-
 def doBuild() {
   stage('prepare') {
     node('docker') {
@@ -94,14 +86,19 @@ def doBuild() {
         }
       },
 
-      'macOS Obj-C': buildObjC('osx', 'build/DerivedData/Realm/Build/Products/Release'),
-      'iOS Obj-C': buildObjC('ios'),
-      'watchOS Obj-C': buildObjC('watchos'),
-      'tvOS Obj-C': buildObjC('tvos'),
-      'iOS Obj-C static': buildObjC('ios-static'),
+      'iOS Obj-C static': {
+        node('osx') {
+          deleteDir()
+          unstash 'source'
+          sh "XCMODE=xcpretty REALM_XCODE_VERSION=${objcXcodeVersion} ./build.sh package-ios-static"
+          dir("build/ios-static") {
+            stash includes: "realm-framework-ios-static.zip", name: "ios-static"
+          }
+        }
+      }
     ]
 
-    for (def p in platforms) {
+    for (def p in carthagePlatforms) {
       def platform = p
       def platformName = platformNames[platform]
       parallelBuilds["${platformName} Carthage"] = {
@@ -113,6 +110,10 @@ def doBuild() {
           . ./scripts/swift-version.sh
           set_xcode_and_swift_versions
 
+          if [ "${platform}" != osx ]; then
+            ./scripts/reset-simulators.rb
+          fi
+
           carthage build --no-skip-current --platform ${platform}
           carthage archive --output Carthage-${platform}.framework.zip
           """
@@ -127,14 +128,14 @@ def doBuild() {
       def platformName = platformNames[platform]
       for (def v in xcodeVersions) {
         def xcodeVersion = v
-        parallelBuilds["${platformName} Swift ${xcodeVersion}"] = {
+        parallelBuilds["${platformName} ${xcodeVersion}"] = {
           node('osx') {
             deleteDir()
             unstash 'source'
-            sh "XCMODE=xcpretty ./build.sh package-${platform}-swift-${xcodeVersion}"
+            sh "XCMODE=xcpretty REALM_XCODE_VERSION=${xcodeVersion} ./build.sh package ${platform}"
             dir("build/${platform}") {
-              stash includes: "realm-swift-framework-${platform}-swift-${xcodeVersion}.zip",
-                    name: "${platform}-swift-${xcodeVersion}"
+              stash includes: "realm-framework-${platform}-${xcodeVersion}.zip",
+                    name: "${platform}-${xcodeVersion}"
             }
           }
         }
@@ -151,14 +152,19 @@ def doBuild() {
           deleteDir()
 
           for (def platform in platforms) {
-            unstash "${platform}-objc"
+            unstash "${platform}-${objcXcodeVersion}"
           }
 
-          unstash 'ios-static-objc'
+          // The 10.x builds don't actually have a framework for catalyst, so
+          // use the 11.0 version instead
+          unstash 'catalyst-11.1'
+          sh "mv realm-framework-catalyst-11.1.zip realm-framework-catalyst-${objcXcodeVersion}.zip"
+
+          unstash 'ios-static'
           unstash 'examples'
           unstash 'source'
 
-          sh './build.sh package-release objc'
+          sh "REALM_XCODE_VERSION=${objcXcodeVersion} ./build.sh package-release objc"
           stash include: 'realm-objc-*.zip', name: 'objc-packaged'
           archiveArtifacts artifacts: 'realm-objc-*.zip'
         }
@@ -169,7 +175,7 @@ def doBuild() {
 
           for (def platform in platforms) {
             for (def xcodeVersion in xcodeVersions) {
-              unstash "${platform}-swift-${xcodeVersion}"
+              unstash "${platform}-${xcodeVersion}"
             }
           }
 
@@ -177,7 +183,6 @@ def doBuild() {
           unstash 'source'
 
           sh './build.sh package-release swift'
-          sh 'rm realm-swift-framework-*.zip'
           stash include: 'realm-swift-*.zip', name: 'swift-packaged'
           archiveArtifacts artifacts: 'realm-swift-*.zip'
         }
@@ -186,7 +191,7 @@ def doBuild() {
         node('osx') {
           deleteDir()
 
-          for (def platform in platforms) {
+          for (def platform in carthagePlatforms) {
             unstash "${platform}-carthage"
           }
 
@@ -206,12 +211,30 @@ def doBuild() {
 
   stage('test') {
     def parallelBuilds = [
-      'Test Examples': {
+      'Test Obj-C Examples': {
         node('osx') {
           deleteDir()
 
-          // FIXME: Split Obj-C and Swift.
           unstash 'objc-packaged'
+
+          def sha = params.sha
+          sh """
+          curl -O https://raw.githubusercontent.com/realm/realm-cocoa/${sha}/build.sh
+          mkdir -p scripts
+          curl https://raw.githubusercontent.com/realm/realm-cocoa/${sha}/scripts/swift-version.sh -o scripts/swift-version.sh
+          curl https://raw.githubusercontent.com/realm/realm-cocoa/${sha}/scripts/reset-simulators.sh -o scripts/reset-simulators.sh
+          curl https://raw.githubusercontent.com/realm/realm-cocoa/${sha}/scripts/reset-simulators.rb -o scripts/reset-simulators.rb
+          chmod +x scripts/reset-simulators.rb
+
+          XCMODE=xcpretty sh build.sh package-test-examples-objc
+          """
+        }
+      },
+
+      'Test Swift Examples': {
+        node('osx') {
+          deleteDir()
+
           unstash 'swift-packaged'
 
           def sha = params.sha
@@ -223,7 +246,7 @@ def doBuild() {
           curl https://raw.githubusercontent.com/realm/realm-cocoa/${sha}/scripts/reset-simulators.rb -o scripts/reset-simulators.rb
           chmod +x scripts/reset-simulators.rb
 
-          XCMODE=xcpretty sh build.sh package-test-examples
+          XCMODE=xcpretty sh build.sh package-test-examples-swift
           """
         }
       },
@@ -233,7 +256,8 @@ def doBuild() {
           deleteDir()
           unstash 'source'
 
-          sh 'XCMODE=xcpretty IS_RUNNING_PACKAGING=1 sh build.sh test-ios-static'
+          sh './scripts/reset-simulators.rb'
+          sh 'XCMODE=xcpretty sh build.sh test-ios-static'
         }
       },
 
@@ -247,7 +271,7 @@ def doBuild() {
       }
     ]
 
-    for (def platform in ["osx", "ios"]) {
+    for (def platform in ["osx", "ios", "watchos"]) {
       def platformName = platformNames[platform]
       for (def test in ["dynamic", "cocoapods", "carthage"]) {
         parallelBuilds["Installation - ${platformName} Obj-C ${test}"] = installationTest(platform, test, 'objc')
@@ -257,7 +281,7 @@ def doBuild() {
     parallelBuilds["Installation - iOS Obj-C static"] = installationTest('ios', 'static', 'objc')
     parallelBuilds["Installation - iOS Obj-C CocoaPods dynamic"] = installationTest('ios', 'cocoapods-dynamic', 'objc')
 
-    for (def platform in ["osx", "ios"]) {
+    for (def platform in ["osx", "ios", "watchos"]) {
       def platformName = platformNames[platform]
       for (def test in ["cocoapods", "carthage"]) {
         parallelBuilds["Installation - ${platformName} Swift ${test}"] = installationTest(platform, test, 'swift')

+ 18 - 46
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMObjectServerTests.mm

@@ -95,6 +95,24 @@
     XCTAssertTrue(user.isAdmin);
 }
 
+- (void)testCustomRefreshTokenAuthentication {
+    RLMSyncCredentials *credentials = [RLMSyncCredentials credentialsWithCustomRefreshToken:@"token" identity:@"custom_identity1" isAdmin:NO];
+    XCTAssertNotNil(credentials);
+
+    RLMSyncUser *user = [self logInUserForCredentials:credentials server:[RLMObjectServerTests authServerURL]];
+    XCTAssertEqualObjects(user.refreshToken, @"token");
+    XCTAssertEqualObjects(user.identity, @"custom_identity1");
+    XCTAssertFalse(user.isAdmin);
+
+    credentials = [RLMSyncCredentials credentialsWithCustomRefreshToken:@"token" identity:@"custom_identity2" isAdmin:YES];
+    XCTAssertNotNil(credentials);
+
+    user = [self logInUserForCredentials:credentials server:[RLMObjectServerTests authServerURL]];
+    XCTAssertEqualObjects(user.refreshToken, @"token");
+    XCTAssertEqualObjects(user.identity, @"custom_identity2");
+    XCTAssertTrue(user.isAdmin);
+}
+
 /// An invalid username/password credential should not be able to log in a user and a corresponding error should be generated.
 - (void)testInvalidPasswordAuthentication {
     [self logInUserForCredentials:[RLMSyncTestCase basicCredentialsWithName:NSStringFromSelector(_cmd) register:YES]
@@ -1743,52 +1761,6 @@ static const NSInteger NUMBER_OF_BIG_OBJECTS = 2;
     XCTAssertNil(error);
 }
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated"
-- (void)testAutomaticSyncConfiguration {
-    NSURL *server = [RLMObjectServerTests authServerURL];
-
-    // Automatic configuration should throw when there are no logged-in users.
-    XCTAssertThrows([RLMSyncConfiguration automaticConfiguration]);
-
-    RLMSyncCredentials *credsA = [RLMObjectServerTests basicCredentialsWithName:@"a" register:YES];
-    RLMSyncUser *userA = [self logInUserForCredentials:credsA server:server];
-
-    // Now that there's a logged-in user, we should be able to retrieve the configuration.
-    RLMRealmConfiguration *configuration = [RLMSyncConfiguration automaticConfiguration];
-    XCTAssert(configuration);
-
-    @autoreleasepool {
-        // And open it successfully.
-        RLMRealm *realm = [self openRealmWithConfiguration:configuration];
-        [self waitForDownloadsForRealm:realm];
-    }
-
-
-    RLMSyncCredentials *credsB = [RLMObjectServerTests basicCredentialsWithName:@"b" register:YES];
-    RLMSyncUser *userB = [self logInUserForCredentials:credsB server:server];
-
-    // Automatic configuration should throw since there's more than one logged-in user.
-    XCTAssertThrows([RLMSyncConfiguration automaticConfiguration]);
-
-    // It should still be possible to explicitly retrieve an automatic configuration for a user.
-    RLMRealmConfiguration *configurationA = [RLMSyncConfiguration automaticConfigurationForUser:userA];
-    XCTAssert(configurationA);
-    XCTAssertEqualObjects(configuration.syncConfiguration, configurationA.syncConfiguration);
-
-    RLMRealmConfiguration *configurationB = [RLMSyncConfiguration automaticConfigurationForUser:userB];
-    XCTAssert(configurationB);
-    XCTAssertNotEqualObjects(configuration.syncConfiguration, configurationB.syncConfiguration);
-
-
-    [userB logOut];
-
-    // Now that we're back to a single logged-in user, we should be able to retrieve the configuration.
-    configuration = [RLMSyncConfiguration automaticConfiguration];
-    XCTAssert(configuration);
-}
-#pragma clang diagnostic pop
-
 #pragma mark - Partial sync
 
 - (void)waitForKeyPath:(NSString *)keyPath object:(id)object value:(id)value {

File diff suppressed because it is too large
+ 235 - 447
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMPermissionsAPITests.m


+ 3 - 7
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMPermissionsTests.mm

@@ -96,14 +96,10 @@
 }
 
 - (NSError *)subscribeToRealm:(RLMRealm *)realm type:(Class)cls where:(NSString *)pred {
-    __block NSError *error;
-    XCTestExpectation *ex = [self expectationWithDescription:@"Should be able to successfully complete a query"];
-    [realm subscribeToObjects:cls where:pred callback:^(__unused RLMResults *results, NSError *err) {
-        error = err;
-        [ex fulfill];
-    }];
+    RLMSyncSubscription *sub = [[cls objectsInRealm:realm where:pred] subscribe];
+    id ex = [[XCTKVOExpectation alloc] initWithKeyPath:@"state" object:sub expectedValue:@(RLMSyncSubscriptionStateComplete)];
     [self waitForExpectations:@[ex] timeout:20.0];
-    return error;
+    return sub.error;
 }
 
 - (NSURL *)createRealmWithName:(SEL)sel permissions:(void (^)(RLMRealm *realm))block {

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftObjectServerTests.swift

@@ -449,7 +449,7 @@ class SwiftObjectServerTests: SwiftSyncTestCase {
         let fileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(fileName)
         try! FileManager.default.copyItem(at: sourceFileURL, to: fileURL)
 
-        let syncConfig = RLMSyncConfiguration(user: user, realmURL: realmURL)
+        let syncConfig = ObjectiveCSupport.convert(object: user.configuration(realmURL: realmURL, fullSynchronization: true).syncConfiguration!)
         syncConfig.customFileURL = fileURL
         let config = Realm.Configuration(syncConfiguration: ObjectiveCSupport.convert(object: syncConfig))
         do {

+ 22 - 101
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftPermissionsAPITests.swift

@@ -19,7 +19,7 @@
 import XCTest
 import RealmSwift
 
-class SwiftPermissionsAPITests: SwiftSyncTestCase {
+class SwiftRealmPermissionsAPITests: SwiftSyncTestCase {
     var userA: SyncUser!
     var userB: SyncUser!
     var userC: SyncUser!
@@ -42,46 +42,6 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
         super.tearDown()
     }
 
-    private func checkPermissionCount(results: SyncPermissionResults,
-                                      expected: Int,
-                                      file: StaticString = #file,
-                                      line: UInt = #line) {
-        let ex = expectation(description: "Checking permission count")
-        let token = results.observe { (change) in
-            if case let .error(theError) = change {
-                XCTFail("Notification returned error '\(theError)' when running test at \(file):\(line)")
-                return
-            }
-            if results.count == expected {
-                ex.fulfill()
-            }
-        }
-        waitForExpectations(timeout: 2.0, handler: nil)
-        token.invalidate()
-    }
-
-    private func get(permission: SyncPermission,
-                     from results: SyncPermissionResults,
-                     file: StaticString = #file,
-                     line: UInt = #line) -> SyncPermission? {
-        let ex = expectation(description: "Retrieving permission")
-        var finalValue: SyncPermission?
-        let token = results.observe { (change) in
-            if case let .error(theError) = change {
-                XCTFail("Notification returned error '\(theError)' when running test at \(file):\(line)")
-                return
-            }
-            for result in results where result == permission {
-                finalValue = result
-                ex.fulfill()
-                return
-            }
-        }
-        waitForExpectations(timeout: 2.0, handler: nil)
-        token.invalidate()
-        return finalValue
-    }
-
     /// Ensure the absence of a permission from a results after an elapsed time interval.
     /// This method is intended to be used to check that a permission never becomes
     /// present within a results to begin with.
@@ -90,21 +50,6 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
                                after wait: Double = 0.5,
                                file: StaticString = #file,
                                line: UInt = #line) {
-        let ex = expectation(description: "Looking for permission")
-        var isPresent = false
-        let token = results.observe { (change) in
-            if case let .error(theError) = change {
-                XCTFail("Notification returned error '\(theError)' when running test at \(file):\(line)")
-                return
-            }
-            isPresent = results.contains(permission)
-        }
-        DispatchQueue.main.asyncAfter(deadline: .now() + wait) {
-            ex.fulfill()
-        }
-        waitForExpectations(timeout: wait + 1.0, handler: nil)
-        token.invalidate()
-        XCTAssertFalse(isPresent, "Permission '\(permission)' was spuriously present (\(file):\(line))")
     }
 
     private func tildeSubstitutedURL(for url: URL, user: SyncUser) -> URL {
@@ -117,15 +62,13 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
     func testSettingPermissions() {
         // First, there should be no permissions.
         let ex = expectation(description: "No permissions for newly created user.")
-        var results: SyncPermissionResults!
         userB.retrievePermissions { (r, error) in
             XCTAssertNil(error)
             XCTAssertNotNil(r)
-            results = r
+            XCTAssertEqual(r!.count, 0)
             ex.fulfill()
         }
         waitForExpectations(timeout: 2.0, handler: nil)
-        checkPermissionCount(results: results, expected: 0)
 
         // Open a Realm for user A.
         let uuid = UUID().uuidString
@@ -150,50 +93,26 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
         userB.retrievePermissions { (r, error) in
             XCTAssertNil(error)
             XCTAssertNotNil(r)
-            results = r
+            guard let r = r else { return }
+
+            XCTAssertTrue(r.contains(p))
+            // Check getting permission by its index.
+            let index = r.index(of: p)
+            XCTAssertNotNil(index)
+            XCTAssertTrue(p == r[index!])
+
             ex3.fulfill()
         }
         waitForExpectations(timeout: 2.0, handler: nil)
-        // Expected permission: applies to user B, but for user A's Realm.
-        let finalValue = get(permission: p, from: results)
-        XCTAssertNotNil(finalValue, "Did not find the permission \(p)")
-
-        // Check getting permission by its index.
-        let index = results.index(of: p)
-        XCTAssertNotNil(index)
-        XCTAssertTrue(p == results[index!])
     }
 
     /// Observing permission changes should work.
     func testObservingPermissions() {
-        // Get a reference to the permission results.
-        let ex = expectation(description: "Retrieve permission results.")
-        var results: SyncPermissionResults!
-        userB.retrievePermissions { (r, error) in
-            XCTAssertNil(error)
-            XCTAssertNotNil(r)
-            results = r
-            ex.fulfill()
-        }
-        waitForExpectations(timeout: 2.0, handler: nil)
-
         // Open a Realm for user A.
         let uuid = UUID().uuidString
         let url = SwiftSyncTestCase.uniqueRealmURL(customName: uuid)
         _ = try! synchronouslyOpenRealm(url: url, user: userA)
 
-        // Register notifications.
-        let noteEx = expectation(description: "Notification should fire")
-        let token = results.observe { (change) in
-            if case .error = change {
-                XCTFail("Should not return an error")
-                return
-            }
-            if results.count > 0 {
-                noteEx.fulfill()
-            }
-        }
-
         // Give user B read permissions to that Realm.
         let p = SyncPermission(realmPath: tildeSubstitutedURL(for: url, user: userA).path,
                                identity: userB.identity!,
@@ -205,13 +124,17 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
             XCTAssertNil(error)
             ex2.fulfill()
         }
-        waitForExpectations(timeout: 2.0, handler: nil)
+        wait(for: [ex2], timeout: 2.0)
 
-        // Wait for the notification to be fired.
-        wait(for: [noteEx], timeout: 2.0)
-        token.invalidate()
-        let finalValue = get(permission: p, from: results)
-        XCTAssertNotNil(finalValue, "Did not find the permission \(p)")
+        // Verify that it was added
+        let ex3 = expectation(description: "Retrieving the results should work.")
+        userB.retrievePermissions { (r, error) in
+            XCTAssertNil(error)
+            XCTAssertNotNil(r)
+            XCTAssertTrue(r!.contains(p))
+            ex3.fulfill()
+        }
+        waitForExpectations(timeout: 2.0, handler: nil)
     }
 
     /// User should not be able to change a permission for a Realm they don't own.
@@ -226,23 +149,21 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
 
         // Attempt to set the permission.
         let ex2 = expectation(description: "Setting an invalid permission should fail.")
-        userB.apply(p) { (error) in
+        userB.apply(p) { error in
             XCTAssertNotNil(error)
             ex2.fulfill()
         }
         waitForExpectations(timeout: 2.0, handler: nil)
 
         // Now retrieve the permissions again and make sure the new permission was not set.
-        var results: SyncPermissionResults!
         let ex3 = expectation(description: "Retrieving the results should work.")
         userB.retrievePermissions { (r, error) in
             XCTAssertNil(error)
             XCTAssertNotNil(r)
-            results = r
+            XCTAssertFalse(r!.contains(p))
             ex3.fulfill()
         }
         waitForExpectations(timeout: 2.0, handler: nil)
-        ensureAbsence(of: p, from: results)
     }
 
     // MARK: - Offer/response

+ 7 - 7
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftPermissionsTests.swift

@@ -56,15 +56,15 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
     }
 
     func subscribe<T: Object>(realm: Realm, type: T.Type, _ filter: String = "TRUEPREDICATE") {
-        let ex = expectation(description: "Add partial sync query")
-        realm.subscribe(to: type, where: filter) { _, err in
-            if let err = err {
-                XCTFail("Partial sync subsription failed: \(err)")
-            } else {
+        let subscription = realm.objects(type).filter(filter).subscribe()
+        let ex = expectation(description: "Waiting for subscription completion")
+        let token = subscription.observe(\.state, options: .initial) { state in
+            if state == .complete {
                 ex.fulfill()
             }
         }
-        waitForExpectations(timeout: 2.0, handler: nil)
+        waitForExpectations(timeout: 20.0)
+        token.invalidate()
     }
 
     func waitForSync(_ realm: Realm) {
@@ -148,7 +148,7 @@ class SwiftPermissionsAPITests: SwiftSyncTestCase {
         }
 
         let ex = expectation(description: "asyncOpen")
-        var subscription: SyncSubscription<SwiftSyncObject>!
+        var subscription: SyncSubscription!
         var token: NotificationToken!
         Realm.asyncOpen(configuration: userA.configuration(realmURL: url)) { realm, error in
             XCTAssertNil(error)

+ 6 - 0
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/test-ros-server.js

@@ -112,6 +112,12 @@ server.start({
         }),
     ],
     autoKeyGen: true,
+
+    // Disable the legacy Realm-based permissions service
+    permissionServiceConfigOverride: (config) => {
+        config.enableManagementRealmReflection = false;
+        config.enablePermissionRealmReflection = false;
+    },
 }).then(() => {
     console.log('started');
     fs.closeSync(1);

+ 54 - 81
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/RealmCore.cmake

@@ -53,18 +53,6 @@ else()
     set(SSL_LIBRARIES OpenSSL::SSL)
 endif()
 
-
-set(MAKE_FLAGS "REALM_HAVE_CONFIG=1")
-
-if(SANITIZER_FLAGS)
-    set(MAKE_FLAGS ${MAKE_FLAGS} "EXTRA_CFLAGS=${SANITIZER_FLAGS}" "EXTRA_LDFLAGS=${SANITIZER_FLAGS}")
-endif()
-
-ProcessorCount(NUM_JOBS)
-if(NOT NUM_JOBS EQUAL 0)
-    set(MAKE_FLAGS ${MAKE_FLAGS} "-j${NUM_JOBS}")
-endif()
-
 if (${CMAKE_VERSION} VERSION_GREATER "3.4.0")
     set(USES_TERMINAL_BUILD USES_TERMINAL_BUILD 1)
 endif()
@@ -73,7 +61,7 @@ function(use_realm_core enable_sync core_prefix sync_prefix)
     if(core_prefix)
         build_existing_realm_core(${core_prefix})
         if(sync_prefix)
-            build_existing_realm_sync(${sync_prefix})
+            build_existing_realm_sync(${core_prefix} ${sync_prefix})
         endif()
     elseif(enable_sync)
         # FIXME: Support building against prebuilt sync binaries.
@@ -233,6 +221,7 @@ endfunction()
 macro(build_realm_core)
     set(core_prefix_directory "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/realm-core")
 
+    separate_arguments(core_cfg_args UNIX_COMMAND "-D REALM_BUILD_LIB_ONLY=YES -D REALM_SKIP_SHARED_LIB=YES -G Ninja ${CORE_SANITIZER_FLAGS}")
     ExternalProject_Add(realm-core
         PREFIX ${core_prefix_directory}
         BUILD_IN_SOURCE 1
@@ -240,11 +229,11 @@ macro(build_realm_core)
         INSTALL_COMMAND ""
         CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory build.debug
                         && cd build.debug
-                        && cmake -D CMAKE_BUILD_TYPE=Debug -DREALM_BUILD_LIB_ONLY=YES -G Ninja ..
+                        && cmake -D CMAKE_BUILD_TYPE=Debug ${core_cfg_args} ..
                         && cd ..
                         && ${CMAKE_COMMAND} -E make_directory build.release
                         && cd build.release
-                        && cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -DREALM_BUILD_LIB_ONLY=YES -G Ninja ..
+                        && cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo ${core_cfg_args} ..
 
         BUILD_COMMAND cd build.debug
                    && cmake --build .
@@ -314,57 +303,52 @@ function(build_existing_realm_core core_directory)
                      )
 endfunction()
 
-macro(build_realm_sync)
-    set(cmake_files ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
-    if(REALM_PLATFORM STREQUAL "Android")
-        set(build_cmd sh build.sh build-android)
-    else()
-        set(build_cmd make -C src/realm librealm-sync.a librealm-sync-dbg.a librealm-server.a librealm-server-dbg.a ${MAKE_FLAGS})
-    endif()
+macro(build_realm_sync core_directory)
+    set(sync_prefix_directory "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/realm-sync")
 
+    separate_arguments(sync_cfg_args UNIX_COMMAND "-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} -DREALM_BUILD_TESTS=OFF -DREALM_BUILD_COMMANDLINE_TOOLS=OFF -G Ninja ${CORE_SANITIZER_FLAGS}")
     ExternalProject_Add(realm-sync-lib
-        DEPENDS realm-core
-        PREFIX ${cmake_files}/realm-sync
+        PREFIX ${sync_prefix_directory}
         BUILD_IN_SOURCE 1
         UPDATE_DISCONNECTED 1
-        BUILD_COMMAND ${build_cmd}
-        CONFIGURE_COMMAND ""
         INSTALL_COMMAND ""
+        CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory build.debug
+                        && cd build.debug
+                        && cmake -D CMAKE_BUILD_TYPE=Debug -DREALM_CORE_BUILDTREE=${core_directory}/build.debug ${sync_cfg_args} -DREALM_BUILD_DOGLESS=OFF ..
+                        && cd ..
+                        && ${CMAKE_COMMAND} -E make_directory build.release
+                        && cd build.release
+                        && cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -DREALM_CORE_BUILDTREE=${core_directory}/build.release ${sync_cfg_args} -DREALM_BUILD_DOGLESS=OFF ..
+
+        BUILD_COMMAND cd build.debug
+                   && cmake --build .
+                   && cd ..
+                   && cd build.release
+                   && cmake --build .
         ${USES_TERMINAL_BUILD}
         ${ARGN}
         )
-
-    if(APPLE)
-        set(platform "")
-    elseif(REALM_PLATFORM STREQUAL "Android")
-        if(ANDROID_ABI STREQUAL "armeabi-v7a")
-            set(platform "-android-arm-v7a")
-        else()
-            set(platform "-android-${ANDROID_ABI}")
-        endif()
-    endif()
-
-
     ExternalProject_Get_Property(realm-sync-lib SOURCE_DIR)
-    set(sync_directory ${SOURCE_DIR})
-    if(REALM_PLATFORM STREQUAL "Android")
-        set(sync_library_directory ${sync_directory}/android-lib)
-    else()
-        set(sync_library_directory ${sync_directory}/src/realm)
-    endif()
+    add_dependencies(realm-sync-lib realm-core)
 
-    set(sync_library_debug ${sync_library_directory}/librealm-sync${platform}-dbg.a)
-    set(sync_library_release ${sync_library_directory}/librealm-sync${platform}.a)
-    set(sync_libraries ${sync_library_debug} ${sync_library_release})
+    set(sync_debug_binary_dir "${SOURCE_DIR}/build.debug")
+    set(sync_release_binary_dir "${SOURCE_DIR}/build.release")
+    set(sync_library_debug "${sync_debug_binary_dir}/src/realm/${CMAKE_STATIC_LIBRARY_PREFIX}realm-sync-dbg${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(sync_library_release "${sync_release_binary_dir}/src/realm/${CMAKE_STATIC_LIBRARY_PREFIX}realm-sync${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(sync_server_library_debug "${sync_debug_binary_dir}/src/realm/${CMAKE_STATIC_LIBRARY_PREFIX}realm-server-dbg${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(sync_server_library_release "${sync_release_binary_dir}/src/realm/${CMAKE_STATIC_LIBRARY_PREFIX}realm-server${CMAKE_STATIC_LIBRARY_SUFFIX}")
 
     ExternalProject_Add_Step(realm-sync-lib ensure-libraries
-        BYPRODUCTS ${sync_libraries}
         DEPENDEES build
+        BYPRODUCTS ${sync_library_debug} ${sync_library_release}
+                   ${sync_server_library_debug} ${sync_server_library_release}
         )
 
+    set(sync_generated_headers_dir_debug "${sync_debug_binary_dir}/src")
+    set(sync_generated_headers_dir_release "${sync_release_binary_dir}/src")
+
     add_library(realm-sync STATIC IMPORTED)
     add_dependencies(realm-sync realm-sync-lib)
-
     set_property(TARGET realm-sync PROPERTY IMPORTED_LOCATION_DEBUG ${sync_library_debug})
     set_property(TARGET realm-sync PROPERTY IMPORTED_LOCATION_COVERAGE ${sync_library_debug})
     set_property(TARGET realm-sync PROPERTY IMPORTED_LOCATION_RELEASE ${sync_library_release})
@@ -374,52 +358,41 @@ macro(build_realm_sync)
 
     # Create directories that are included in INTERFACE_INCLUDE_DIRECTORIES, as CMake requires they exist at
     # configure time, when they'd otherwise not be created until we download and build sync.
-    file(MAKE_DIRECTORY ${sync_directory}/src)
-    set_property(TARGET realm-sync PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${sync_directory}/src)
-
-    # Sync server library is built as part of the sync library build
-    set(sync_server_library_debug ${sync_library_directory}/librealm-server${platform}-dbg.a)
-    set(sync_server_library_release ${sync_library_directory}/librealm-server${platform}.a)
-    set(sync_server_libraries ${sync_server_library_debug} ${sync_server_library_release})
+    file(MAKE_DIRECTORY "${sync_generated_headers_dir_debug}" "${sync_generated_headers_dir_release}" "${SOURCE_DIR}/src")
 
-    ExternalProject_Add_Step(realm-sync-lib ensure-server-libraries
-        BYPRODUCTS ${sync_server_libraries}
-        DEPENDEES build
-        )
+    set_property(TARGET realm-sync PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+        ${SOURCE_DIR}/src
+        $<$<CONFIG:Debug>:${sync_generated_headers_dir_debug}>
+        $<$<NOT:$<CONFIG:Debug>>:${sync_generated_headers_dir_release}>
+    )
 
     add_library(realm-sync-server STATIC IMPORTED)
-    add_dependencies(realm-sync-server realm-sync-lib)
-
+    add_dependencies(realm realm-sync)
     set_property(TARGET realm-sync-server PROPERTY IMPORTED_LOCATION_DEBUG ${sync_server_library_debug})
     set_property(TARGET realm-sync-server PROPERTY IMPORTED_LOCATION_COVERAGE ${sync_server_library_debug})
     set_property(TARGET realm-sync-server PROPERTY IMPORTED_LOCATION_RELEASE ${sync_server_library_release})
     set_property(TARGET realm-sync-server PROPERTY IMPORTED_LOCATION ${sync_server_library_release})
-
-    find_package(PkgConfig)
-    pkg_check_modules(YAML QUIET yaml-cpp)
-    set_property(TARGET realm-sync-server PROPERTY INTERFACE_LINK_LIBRARIES ${SSL_LIBRARIES} ${YAML_LDFLAGS})
 endmacro()
 
-function(build_existing_realm_sync sync_directory)
+function(build_existing_realm_sync core_directory sync_directory)
     get_filename_component(sync_directory ${sync_directory} ABSOLUTE)
-    build_realm_sync(URL ""
-                     SOURCE_DIR ${sync_directory}
-                     BUILD_ALWAYS 1
-                     )
+    build_realm_sync(
+        ${core_directory}
+        URL ""
+        SOURCE_DIR ${sync_directory}
+        BUILD_ALWAYS 1
+        )
 
 endfunction()
 
 function(clone_and_build_realm_sync branch)
+    set(core_prefix_directory "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/realm-core/src/realm-core")
     set(cmake_files ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
-    if(REALM_PLATFORM STREQUAL "Android")
-        set(config_cmd test -f src/config.mk || REALM_CORE_PREFIX=${cmake_files}/realm-core/src/realm-core REALM_FORCE_OPENSSL=YES REALM_ENABLE_ASSERTIONS= sh build.sh config && echo "ENABLE_ENCRYPTION    = yes" >> src/config.mk)
-    else()
-        set(config_cmd test -f src/config.mk || REALM_CORE_PREFIX=${cmake_files}/realm-core/src/realm-core sh build.sh config)
-    endif()
-
-    build_realm_sync(GIT_REPOSITORY "git@github.com:realm/realm-sync.git"
-                     GIT_TAG ${branch}
-                     CONFIGURE_COMMAND ${config_cmd}
-                     )
+    build_realm_sync(
+        ${core_prefix_directory}
+        GIT_REPOSITORY "git@github.com:realm/realm-sync.git"
+        GIT_TAG ${branch}
+        CONFIGURE_COMMAND ${config_cmd}
+        )
 
 endfunction()

+ 3 - 0
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/Sanitizers.cmake

@@ -22,14 +22,17 @@ option(SANITIZE_UNDEFINED "build with UBSan")
 
 if(SANITIZE_ADDRESS)
     set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=address")
+    set(CORE_SANITIZER_FLAGS ${CORE_SANITIZER_FLAGS};-D;REALM_ASAN=ON)
 endif()
 
 if(SANITIZE_THREAD)
     set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=thread")
+    set(CORE_SANITIZER_FLAGS ${CORE_SANITIZER_FLAGS};-D;REALM_TSAN=ON)
 endif()
 
 if(SANITIZE_UNDEFINED)
     set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=undefined")
+    set(CORE_SANITIZER_FLAGS ${CORE_SANITIZER_FLAGS};-D;REALM_USAN=ON)
 endif()
 
 if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_UNDEFINED)

+ 0 - 2
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMakeLists.txt

@@ -42,7 +42,5 @@ if(REALM_ENABLE_SYNC)
   add_definitions(-DREALM_ENABLE_SYNC)
 endif()
 
-set(PEGTL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/pegtl)
-
 add_subdirectory(src)
 add_subdirectory(tests)

+ 3 - 3
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/Dockerfile

@@ -17,7 +17,7 @@ ENV ANDROID_NDK_PATH /opt/android-ndk
 
 # Ensure a new enough version of CMake is available.
 RUN cd /opt \
-    && wget https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz \
-        && tar zxvf cmake-3.7.2-Linux-x86_64.tar.gz
+    && wget https://cmake.org/files/v3.15/cmake-3.15.2-Linux-x86_64.tar.gz \
+        && tar zxvf cmake-3.15.2-Linux-x86_64.tar.gz
 
-ENV PATH "/opt/cmake-3.7.2-Linux-x86_64/bin:$PATH"
+ENV PATH "/opt/cmake-3.15.2-Linux-x86_64/bin:$PATH"

+ 6 - 6
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/Jenkinsfile

@@ -46,7 +46,7 @@ if (env.BRANCH_NAME == 'master') {
   env.DOCKER_PUSH = "1"
 }
 
-def doDockerBuild(String flavor, Boolean withCoverage, Boolean enableSync) {
+def doDockerBuild(String flavor, Boolean withCoverage, Boolean enableSync, String sanitizerFlags = "") {
   def sync = enableSync ? "sync" : ""
   def label = "${flavor}${enableSync ? '-sync' : ''}"
 
@@ -59,7 +59,7 @@ def doDockerBuild(String flavor, Boolean withCoverage, Boolean enableSync) {
           if(withCoverage) {
             sh "rm -rf coverage.build ${label}.build && ./workflow/test_coverage.sh ${sync} && mv coverage.build ${label}.build"
           } else {
-            sh "./workflow/build.sh ${flavor} ${sync}"
+            sh "./workflow/build.sh ${flavor} ${sync} ${sanitizerFlags}"
           }
         }
       }
@@ -82,7 +82,7 @@ def doAndroidDockerBuild() {
             sh '''rm -rf build
               mkdir build
               cd build
-              cmake -DREALM_PLATFORM=Android -DANDROID_NDK=/opt/android-ndk -GNinja ..
+              cmake -DREALM_PLATFORM=Android -DANDROID_NDK=/opt/android-ndk -GNinja -DCMAKE_MAKE_PROGRAM=ninja ..
               ninja
               adb connect emulator
               timeout 10m adb wait-for-device
@@ -168,8 +168,10 @@ stage('prepare') {
 
 stage('unit-tests') {
   parallel(
-    linux: doDockerBuild('linux', true, false),
+    linux: doDockerBuild('linux', false, false),
     linux_sync: doDockerBuild('linux', true, true),
+    linux_asan: doDockerBuild('linux', false, true, '-DSANITIZE_ADDRESS=1'),
+    linux_tsan: doDockerBuild('linux', false, true, '-DSANITIZE_THREAD=1'),
     android: doAndroidDockerBuild(),
     macos: doBuild('osx', 'macOS', false, ''),
     macos_sync: doBuild('osx', 'macOS', true, ''),
@@ -181,9 +183,7 @@ stage('unit-tests') {
 
 stage('publish') {
   node('docker') {
-    publishReport('linux')
     publishReport('linux-sync')
-    publishReport('macOS')
     publishReport('macOS-sync')
   }
 }

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/dependencies.list

@@ -1,4 +1,4 @@
-REALM_CORE_VERSION=5.22.0
-REALM_SYNC_VERSION=4.6.1
+REALM_CORE_VERSION=5.23.5
+REALM_SYNC_VERSION=4.7.8
 ANDROID_OPENSSL_VERSION=1.0.2k
 REALM_CORE_PACKAGING=2

+ 12 - 1
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/.gitattributes

@@ -8,4 +8,15 @@
 *.hpp text
 
 # Windows specific files should retain windows line-endings
-*.sln text eol=crlf
+*.sln text eol=crlf
+
+# Keep executable scripts with LFs so they can be run after being
+# checked out on Windows
+*.py text eol=lf
+
+
+# Keep the single include header with LFs to make sure it is uploaded,
+# hashed etc with LF
+single_include/**/*.hpp eol=lf
+# Also keep the LICENCE file with LFs for the same reason
+LICENCE.txt eol=lf

+ 4 - 3
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/.gitignore

@@ -24,6 +24,7 @@ DerivedData
 *.xccheckout
 Build
 .idea
-cmake-build-debug
-cmake-build-release
-.vs
+.vs
+cmake-build-*
+benchmark-dir
+.conan/test_package/build

+ 221 - 150
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/.travis.yml

@@ -1,5 +1,16 @@
 language: cpp
-sudo: false
+
+branches:
+  except:
+  - /dev-appveyor.*/
+
+common_sources: &all_sources
+  - ubuntu-toolchain-r-test
+  - llvm-toolchain-trusty
+  - llvm-toolchain-trusty-3.9
+  - llvm-toolchain-trusty-4.0
+  - llvm-toolchain-xenial-5.0
+  - llvm-toolchain-xenial-6.0
 
 matrix:
   include:
@@ -7,262 +18,322 @@ matrix:
     # 1/ Linux Clang Builds
     - os: linux
       compiler: clang
-      addons: &clang34
+      addons:
         apt:
-          sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
-          packages: ['clang']
-      env: COMPILER='clang++' BUILD_TYPE='Release'
-
-    - os: linux
-      compiler: clang
-      addons: *clang34
-      env: COMPILER='clang++' BUILD_TYPE='Debug'
-
-    - os: linux
-      compiler: clang
-      addons: &clang35
-        apt:
-          sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test']
+          sources: *all_sources
           packages: ['clang-3.5']
-      env: COMPILER='clang++-3.5' BUILD_TYPE='Release'
-
-    - os: linux
-      compiler: clang
-      addons: *clang35
-      env: COMPILER='clang++-3.5' BUILD_TYPE='Debug'
-
+      env: COMPILER='clang++-3.5'
 
     - os: linux
       compiler: clang
-      addons: &clang36
+      addons:
         apt:
-          sources: ['llvm-toolchain-precise-3.6', 'ubuntu-toolchain-r-test']
+          sources: *all_sources
           packages: ['clang-3.6']
-      env: COMPILER='clang++-3.6' BUILD_TYPE='Release'
-
-    - os: linux
-      compiler: clang
-      addons: *clang36
-      env: COMPILER='clang++-3.6' BUILD_TYPE='Debug'
+      env: COMPILER='clang++-3.6'
 
+    # Clang 3.7 is intentionally skipped as we cannot get it easily on
+    # TravisCI container
 
     - os: linux
       compiler: clang
-      addons: &clang37
+      addons:
         apt:
-          sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test']
-          packages: ['clang-3.7']
-      env: COMPILER='clang++-3.7' BUILD_TYPE='Release'
+          sources: *all_sources
+          packages: ['lcov', 'clang-3.8']
+      env: COMPILER='clang++-3.8'
 
     - os: linux
       compiler: clang
-      addons: *clang37
-      env: COMPILER='clang++-3.7' BUILD_TYPE='Debug'
-
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-3.9']
+      env: COMPILER='clang++-3.9'
 
     - os: linux
       compiler: clang
-      addons: &clang38
-        apt:
-          sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
-          packages: ['clang-3.8']
-      env: COMPILER='clang++-3.8' BUILD_TYPE='Release'
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-4.0']
+      env: COMPILER='clang++-4.0'
 
     - os: linux
+      dist: xenial
       compiler: clang
-      addons: *clang38
-      env: COMPILER='clang++-3.8' BUILD_TYPE='Debug'
-
-
-    # 2/ Linux GCC Builds
-    - os: linux
-      compiler: gcc
-      addons: &gcc44
-        apt:
-         sources: ['ubuntu-toolchain-r-test']
-         packages: ['g++-4.4']
-      env: COMPILER='g++-4.4' BUILD_TYPE='Release'
-
-    - os: linux
-      compiler: gcc
-      addons: *gcc44
-      env: COMPILER='g++-4.4' BUILD_TYPE='Debug'
-
-
-    - os: linux
-      compiler: gcc
-      addons: &gcc47
-        apt:
-         sources: ['ubuntu-toolchain-r-test']
-         packages: ['g++-4.7']
-      env: COMPILER='g++-4.7' BUILD_TYPE='Release'
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-5.0']
+      env: COMPILER='clang++-5.0'
 
     - os: linux
-      compiler: gcc
-      addons: *gcc47
-      env: COMPILER='g++-4.7' BUILD_TYPE='Debug'
-
+      dist: xenial
+      compiler: clang
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-6.0']
+      env: COMPILER='clang++-6.0'
 
+    # 2/ Linux GCC Builds
     - os: linux
       compiler: gcc
-      addons: &gcc48
+      addons:
         apt:
-         sources: ['ubuntu-toolchain-r-test']
+         sources: *all_sources
          packages: ['g++-4.8']
-      env: COMPILER='g++-4.8' BUILD_TYPE='Release'
+      env: COMPILER='g++-4.8'
 
     - os: linux
       compiler: gcc
-      addons: *gcc48
-      env: COMPILER='g++-4.8' BUILD_TYPE='Debug'
-
-
-    - os: linux
-      compiler: gcc
-      addons: &gcc49
+      addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test']
+          sources: *all_sources
           packages: ['g++-4.9']
-      env: COMPILER='g++-4.9' BUILD_TYPE='Release'
+      env: COMPILER='g++-4.9'
 
     - os: linux
       compiler: gcc
-      addons: *gcc49
-      env: COMPILER='g++-4.9' BUILD_TYPE='Debug'
-
+      addons:
+        apt:
+          sources: *all_sources
+          packages: ['g++-5']
+      env: COMPILER='g++-5'
 
     - os: linux
       compiler: gcc
-      addons: &gcc5
+      addons: &gcc6
         apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-5']
-      env: COMPILER='g++-5' BUILD_TYPE='Release'
+          sources: *all_sources
+          packages: ['g++-6']
+      env: COMPILER='g++-6'
 
     - os: linux
       compiler: gcc
-      addons: *gcc5
-      env: COMPILER='g++-5' BUILD_TYPE='Debug'
-
+      addons: &gcc7
+        apt:
+          sources: *all_sources
+          packages: ['g++-7']
+      env: COMPILER='g++-7'
 
     - os: linux
       compiler: gcc
-      addons: &gcc6
+      addons: &gcc8
         apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-6']
-      env: COMPILER='g++-6' BUILD_TYPE='Release'
+          sources: *all_sources
+          packages: ['g++-8']
+      env: COMPILER='g++-8'
 
+    # 3b/ Linux C++14 Clang builds
+    # Note that we need newer libstdc++ for C++14 support
     - os: linux
-      compiler: gcc
-      addons: *gcc6
-      env: COMPILER='g++-6' BUILD_TYPE='Debug'
+      compiler: clang
+      addons:
+          apt:
+              packages: ['clang-3.8', 'libstdc++-6-dev']
+              sources:
+                  - ubuntu-toolchain-r-test
+                  - llvm-toolchain-trusty
+      env: COMPILER='clang++-3.8' CPP14=1
 
-    # 3a/ Linux C++11 GCC builds
     - os: linux
-      compiler: gcc
-      addons: *gcc48
-      env: COMPILER='g++-4.8' BUILD_TYPE='Release' CPP11=1
+      compiler: clang
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-3.9', 'libstdc++-6-dev']
+      env: COMPILER='clang++-3.9' CPP14=1
 
     - os: linux
-      compiler: gcc
-      addons: *gcc48
-      env: COMPILER='g++-4.8' BUILD_TYPE='Debug' CPP11=1
+      compiler: clang
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-4.0', 'libstdc++-6-dev']
+      env: COMPILER='clang++-4.0' CPP14=1
 
-    # 3b/ Linux C++11 Clang builds
     - os: linux
+      dist: xenial
       compiler: clang
-      addons: *clang38
-      env: COMPILER='clang++-3.8' BUILD_TYPE='Release' CPP11=1
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-5.0', 'libstdc++-6-dev']
+      env: COMPILER='clang++-5.0' CPP14=1
 
     - os: linux
+      dist: xenial
       compiler: clang
-      addons: *clang38
-      env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' CPP11=1
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-6.0', 'libstdc++-6-dev']
+      env: COMPILER='clang++-6.0' CPP14=1
+
 
     # 4a/ Linux C++14 GCC builds
     - os: linux
       compiler: gcc
       addons: *gcc6
-      env: COMPILER='g++-6' BUILD_TYPE='Release' CPP14=1
+      env: COMPILER='g++-6' CPP14=1
 
     - os: linux
       compiler: gcc
-      addons: *gcc6
-      env: COMPILER='g++-6' BUILD_TYPE='Debug' CPP14=1
-
-    # 4b/ Linux C++14 Clang builds
-#    - os: linux
-#      compiler: clang
-#      addons: *clang38
-#      env: COMPILER='clang++-3.8' BUILD_TYPE='Release' CPP14=1
-#
-#    - os: linux
-#      compiler: clang
-#      addons: *clang38
-#      env: COMPILER='clang++-3.8' BUILD_TYPE='Debug' CPP14=1
+      addons: *gcc7
+      env: COMPILER='g++-7' CPP14=1
 
+    - os: linux
+      compiler: gcc
+      addons: *gcc8
+      env: COMPILER='g++-8' CPP14=1
 
     # 5/ OSX Clang Builds
     - os: osx
       osx_image: xcode7.3
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Debug'
+      env: COMPILER='clang++'
 
     - os: osx
-      osx_image: xcode7.3
+      osx_image: xcode8
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Release'
+      env: COMPILER='clang++'
 
     - os: osx
-      osx_image: xcode8
+      osx_image: xcode9
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Debug'
+      env: COMPILER='clang++'
 
     - os: osx
-      osx_image: xcode8
+      osx_image: xcode9.1
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Release'
+      env: COMPILER='clang++'
 
     - os: osx
-      osx_image: xcode8
+      osx_image: xcode9.1
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Debug' USE_CPP11=1
+      env: COMPILER='clang++' CPP14=1
 
-    - os: osx
-      osx_image: xcode8
+    # 6/ Special builds -- examples, coverage, valgrind, etc.
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: *all_sources
+          packages: ['lcov', 'g++-7']
+      env: COMPILER='g++-7' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
+
+    - os: linux
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Release' USE_CPP11=1
+      addons:
+        apt:
+          packages: ['clang-3.8', 'lcov']
+          sources:
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty
+      env: COMPILER='clang++-3.8' EXAMPLES=1 COVERAGE=1 EXTRAS=1
+
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: *all_sources
+          packages: ['valgrind', 'lcov', 'g++-7']
+      env: COMPILER='g++-7' CPP14=1 VALGRIND=1
 
     - os: osx
-      osx_image: xcode8
+      osx_image: xcode9.1
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Debug' USE_CPP14=1
+      env: COMPILER='clang++' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
 
-    - os: osx
-      osx_image: xcode8
+    # 7/ C++17 builds
+    - os: linux
+      compiler: gcc
+      addons: *gcc7
+      env: COMPILER='g++-7' CPP17=1
+
+    - os: linux
+      compiler: gcc
+      addons: *gcc7
+      env: COMPILER='g++-7' EXAMPLES=1 COVERAGE=1 EXTRAS=1 CPP17=1
+
+    - os: linux
+      dist: xenial
       compiler: clang
-      env: COMPILER='clang++' BUILD_TYPE='Release' USE_CPP14=1
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-6.0', 'libstdc++-8-dev']
+      env: COMPILER='clang++-6.0' CPP17=1
 
+    - os: linux
+      dist: xenial
+      compiler: clang
+      addons:
+          apt:
+              sources: *all_sources
+              packages: ['clang-6.0', 'libstdc++-8-dev']
+      env: COMPILER='clang++-6.0' CPP17=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
+
+    # 8/ Conan
+    - language: python
+      python:
+        - "3.7"
+      dist: xenial
+      install:
+        - pip install conan-package-tools
+      env:
+        - CONAN_GCC_VERSIONS=8
+        - CONAN_DOCKER_IMAGE=conanio/gcc8
+      script:
+        - python .conan/build.py
 
 install:
   - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
   - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
   - |
     if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
-      CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
+      CMAKE_URL="http://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz"
       mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
       export PATH=${DEPS_DIR}/cmake/bin:${PATH}
     elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
-      which cmake || brew install cmake
+        which cmake || brew install cmake;
     fi
 
 before_script:
   - export CXX=${COMPILER}
   - cd ${TRAVIS_BUILD_DIR}
-  - cmake -H. -BBuild -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -Wdev -DUSE_CPP11=${CPP11} -DUSE_CPP14=${CPP14}
-  - cd Build
+  # Regenerate single header file, so it is tested in the examples...
+  - python scripts/generateSingleHeader.py
+
+  - |
+    if [[ ${CPP17} -eq 1 ]]; then
+      export CPP_STANDARD=17
+    elif [[ ${CPP14} -eq 1 ]]; then
+      export CPP_STANDARD=14
+    else
+      export CPP_STANDARD=11
+    fi
+
+    # Use Debug builds for running Valgrind and building examples
+  - cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=${EXAMPLES} -DCATCH_ENABLE_COVERAGE=${COVERAGE} -DCATCH_BUILD_EXTRA_TESTS=${EXTRAS} -DCMAKE_CXX_STANDARD=${CPP_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=On -DCMAKE_CXX_EXTENSIONS=OFF
+    # Don't bother with release build for coverage build
+  - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DCMAKE_CXX_STANDARD=${CPP_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=On -DCMAKE_CXX_EXTENSIONS=OFF
+
 
 script:
+  - cd Build-Debug
+  - make -j 2
+  - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
+    # Coverage collection does not work for OS X atm
+  - |
+    if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${COVERAGE}" == "1" ]]; then
+      make gcov
+      make lcov
+      bash <(curl -s https://codecov.io/bash) -X gcov || echo "Codecov did not collect coverage reports"
+    fi
+  - # Go to release build
+  - cd ../Build-Release
   - make -j 2
-  - ctest -V -j 2
+  - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2

+ 207 - 262
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/CMakeLists.txt

@@ -1,6 +1,33 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
+
+# detect if Catch is being bundled,
+# disable testsuite in that case
+if(NOT DEFINED PROJECT_NAME)
+  set(NOT_SUBPROJECT ON)
+endif()
+
+project(Catch2 LANGUAGES CXX VERSION 2.10.0)
+
+if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
+    message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
+endif()
+
+# Provide path for scripts
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
+
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
+include(CTest)
+
+option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
+option(CATCH_BUILD_TESTING "Build SelfTest project" ON)
+option(CATCH_BUILD_EXAMPLES "Build documentation examples" OFF)
+option(CATCH_BUILD_EXTRA_TESTS "Build extra tests" OFF)
+option(CATCH_ENABLE_COVERAGE "Generate coverage for codecov.io" OFF)
+option(CATCH_ENABLE_WERROR "Enable all warnings as errors" ON)
+option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
+option(CATCH_INSTALL_HELPERS "Install contrib alongside library" ON)
 
-project(CatchSelfTest)
 
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
@@ -10,275 +37,193 @@ set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
 set(BENCHMARK_DIR ${CATCH_DIR}/projects/Benchmark)
 set(HEADER_DIR ${CATCH_DIR}/include)
 
-if(USE_CPP11)
-    ## We can't turn this on by default, since it breaks on travis
-    message(STATUS "Enabling C++11")
-    set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
-elseif(USE_CPP14)
-    message(STATUS "Enabling C++14")
-    set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
-endif()
-
 if(USE_WMAIN)
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
 endif()
 
-#checks that the given hard-coded list contains all headers + sources in the given folder
-function(CheckFileList LIST_VAR FOLDER)
-  set(MESSAGE " should be added to the variable ${LIST_VAR}")
-  set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
-  file(GLOB GLOBBED_LIST "${FOLDER}/*.cpp"
-                         "${FOLDER}/*.hpp"
-                         "${FOLDER}/*.h")
-  list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
-  foreach(EXTRA_ITEM ${GLOBBED_LIST})
-    string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
-    message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
-  endforeach()
-endfunction()
-
-function(CheckFileListRec LIST_VAR FOLDER)
-  set(MESSAGE " should be added to the variable ${LIST_VAR}")
-  set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
-  file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp"
-                                 "${FOLDER}/*.hpp"
-                                 "${FOLDER}/*.h")
-  list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
-  foreach(EXTRA_ITEM ${GLOBBED_LIST})
-    string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
-    message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
-  endforeach()
-endfunction()
-
-# define the sources of the self test
-# Please keep these ordered alphabetically
-set(TEST_SOURCES
-        ${SELF_TEST_DIR}/ApproxTests.cpp
-        ${SELF_TEST_DIR}/BDDTests.cpp
-        ${SELF_TEST_DIR}/ClassTests.cpp
-        ${SELF_TEST_DIR}/CmdLineTests.cpp
-        ${SELF_TEST_DIR}/CompilationTests.cpp
-        ${SELF_TEST_DIR}/ConditionTests.cpp
-        ${SELF_TEST_DIR}/DecompositionTests.cpp
-        ${SELF_TEST_DIR}/EnumToString.cpp
-        ${SELF_TEST_DIR}/ExceptionTests.cpp
-        ${SELF_TEST_DIR}/GeneratorTests.cpp
-        ${SELF_TEST_DIR}/MessageTests.cpp
-        ${SELF_TEST_DIR}/MiscTests.cpp
-        ${SELF_TEST_DIR}/PartTrackerTests.cpp
-        ${SELF_TEST_DIR}/TagAliasTests.cpp
-        ${SELF_TEST_DIR}/TestMain.cpp
-        ${SELF_TEST_DIR}/ToStringGeneralTests.cpp
-        ${SELF_TEST_DIR}/ToStringPair.cpp
-        ${SELF_TEST_DIR}/ToStringTuple.cpp
-        ${SELF_TEST_DIR}/ToStringVector.cpp
-        ${SELF_TEST_DIR}/ToStringWhich.cpp
-        ${SELF_TEST_DIR}/TrickyTests.cpp
-        ${SELF_TEST_DIR}/VariadicMacrosTests.cpp
-        ${SELF_TEST_DIR}/MatchersTests.cpp
-        )
-CheckFileList(TEST_SOURCES ${SELF_TEST_DIR})
-
-# A set of impl files that just #include a single header
-# Please keep these ordered alphabetically
-set(IMPL_SOURCES
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_common.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_console_colour.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_debugger.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_capture.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_config.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_exception.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_generators.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_registry_hub.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_reporter.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_runner.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_testcase.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_message.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_option.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_ptr.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_stream.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_streambuf.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_test_spec.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_xmlwriter.cpp
-        ${SELF_TEST_DIR}/SurrogateCpps/catch_test_case_tracker.cpp
-        )
-CheckFileList(IMPL_SOURCES ${SELF_TEST_DIR}/SurrogateCpps)
-
-
-# Please keep these ordered alphabetically
-set(TOP_LEVEL_HEADERS
-        ${HEADER_DIR}/catch.hpp
-        ${HEADER_DIR}/catch_session.hpp
-        ${HEADER_DIR}/catch_with_main.hpp
-        )
-CheckFileList(TOP_LEVEL_HEADERS ${HEADER_DIR})
-
-# Please keep these ordered alphabetically
-set(EXTERNAL_HEADERS
-        ${HEADER_DIR}/external/clara.h
-        ${HEADER_DIR}/external/tbc_text_format.h
-        )
-CheckFileList(EXTERNAL_HEADERS ${HEADER_DIR}/external)
-
-
-# Please keep these ordered alphabetically
-set(INTERNAL_HEADERS
-        ${HEADER_DIR}/internal/catch_approx.hpp
-        ${HEADER_DIR}/internal/catch_assertionresult.h
-        ${HEADER_DIR}/internal/catch_assertionresult.hpp
-        ${HEADER_DIR}/internal/catch_capture.hpp
-        ${HEADER_DIR}/internal/catch_clara.h
-        ${HEADER_DIR}/internal/catch_commandline.hpp
-        ${HEADER_DIR}/internal/catch_common.h
-        ${HEADER_DIR}/internal/catch_common.hpp
-        ${HEADER_DIR}/internal/catch_compiler_capabilities.h
-        ${HEADER_DIR}/internal/catch_config.hpp
-        ${HEADER_DIR}/internal/catch_console_colour.hpp
-        ${HEADER_DIR}/internal/catch_console_colour_impl.hpp
-        ${HEADER_DIR}/internal/catch_context.h
-        ${HEADER_DIR}/internal/catch_context_impl.hpp
-        ${HEADER_DIR}/internal/catch_debugger.h
-        ${HEADER_DIR}/internal/catch_debugger.hpp
-        ${HEADER_DIR}/internal/catch_default_main.hpp
-        ${HEADER_DIR}/internal/catch_errno_guard.hpp
-        ${HEADER_DIR}/internal/catch_evaluate.hpp
-        ${HEADER_DIR}/internal/catch_exception_translator_registry.hpp
-        ${HEADER_DIR}/internal/catch_expression_lhs.hpp
-        ${HEADER_DIR}/internal/catch_fatal_condition.hpp
-        ${HEADER_DIR}/internal/catch_generators.hpp
-        ${HEADER_DIR}/internal/catch_generators_impl.hpp
-        ${HEADER_DIR}/internal/catch_impl.hpp
-        ${HEADER_DIR}/internal/catch_interfaces_capture.h
-        ${HEADER_DIR}/internal/catch_interfaces_config.h
-        ${HEADER_DIR}/internal/catch_interfaces_exception.h
-        ${HEADER_DIR}/internal/catch_interfaces_generators.h
-        ${HEADER_DIR}/internal/catch_interfaces_registry_hub.h
-        ${HEADER_DIR}/internal/catch_interfaces_reporter.h
-        ${HEADER_DIR}/internal/catch_interfaces_runner.h
-        ${HEADER_DIR}/internal/catch_interfaces_tag_alias_registry.h
-        ${HEADER_DIR}/internal/catch_interfaces_testcase.h
-        ${HEADER_DIR}/internal/catch_legacy_reporter_adapter.h
-        ${HEADER_DIR}/internal/catch_legacy_reporter_adapter.hpp
-        ${HEADER_DIR}/internal/catch_list.hpp
-        ${HEADER_DIR}/internal/catch_matchers.hpp
-        ${HEADER_DIR}/internal/catch_matchers_string.h
-        ${HEADER_DIR}/internal/catch_matchers_string.hpp
-        ${HEADER_DIR}/internal/catch_matchers_vector.h
-        ${HEADER_DIR}/internal/catch_message.h
-        ${HEADER_DIR}/internal/catch_message.hpp
-        ${HEADER_DIR}/internal/catch_notimplemented_exception.h
-        ${HEADER_DIR}/internal/catch_notimplemented_exception.hpp
-        ${HEADER_DIR}/internal/catch_objc.hpp
-        ${HEADER_DIR}/internal/catch_objc_arc.hpp
-        ${HEADER_DIR}/internal/catch_option.hpp
-        ${HEADER_DIR}/internal/catch_platform.h
-        ${HEADER_DIR}/internal/catch_ptr.hpp
-        ${HEADER_DIR}/internal/catch_reenable_warnings.h
-        ${HEADER_DIR}/internal/catch_registry_hub.hpp
-        ${HEADER_DIR}/internal/catch_reporter_registrars.hpp
-        ${HEADER_DIR}/internal/catch_reporter_registry.hpp
-        ${HEADER_DIR}/internal/catch_result_builder.h
-        ${HEADER_DIR}/internal/catch_result_builder.hpp
-        ${HEADER_DIR}/internal/catch_result_type.h
-        ${HEADER_DIR}/internal/catch_run_context.hpp
-        ${HEADER_DIR}/internal/catch_section.h
-        ${HEADER_DIR}/internal/catch_section.hpp
-        ${HEADER_DIR}/internal/catch_section_info.h
-        ${HEADER_DIR}/internal/catch_section_info.hpp
-        ${HEADER_DIR}/internal/catch_stream.h
-        ${HEADER_DIR}/internal/catch_stream.hpp
-        ${HEADER_DIR}/internal/catch_streambuf.h
-        ${HEADER_DIR}/internal/catch_suppress_warnings.h
-        ${HEADER_DIR}/internal/catch_tag_alias.h
-        ${HEADER_DIR}/internal/catch_tag_alias_registry.h
-        ${HEADER_DIR}/internal/catch_tag_alias_registry.hpp
-        ${HEADER_DIR}/internal/catch_test_case_info.h
-        ${HEADER_DIR}/internal/catch_test_case_info.hpp
-        ${HEADER_DIR}/internal/catch_test_case_registry_impl.hpp
-        ${HEADER_DIR}/internal/catch_test_case_tracker.hpp
-        ${HEADER_DIR}/internal/catch_test_registry.hpp
-        ${HEADER_DIR}/internal/catch_test_spec.hpp
-        ${HEADER_DIR}/internal/catch_test_spec_parser.hpp
-        ${HEADER_DIR}/internal/catch_text.h
-        ${HEADER_DIR}/internal/catch_timer.h
-        ${HEADER_DIR}/internal/catch_timer.hpp
-        ${HEADER_DIR}/internal/catch_tostring.h
-        ${HEADER_DIR}/internal/catch_tostring.hpp
-        ${HEADER_DIR}/internal/catch_totals.hpp
-        ${HEADER_DIR}/internal/catch_type_traits.hpp
-        ${HEADER_DIR}/internal/catch_version.h
-        ${HEADER_DIR}/internal/catch_version.hpp
-        ${HEADER_DIR}/internal/catch_wildcard_pattern.hpp
-        ${HEADER_DIR}/internal/catch_windows_h_proxy.h
-        ${HEADER_DIR}/internal/catch_xmlwriter.hpp
-        )
-CheckFileList(INTERNAL_HEADERS ${HEADER_DIR}/internal)
-
-# Please keep these ordered alphabetically
-set(REPORTER_HEADERS
-        ${HEADER_DIR}/reporters/catch_reporter_automake.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_bases.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_compact.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_console.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_junit.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_multi.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_tap.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_teamcity.hpp
-        ${HEADER_DIR}/reporters/catch_reporter_xml.hpp
-        )
-CheckFileList(REPORTER_HEADERS ${HEADER_DIR}/reporters)
-
-# Specify the headers, too, so CLion recognises them as project files
-set(HEADERS
-        ${TOP_LEVEL_HEADERS}
-        ${EXTERNAL_HEADERS}
-        ${INTERNAL_HEADERS}
-        ${REPORTER_HEADERS}
-        )
-
-
-set(BENCH_SOURCES
-        ${BENCHMARK_DIR}/BenchMain.cpp
-        ${BENCHMARK_DIR}/StringificationBench.cpp
-        )
-CheckFileList(BENCH_SOURCES ${BENCHMARK_DIR})
-
-# Provide some groupings for IDEs
-SOURCE_GROUP("Tests" FILES ${TEST_SOURCES})
-SOURCE_GROUP("Surrogates" FILES ${IMPL_SOURCES})
-SOURCE_GROUP("Benchmarks" FILES ${BENCH_SOURCES})
-
-# configure the executable
-include_directories(${HEADER_DIR})
-
-# Projects consuming Catch via ExternalProject_Add might want to use install step
-# without building all of our selftests.
-if (NOT NO_SELFTEST)
-    add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${HEADERS})
-    add_executable(Benchmark ${BENCH_SOURCES} ${HEADERS})
-
-    # Add desired warnings
-    if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
-        target_compile_options( SelfTest PRIVATE -Wall -Wextra )
-        target_compile_options( Benchmark PRIVATE -Wall -Wextra )
-    endif()
-    if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
-        target_compile_options( SelfTest PRIVATE /W4 /w44265 /WX )
-        target_compile_options( Benchmark PRIVATE /W4 )
+if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
+    find_package(PythonInterp)
+    if (NOT PYTHONINTERP_FOUND)
+        message(FATAL_ERROR "Python not found, but required for tests")
     endif()
+    add_subdirectory(projects)
+endif()
+
+if(CATCH_BUILD_EXAMPLES)
+    add_subdirectory(examples)
+endif()
+
+if(CATCH_BUILD_EXTRA_TESTS)
+    add_subdirectory(projects/ExtraTests)
+endif()
 
+# add catch as a 'linkable' target
+add_library(Catch2 INTERFACE)
+
+
+
+# depend on some obvious c++11 features so the dependency is transitively added dependents
+target_compile_features(Catch2
+  INTERFACE
+    cxx_alignas
+    cxx_alignof
+    cxx_attributes
+    cxx_auto_type
+    cxx_constexpr
+    cxx_defaulted_functions
+    cxx_deleted_functions
+    cxx_final
+    cxx_lambdas
+    cxx_noexcept
+    cxx_override
+    cxx_range_for
+    cxx_rvalue_references
+    cxx_static_assert
+    cxx_strong_enums
+    cxx_trailing_return_types
+    cxx_unicode_literals
+    cxx_user_literals
+    cxx_variadic_macros
+)
+
+target_include_directories(Catch2
+  INTERFACE
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/single_include>
+    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
+
+if (ANDROID)
+    target_link_libraries(Catch2 INTERFACE log)
+endif()
 
-    # configure unit tests via CTest
-    enable_testing()
-    add_test(NAME RunTests COMMAND SelfTest)
+# provide a namespaced alias for clients to 'link' against if catch is included as a sub-project
+add_library(Catch2::Catch2 ALIAS Catch2)
+
+# Only perform the installation steps when Catch is not being used as
+# a subproject via `add_subdirectory`, or the destinations will break,
+# see https://github.com/catchorg/Catch2/issues/1373
+if (NOT_SUBPROJECT)
+    set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
+
+    configure_package_config_file(
+        ${CMAKE_CURRENT_LIST_DIR}/CMake/Catch2Config.cmake.in
+        ${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake
+        INSTALL_DESTINATION
+          ${CATCH_CMAKE_CONFIG_DESTINATION}
+    )
+
+
+    # create and install an export set for catch target as Catch2::Catch
+    install(
+      TARGETS
+        Catch2
+      EXPORT
+        Catch2Targets
+      DESTINATION
+        ${CMAKE_INSTALL_LIBDIR}
+    )
+
+
+    install(
+      EXPORT
+        Catch2Targets
+      NAMESPACE
+        Catch2::
+      DESTINATION
+        ${CATCH_CMAKE_CONFIG_DESTINATION}
+    )
+
+    # By default, FooConfigVersion is tied to architecture that it was
+    # generated on. Because Catch2 is header-only, it is arch-independent
+    # and thus Catch2ConfigVersion should not be tied to the architecture
+    # it was generated on.
+    #
+    # CMake does not provide a direct customization point for this in
+    # `write_basic_package_version_file`, but it can be accomplished
+    # indirectly by temporarily redefining `CMAKE_SIZEOF_VOID_P` to an
+    # empty string. Note that just undefining the variable could be
+    # insufficient in cases where the variable was already in CMake cache
+    set(CATCH2_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
+    set(CMAKE_SIZEOF_VOID_P "")
+    write_basic_package_version_file(
+      "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
+      COMPATIBILITY
+        SameMajorVersion
+    )
+    set(CMAKE_SIZEOF_VOID_P ${CATCH2_CMAKE_SIZEOF_VOID_P})
+
+    install(
+      DIRECTORY
+        "single_include/"
+      DESTINATION
+        "${CMAKE_INSTALL_INCLUDEDIR}"
+    )
+
+    install(
+      FILES
+        "${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake"
+        "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
+      DESTINATION
+        ${CATCH_CMAKE_CONFIG_DESTINATION}
+    )
+
+    # Install documentation
+    if(CATCH_INSTALL_DOCS)
+      install(
+        DIRECTORY
+          docs/
+        DESTINATION
+          "${CMAKE_INSTALL_DOCDIR}"
+      )
+    endif()
 
-    add_test(NAME ListTests COMMAND SelfTest --list-tests)
-    set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
+    if(CATCH_INSTALL_HELPERS)
+    # Install CMake scripts
+    install(
+      FILES
+        "contrib/ParseAndAddCatchTests.cmake"
+        "contrib/Catch.cmake"
+        "contrib/CatchAddTests.cmake"
+      DESTINATION
+        ${CATCH_CMAKE_CONFIG_DESTINATION}
+    )
+
+    # Install debugger helpers
+    install(
+      FILES
+        "contrib/gdbinit"
+        "contrib/lldbinit"
+      DESTINATION
+        ${CMAKE_INSTALL_DATAROOTDIR}/Catch2
+    )
+    endif()
+
+    ## Provide some pkg-config integration
+    set(PKGCONFIG_INSTALL_DIR
+        "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
+        CACHE PATH "Path where catch2.pc is installed"
+    )
+    configure_file(
+      ${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2.pc.in
+      ${CMAKE_CURRENT_BINARY_DIR}/catch2.pc
+      @ONLY
+    )
+    install(
+      FILES
+        "${CMAKE_CURRENT_BINARY_DIR}/catch2.pc"
+      DESTINATION
+        ${PKGCONFIG_INSTALL_DIR}
+    )
+
+    # CPack/CMake started taking the package version from project version 3.12
+    # So we need to set the version manually for older CMake versions
+    if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
+        set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
+    endif()
 
-    add_test(NAME ListTags COMMAND SelfTest --list-tags)
-    set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
+    set(CPACK_PACKAGE_CONTACT "https://github.com/catchorg/Catch2/")
 
-endif() # !NO_SELFTEST
 
+    include( CPack )
 
-install(DIRECTORY "single_include/" DESTINATION "include/catch")
+endif(NOT_SUBPROJECT)

+ 52 - 17
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/appveyor.yml

@@ -1,10 +1,13 @@
 # version string format -- This will be overwritten later anyway
 version: "{build}"
 
+branches:
+  except:
+    - /dev-travis.+/
+
 os:
   - Visual Studio 2017
   - Visual Studio 2015
-  - Visual Studio 2013
 
 environment:
     matrix:
@@ -16,23 +19,51 @@ environment:
 
         - additional_flags: "/D_UNICODE /DUNICODE"
           wmain: 1
+          coverage: 0
+
+        # Have a coverage dimension
+        - additional_flags: ""
+          wmain: 0
+          coverage: 1
+
+        # Have an examples dimension
+        - additional_flags: ""
+          wmain: 0
+          examples: 1
+
 
 matrix:
     exclude:
-        -
-            additional_flags: "/permissive- /std:c++latest"
-            os: Visual Studio 2015
-        -
-            additional_flags: "/permissive- /std:c++latest"
-            os: Visual Studio 2013
+        - os: Visual Studio 2015
+          additional_flags: "/permissive- /std:c++latest"
 
-init:
-  - git config --global core.autocrlf input
-  # Set build version to git commit-hash
-  - ps: Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_BRANCH) - $($env:APPVEYOR_REPO_COMMIT)"
+        - os: Visual Studio 2015
+          additional_flags: "/D_UNICODE /DUNICODE"
 
-# fetch repository as zip archive
-shallow_clone: true
+        # Exclude unwanted coverage configurations
+        - coverage: 1
+          platform: Win32
+
+        - coverage: 1
+          os: Visual Studio 2015
+
+        - coverage: 1
+          configuration: Release
+
+        # Exclude unwanted examples configurations
+        - examples: 1
+          platform: Win32
+
+        - examples: 1
+          os: Visual Studio 2015
+
+        - examples: 1
+          configuration: Release
+
+
+install:
+  - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { python -m pip --disable-pip-version-check install codecov }
+  - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { .\misc\installOpenCppCoverage.ps1 }
 
 # Win32 and x64 are CMake-compatible solution platform names.
 # This allows us to pass %PLATFORM% to CMake -A.
@@ -48,14 +79,18 @@ configuration:
 #Cmake will autodetect the compiler, but we set the arch
 before_build:
   - set CXXFLAGS=%additional_flags%
-  - cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%
+  # Indirection because appveyor doesn't handle multiline batch scripts properly
+  # https://stackoverflow.com/questions/37627248/how-to-split-a-command-over-multiple-lines-in-appveyor-yml/37647169#37647169
+  # https://help.appveyor.com/discussions/questions/3888-multi-line-cmd-or-powershell-warning-ignore
+  - cmd: .\misc\appveyorBuildConfigurationScript.bat
+
 
 # build with MSBuild
 build:
-  project: Build\CatchSelfTest.sln      # path to Visual Studio solution or project
+  project: Build\Catch2.sln             # path to Visual Studio solution or project
   parallel: true                        # enable MSBuild parallel builds
   verbosity: normal                     # MSBuild verbosity level {quiet|minimal|normal|detailed}
 
 test_script:
-  - cd Build
-  - ctest -V -j 2 -C %CONFIGURATION%
+  - set CTEST_OUTPUT_ON_FAILURE=1
+  - cmd: .\misc\appveyorTestRunScript.bat

BIN
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/catch-hand-icon.png


BIN
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/catch-icon-tiny.png


BIN
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/catch-logo-small.png


+ 17 - 9
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/conanfile.py

@@ -1,19 +1,27 @@
 #!/usr/bin/env python
-from conans import ConanFile
+from conans import ConanFile, CMake
 
 
 class CatchConan(ConanFile):
-    name = "Catch"
-    version = "1.12.2"
+    name = "Catch2"
     description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD"
-    author = "philsquared"
+    topics = ("conan", "catch2", "header-only", "unit-test", "tdd", "bdd")
+    url = "https://github.com/catchorg/Catch2"
+    homepage = url
+    license = "BSL-1.0"
+    exports = "LICENSE.txt"
+    exports_sources = ("single_include/*", "CMakeLists.txt", "CMake/*", "contrib/*")
     generators = "cmake"
-    exports_sources = "single_include/*"
-    url = "https://github.com/philsquared/Catch"
-    license = "Boost Software License - Version 1.0. http://www.boost.org/LICENSE_1_0.txt"
 
     def package(self):
-        self.copy(pattern="catch.hpp", src="single_include", dst="include")
+        cmake = CMake(self)
+        cmake.definitions["BUILD_TESTING"] = "OFF"
+        cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF"
+        cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON"
+        cmake.configure(build_folder='build')
+        cmake.install()
+
+        self.copy(pattern="LICENSE.txt", dst="licenses")
 
     def package_id(self):
-            self.info.header_only()
+        self.info.header_only()

+ 60 - 20
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/contrib/ParseAndAddCatchTests.cmake

@@ -39,9 +39,24 @@
 #    PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS (Default OFF)                                      #
 #    -- causes CMake to rerun when file with tests changes so that new tests will be discovered    #
 #                                                                                                  #
+# One can also set (locally) the optional variable OptionalCatchTestLauncher to precise the way    #
+# a test should be run. For instance to use test MPI, one can write                                #
+#     set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC})                 #
+# just before calling this ParseAndAddCatchTests function                                          #
+#                                                                                                  #
+# The AdditionalCatchParameters optional variable can be used to pass extra argument to the test   #
+# command. For example, to include successful tests in the output, one can write                   #
+#     set(AdditionalCatchParameters --success)                                                     #
+#                                                                                                  #
+# After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source   #
+# file in the target is set, and contains the list of the tests extracted from that target, or     #
+# from that file. This is useful, for example to add further labels or properties to the tests.    #
+#                                                                                                  #
 #==================================================================================================#
 
-cmake_minimum_required(VERSION 2.8.8)
+if (CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
+  message(FATAL_ERROR "ParseAndAddCatchTests requires CMake 2.8.8 or newer")
+endif()
 
 option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
 option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
@@ -49,7 +64,7 @@ option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the
 option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
 option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
 
-function(PrintDebugMessage)
+function(ParseAndAddCatchTests_PrintDebugMessage)
     if(PARSE_CATCH_TESTS_VERBOSE)
             message(STATUS "ParseAndAddCatchTests: ${ARGV}")
     endif()
@@ -60,7 +75,7 @@ endfunction()
 #  - full line comments (i.e. // ... )
 # contents have been read into '${CppCode}'.
 # !keep partial line comments
-function(RemoveComments CppCode)
+function(ParseAndAddCatchTests_RemoveComments CppCode)
   string(ASCII 2 CMakeBeginBlockComment)
   string(ASCII 3 CMakeEndBlockComment)
   string(REGEX REPLACE "/\\*" "${CMakeBeginBlockComment}" ${CppCode} "${${CppCode}}")
@@ -72,24 +87,29 @@ function(RemoveComments CppCode)
 endfunction()
 
 # Worker function
-function(ParseFile SourceFile TestTarget)
+function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
+    # If SourceFile is an object library, do not scan it (as it is not a file). Exit without giving a warning about a missing file.
+    if(SourceFile MATCHES "\\\$<TARGET_OBJECTS:.+>")
+        ParseAndAddCatchTests_PrintDebugMessage("Detected OBJECT library: ${SourceFile} this will not be scanned for tests.")
+        return()
+    endif()
     # According to CMake docs EXISTS behavior is well-defined only for full paths.
     get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
     if(NOT EXISTS ${SourceFile})
         message(WARNING "Cannot find source file: ${SourceFile}")
         return()
     endif()
-    PrintDebugMessage("parsing ${SourceFile}")
+    ParseAndAddCatchTests_PrintDebugMessage("parsing ${SourceFile}")
     file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME)
 
     # Remove block and fullline comments
-    RemoveComments(Contents)
+    ParseAndAddCatchTests_RemoveComments(Contents)
 
     # Find definition of test names
     string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^\)]+\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
 
     if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
-      PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
+      ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
       set_property(
         DIRECTORY
         APPEND
@@ -104,7 +124,7 @@ function(ParseFile SourceFile TestTarget)
         # Get test type and fixture if applicable
         string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
         string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
-        string(REPLACE "${TestType}(" "" TestFixture "${TestTypeAndFixture}")
+        string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
 
         # Get string parts of test definition
         string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")
@@ -143,11 +163,13 @@ function(ParseFile SourceFile TestTarget)
             endif()
             string(REPLACE "]" ";" Tags "${Tags}")
             string(REPLACE "[" "" Tags "${Tags}")
+        else()
+          # unset tags variable from previous loop
+          unset(Tags)
         endif()
 
         list(APPEND Labels ${Tags})
 
-        list(FIND Labels "!hide" IndexOfHideLabel)
         set(HiddenTagFound OFF)
         foreach(label ${Labels})
             string(REGEX MATCH "^!hide|^\\." result ${label})
@@ -156,30 +178,48 @@ function(ParseFile SourceFile TestTarget)
                 break()
             endif(result)
         endforeach(label)
-        if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound})
-            PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
+        if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
+            ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
         else()
-            PrintDebugMessage("Adding test \"${CTestName}\"")
+            ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
             if(Labels)
-                PrintDebugMessage("Setting labels to ${Labels}")
+                ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
             endif()
 
+            # Escape commas in the test spec
+            string(REPLACE "," "\\," Name ${Name})
+
             # Add the test and set its properties
-            add_test(NAME "\"${CTestName}\"" COMMAND ${TestTarget} ${Name} ${AdditionalCatchParameters})
-            set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
-                                                    LABELS "${Labels}")
+            add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
+            # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
+            if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
+                ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
+                set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
+            else()
+                set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
+                                                        LABELS "${Labels}")
+            endif()
+            set_property(
+              TARGET ${TestTarget}
+              APPEND
+              PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
+            set_property(
+              SOURCE ${SourceFile}
+              APPEND
+              PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
         endif()
 
+
     endforeach()
 endfunction()
 
 # entry point
 function(ParseAndAddCatchTests TestTarget)
-    PrintDebugMessage("Started parsing ${TestTarget}")
+    ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
     get_target_property(SourceFiles ${TestTarget} SOURCES)
-    PrintDebugMessage("Found the following sources: ${SourceFiles}")
+    ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
     foreach(SourceFile ${SourceFiles})
-        ParseFile(${SourceFile} ${TestTarget})
+        ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
     endforeach()
-    PrintDebugMessage("Finished parsing ${TestTarget}")
+    ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
 endfunction()

+ 76 - 16
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/assertions.md

@@ -1,8 +1,16 @@
+<a id="top"></a>
 # Assertion Macros
 
+**Contents**<br>
+[Natural Expressions](#natural-expressions)<br>
+[Exceptions](#exceptions)<br>
+[Matcher expressions](#matcher-expressions)<br>
+[Thread Safety](#thread-safety)<br>
+[Expressions with commas](#expressions-with-commas)<br>
+
 Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
 
-Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxilliary macros as well. We'll describe all of these here.
+Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there is a rich set of auxiliary macros as well. We'll describe all of these here.
 
 Most of these macros come in two forms:
 
@@ -14,7 +22,7 @@ The ```CHECK``` family are equivalent but execution continues in the same test c
 * **REQUIRE(** _expression_ **)** and  
 * **CHECK(** _expression_ **)**
 
-Evaluates the expression and records the result. If an exception is thrown it is caught, reported, and counted as a failure. These are the macros you will use most of  the time
+Evaluates the expression and records the result. If an exception is thrown, it is caught, reported, and counted as a failure. These are the macros you will use most of the time.
 
 Examples:
 ```
@@ -47,37 +55,54 @@ This expression is too complex because of the `||` operator. If you want to chec
 
 When comparing floating point numbers - especially if at least one of them has been computed - great care must be taken to allow for rounding errors and inexact representations.
 
-Catch provides a way to perform tolerant comparisons of floating point values through use of a wrapper class called ```Approx```. ```Approx``` can be used on either side of a comparison expression. It overloads the comparisons operators to take a tolerance into account. Here's a simple example:
+Catch provides a way to perform tolerant comparisons of floating point values through use of a wrapper class called `Approx`. `Approx` can be used on either side of a comparison expression. It overloads the comparisons operators to take a tolerance into account. Here's a simple example:
 
-```
+```cpp
 REQUIRE( performComputation() == Approx( 2.1 ) );
 ```
 
-This way `Approx` is constructed with reasonable defaults, covering most simple cases of rounding errors. If these are insufficient, each `Approx` instance has 3 tuning knobs, that can be used to customize it for your computation.
+Catch also provides a user-defined literal for `Approx`; `_a`. It resides in
+the `Catch::literals` namespace and can be used like so:
+```cpp
+using namespace Catch::literals;
+REQUIRE( performComputation() == 2.1_a );
+```
+
+`Approx` is constructed with defaults that should cover most simple cases.
+For the more complex cases, `Approx` provides 3 customization points:
 
-* __epsilon__ - epsilon serves to set the percentage by which a result can be erroneous, before it is rejected. By default set to `std::numeric_limits<float>::epsilon()*100`.
-* __margin__ - margin serves to set the the absolute value by which a result can be erroneous before it is rejected. By default set to `0.0`.
-* __scale__ - scale serves to adjust the base for comparison used by epsilon. By default set to `1.0`.
+* __epsilon__ - epsilon serves to set the coefficient by which a result
+can differ from `Approx`'s value before it is rejected.
+_By default set to `std::numeric_limits<float>::epsilon()*100`._
+* __margin__ - margin serves to set the the absolute value by which
+a result can differ from `Approx`'s value before it is rejected.
+_By default set to `0.0`._
+* __scale__ - scale is used to change the magnitude of `Approx` for relative check.
+_By default set to `0.0`._
 
 #### epsilon example
 ```cpp
 Approx target = Approx(100).epsilon(0.01);
 100.0 == target; // Obviously true
 200.0 == target; // Obviously still false
-100.5 == target; // True, because we set target to allow up to 1% error
+100.5 == target; // True, because we set target to allow up to 1% difference
 ```
 
 #### margin example
-_Margin check is used only if the relative (epsilon and scale based) check fails._
 ```cpp
 Approx target = Approx(100).margin(5);
 100.0 == target; // Obviously true
 200.0 == target; // Obviously still false
-104.0 == target; // True, because we set target to allow absolute error up to 5
+104.0 == target; // True, because we set target to allow absolute difference of at most 5
 ```
 
 #### scale
-Scale can be useful if the computation leading to the result worked on different scale, than is used by the results (and thus expected errors are on a different scale than would be expected based on the results alone), i.e. an additional not scaling difference will be accepted, because | current - target | < eps_rel + eps_abs (while eps_rel = max(current, target) * epsilon, eps_abs = epsilon * scale) will be checked.
+Scale can be useful if the computation leading to the result worked
+on different scale than is used by the results. Since allowed difference
+between Approx's value and compared value is based primarily on Approx's value
+(the allowed difference is computed as
+`(Approx::scale + Approx::value) * epsilon`), the resulting comparison could
+need rescaling to be correct.
 
 
 ## Exceptions
@@ -95,7 +120,7 @@ Expects that an exception (of any type) is be thrown during evaluation of the ex
 * **REQUIRE_THROWS_AS(** _expression_, _exception type_ **)** and  
 * **CHECK_THROWS_AS(** _expression_, _exception type_ **)**
 
-Expects that an exception of the _specified type_ is thrown during evaluation of the expression. Note that the _exception type_ is used verbatim and you should include (const) reference.
+Expects that an exception of the _specified type_ is thrown during evaluation of the expression. Note that the _exception type_ is extended with `const&` and you should not include it yourself.
 
 * **REQUIRE_THROWS_WITH(** _expression_, _string or string matcher_ **)** and  
 * **CHECK_THROWS_WITH(** _expression_, _string or string matcher_ **)**
@@ -108,8 +133,13 @@ REQUIRE_THROWS_WITH( openThePodBayDoors(), Contains( "afraid" ) && Contains( "ca
 REQUIRE_THROWS_WITH( dismantleHal(), "My mind is going" );
 ```
 
+* **REQUIRE_THROWS_MATCHES(** _expression_, _exception type_, _matcher for given exception type_ **)** and
+* **CHECK_THROWS_MATCHES(** _expression_, _exception type_, _matcher for given exception type_ **)**
+
+Expects that exception of _exception type_ is thrown and it matches provided matcher (see the [documentation for Matchers](matchers.md#top)).
+
 
-Please note that the `THROW` family of assertions expects to be passed a single expression, not a statement or series of statements. If you want to check a more complicated sequence of operations, you can use a C++11 lambda function.
+_Please note that the `THROW` family of assertions expects to be passed a single expression, not a statement or series of statements. If you want to check a more complicated sequence of operations, you can use a C++11 lambda function._
 
 ```cpp
 REQUIRE_NOTHROW([&](){
@@ -122,9 +152,11 @@ REQUIRE_NOTHROW([&](){
 }());
 ```
 
+
+
 ## Matcher expressions
 
-To support Matchers a slightly different form is used. Matchers have [their own documentation](matchers.md).
+To support Matchers a slightly different form is used. Matchers have [their own documentation](matchers.md#top).
 
 * **REQUIRE_THAT(** _lhs_, _matcher expression_ **)** and  
 * **CHECK_THAT(** _lhs_, _matcher expression_ **)**  
@@ -136,6 +168,34 @@ Matchers can be composed using `&&`, `||` and `!` operators.
 Currently assertions in Catch are not thread safe.
 For more details, along with workarounds, see the section on [the limitations page](limitations.md#thread-safe-assertions).
 
+## Expressions with commas
+
+Because the preprocessor parses code using different rules than the
+compiler, multiple-argument assertions (e.g. `REQUIRE_THROWS_AS`) have
+problems with commas inside the provided expressions. As an example
+`REQUIRE_THROWS_AS(std::pair<int, int>(1, 2), std::invalid_argument);`
+will fail to compile, because the preprocessor sees 3 arguments provided,
+but the macro accepts only 2. There are two possible workarounds.
+
+1) Use typedef:
+```cpp
+using int_pair = std::pair<int, int>;
+REQUIRE_THROWS_AS(int_pair(1, 2), std::invalid_argument);
+```
+
+This solution is always applicable, but makes the meaning of the code
+less clear.
+
+2) Parenthesize the expression:
+```cpp
+TEST_CASE_METHOD((Fixture<int, int>), "foo", "[bar]") {
+    SUCCEED();
+}
+```
+
+This solution is not always applicable, because it might require extra
+changes on the Catch's side to work.
+
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 0 - 143
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/build-systems.md

@@ -1,143 +0,0 @@
-# CI and build system integration
-
-Build Systems may refer to low-level tools, like CMake, or larger systems that run on servers, like Jenkins or TeamCity. This page will talk about both.
-
-# Continuous Integration systems
-
-Probably the most important aspect to using Catch with a build server is the use of different reporters. Catch comes bundled with three reporters that should cover the majority of build servers out there - although adding more for better integration with some is always a possibility (currently we also offer TeamCity, TAP and Automake reporters).
-
-Two of these reporters are built in (XML and JUnit) and the third (TeamCity) is included as a separate header. It's possible that the other two may be split out in the future too - as that would make the core of Catch smaller for those that don't need them.
-
-## XML Reporter
-```-r xml``` 
-
-The XML Reporter writes in an XML format that is specific to Catch. 
-
-The advantage of this format is that it corresponds well to the way Catch works (especially the more unusual features, such as nested sections) and is a fully streaming format - that is it writes output as it goes, without having to store up all its results before it can start writing.
-
-The disadvantage is that, being specific to Catch, no existing build servers understand the format natively. It can be used as input to an XSLT transformation that could convert it to, say, HTML - although this loses the streaming advantage, of course.
-
-## JUnit Reporter
-```-r junit```
-
-The JUnit Reporter writes in an XML format that mimics the JUnit ANT schema.
-
-The advantage of this format is that the JUnit Ant schema is widely understood by most build servers and so can usually be consumed with no additional work.
-
-The disadvantage is that this schema was designed to correspond to how JUnit works - and there is a significant mismatch with how Catch works. Additionally the format is not streamable (because opening elements hold counts of failed and passing tests as attributes) - so the whole test run must complete before it can be written.
-
-## Other reporters
-Other reporters are not part of the single-header distribution and need to be downloaded and included separately. All reporters are stored in `include/reporters` directory in the git repository, and are named `catch_reporter_*.hpp`. For example, to use the TeamCity reporter you need to download `include/reporters/catch_reporter_teamcity.hpp` and include it after Catch itself.
-
-```
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
-#include "catch_reporter_teamcity.hpp"
-```
-
-### TeamCity Reporter
-```-r teamcity```
-
-The TeamCity Reporter writes TeamCity service messages to stdout. In order to be able to use this reporter an additional header must also be included.
-
-Being specific to TeamCity this is the best reporter to use with it - but it is completely unsuitable for any other purpose. It is a streaming format (it writes as it goes) - although test results don't appear in the TeamCity interface until the completion of a suite (usually the whole test run).
-
-### Automake Reporter
-```-r automake```
-
-The Automake Reporter writes out the [meta tags](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) expected by automake via `make check`.
-
-### TAP (Test Anything Protocol) Reporter
-```-r tap```
-
-Because of the incremental nature of Catch's test suites and ability to run specific tests, our implementation of TAP reporter writes out the number of tests in a suite last.
-
-# Low-level tools
-
-## CMake
-
-In general we recommend "vendoring" Catch's single-include releases inside your own repository. If you do this, the following example shows a minimal CMake project:
-```CMake
-cmake_minimum_required(VERSION 3.0)
-
-project(cmake_test)
-
-# Prepare "Catch" library for other executables
-set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/catch)
-add_library(Catch INTERFACE)
-target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
-
-# Make test executable
-set(TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
-add_executable(tests ${TEST_SOURCES})
-target_link_libraries(tests Catch)
-```
-Note that it assumes that the path to the Catch's header is `catch/catch.hpp` from the `CMakeLists.txt` file.
-
-
-You can also use the following CMake snippet to automatically fetch the entire Catch repository from github and configure it as an external project:
-```CMake
-cmake_minimum_required(VERSION 2.8.8)
-project(catch_builder CXX)
-include(ExternalProject)
-find_package(Git REQUIRED)
-
-ExternalProject_Add(
-    catch
-    PREFIX ${CMAKE_BINARY_DIR}/catch
-    GIT_REPOSITORY https://github.com/philsquared/Catch.git
-    TIMEOUT 10
-    UPDATE_COMMAND ${GIT_EXECUTABLE} pull
-    CONFIGURE_COMMAND ""
-    BUILD_COMMAND ""
-    INSTALL_COMMAND ""
-    LOG_DOWNLOAD ON
-   )
-
-# Expose required variable (CATCH_INCLUDE_DIR) to parent scope
-ExternalProject_Get_Property(catch source_dir)
-set(CATCH_INCLUDE_DIR ${source_dir}/single_include CACHE INTERNAL "Path to include folder for Catch")
-```
-
-If you put it in, e.g., `${PROJECT_SRC_DIR}/${EXT_PROJECTS_DIR}/catch/`, you can use it in your project by adding the following to your root CMake file:
-
-```CMake
-# Includes Catch in the project:
-add_subdirectory(${EXT_PROJECTS_DIR}/catch)
-include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
-enable_testing(true)  # Enables unit-testing.
-```
-
-The advantage of this approach is that you can always automatically update Catch to the latest release. The disadvantage is that it means bringing in lot more than you need.
-
-
-### Automatic test registration
-If you are also using ctest, `contrib/ParseAndAddCatchTests.cmake` is a CMake script that attempts to parse your test files and automatically register all test cases, using tags as labels. This means that these
-```cpp
-TEST_CASE("Test1", "[unit]") {
-    int a = 1;
-    int b = 2;
-    REQUIRE(a == b);
-}
-
-TEST_CASE("Test2") {
-    int a = 1;
-    int b = 2;
-    REQUIRE(a == b);
-}
-
-TEST_CASE("Test3", "[a][b][c]") {
-    int a = 1;
-    int b = 2;
-    REQUIRE(a == b);
-}
-```
-would be registered as 3 tests, `Test1`, `Test2` and `Test3`, and ctest 4 labels would be created, `a`, `b`, `c` and `unit`.
-
-### CodeCoverage module (GCOV, LCOV...)
-
-If you are using GCOV tool to get testing coverage of your code, and are not sure how to integrate it with CMake and Catch, there should be an external example over at https://github.com/fkromer/catch_cmake_coverage
-
----
-
-[Home](Readme.md)

+ 106 - 9
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/command-line.md

@@ -1,5 +1,36 @@
+<a id="top"></a>
+# Command line
+
+**Contents**<br>
+[Specifying which tests to run](#specifying-which-tests-to-run)<br>
+[Choosing a reporter to use](#choosing-a-reporter-to-use)<br>
+[Breaking into the debugger](#breaking-into-the-debugger)<br>
+[Showing results for successful tests](#showing-results-for-successful-tests)<br>
+[Aborting after a certain number of failures](#aborting-after-a-certain-number-of-failures)<br>
+[Listing available tests, tags or reporters](#listing-available-tests-tags-or-reporters)<br>
+[Sending output to a file](#sending-output-to-a-file)<br>
+[Naming a test run](#naming-a-test-run)<br>
+[Eliding assertions expected to throw](#eliding-assertions-expected-to-throw)<br>
+[Make whitespace visible](#make-whitespace-visible)<br>
+[Warnings](#warnings)<br>
+[Reporting timings](#reporting-timings)<br>
+[Load test names to run from a file](#load-test-names-to-run-from-a-file)<br>
+[Just test names](#just-test-names)<br>
+[Specify the order test cases are run](#specify-the-order-test-cases-are-run)<br>
+[Specify a seed for the Random Number Generator](#specify-a-seed-for-the-random-number-generator)<br>
+[Identify framework and version according to the libIdentify standard](#identify-framework-and-version-according-to-the-libidentify-standard)<br>
+[Wait for key before continuing](#wait-for-key-before-continuing)<br>
+[Specify the number of benchmark samples to collect](#specify-the-number-of-benchmark-samples-to-collect)<br>
+[Specify the number of resamples for bootstrapping](#specify-the-number-of-resamples-for-bootstrapping)<br>
+[Specify the confidence-interval for bootstrapping](#specify-the-confidence-interval-for-bootstrapping)<br>
+[Disable statistical analysis of collected benchmark samples](#disable-statistical-analysis-of-collected-benchmark-samples)<br>
+[Usage](#usage)<br>
+[Specify the section to run](#specify-the-section-to-run)<br>
+[Filenames as tags](#filenames-as-tags)<br>
+[Override output colouring](#override-output-colouring)<br>
+
 Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available.
-Click one of the followings links to take you straight to that option - or scroll on to browse the available options.
+Click one of the following links to take you straight to that option - or scroll on to browse the available options.
 
 <a href="#specifying-which-tests-to-run">               `    <test-spec> ...`</a><br />
 <a href="#usage">                                       `    -h, -?, --help`</a><br />
@@ -29,6 +60,11 @@ Click one of the followings links to take you straight to that option - or scrol
 <a href="#rng-seed">                                    `    --rng-seed`</a><br />
 <a href="#libidentify">                                 `    --libidentify`</a><br />
 <a href="#wait-for-keypress">                           `    --wait-for-keypress`</a><br />
+<a href="#benchmark-samples">                           `    --benchmark-samples`</a><br />
+<a href="#benchmark-resamples">                         `    --benchmark-resamples`</a><br />
+<a href="#benchmark-confidence-interval">               `    --benchmark-confidence-interval`</a><br />
+<a href="#benchmark-no-analysis">                       `    --benchmark-no-analysis`</a><br />
+<a href="#use-colour">                                  `    --use-colour`</a><br />
 
 </br>
 
@@ -50,7 +86,7 @@ Wildcards consist of the `*` character at the beginning and/or end of test case
 
 Test specs are case insensitive.
 
-If a spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion. This means that tests matching the pattern are excluded from the set - even if a prior inclusion spec included them. Subsequent inclusion specs will take precendence, however.
+If a spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion. This means that tests matching the pattern are excluded from the set - even if a prior inclusion spec included them. Subsequent inclusion specs will take precedence, however.
 Inclusions and exclusions are evaluated in left-to-right order.
 
 Test case examples:
@@ -66,7 +102,7 @@ a* ~ab* abc             Matches all tests that start with 'a', except those that
 </pre>
 
 Names within square brackets are interpreted as tags.
-A series of tags form an AND expression wheras a comma-separated sequence forms an OR expression. e.g.:
+A series of tags form an AND expression whereas a comma-separated sequence forms an OR expression. e.g.:
 
 <pre>[one][two],[three]</pre>
 This matches all tests tagged `[one]` and `[two]`, as well as all tests tagged `[three]`
@@ -94,7 +130,9 @@ The JUnit reporter is an xml format that follows the structure of the JUnit XML
 ## Breaking into the debugger
 <pre>-b, --break</pre>
 
-In some IDEs (currently XCode and Visual Studio) it is possible for Catch to break into the debugger on a test failure. This can be very helpful during debug sessions - especially when there is more than one path through a particular test.
+Under most debuggers Catch2 is capable of automatically breaking on a test
+failure. This allows the user to see the current state of the test during
+failure.
 
 <a id="showing-results-for-successful-tests"></a>
 ## Showing results for successful tests
@@ -164,9 +202,16 @@ This option transforms tabs and newline characters into ```\t``` and ```\n``` re
 ## Warnings
 <pre>-w, --warn &lt;warning name></pre>
 
-Enables reporting of warnings (only one, at time of this writing). If a warning is issued it fails the test.
+Enables reporting of suspicious test states. There are currently two
+available warnings
+
+```
+    NoAssertions   // Fail test case / leaf section if no assertions
+                   // (e.g. `REQUIRE`) is encountered.
+    NoTests        // Return non-zero exit code when no test cases were run
+                   // Also calls reporter's noMatchingTestCases method
+```
 
-The ony available warning, presently, is ```NoAssertions```. This warning fails a test case, or (leaf) section if no assertions (```REQUIRE```/ ```CHECK``` etc) are encountered.
 
 <a id="reporting-timings"></a>
 ## Reporting timings
@@ -197,7 +242,7 @@ Test cases are ordered one of three ways:
 
 
 ### decl
-Declaration order. The order the tests were originally declared in. Note that ordering between files is not guaranteed and is implementation dependent.
+Declaration order (this is the default order if no --order argument is provided). The order the tests were originally declared in. Note that ordering between files is not guaranteed and is implementation dependent.
 
 ### lex
 Lexicographically sorted. Tests are sorted, alpha-numerically, by name.
@@ -211,7 +256,7 @@ Randomly sorted. Test names are sorted using ```std::random_shuffle()```. By def
 
 Sets a seed for the random number generator using ```std::srand()```. 
 If a number is provided this is used directly as the seed so the random pattern is repeatable.
-Alternatively if the keyword ```time``` is provided then the result of calling ```std::time(0)``` is used and so the pattern becomes unpredictable.
+Alternatively if the keyword ```time``` is provided then the result of calling ```std::time(0)``` is used and so the pattern becomes unpredictable. In some cases, you might need to pass the keyword ```time``` in double quotes instead of single quotes.
 
 In either case the actual value for the seed is printed as part of Catch's output so if an issue is discovered that is sensitive to test ordering the ordering can be reproduced - even if it was originally seeded from ```std::time(0)```.
 
@@ -228,6 +273,48 @@ See [The LibIdentify repo for more information and examples](https://github.com/
 Will cause the executable to print a message and wait until the return/ enter key is pressed before continuing -
 either before running any tests, after running all tests - or both, depending on the argument.
 
+<a id="benchmark-samples"></a>
+## Specify the number of benchmark samples to collect
+<pre>--benchmark-samples &lt;# of samples&gt;</pre>
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
+
+When running benchmarks a number of "samples" is collected. This is the base data for later statistical analysis.
+Per sample a clock resolution dependent number of iterations of the user code is run, which is independent of the number of samples. Defaults to 100.
+
+<a id="benchmark-resamples"></a>
+## Specify the number of resamples for bootstrapping
+<pre>--benchmark-resamples &lt;# of resamples&gt;</pre>
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
+
+After the measurements are performed, statistical [bootstrapping] is performed
+on the samples. The number of resamples for that bootstrapping is configurable
+but defaults to 100000. Due to the bootstrapping it is possible to give
+estimates for the mean and standard deviation. The estimates come with a lower
+bound and an upper bound, and the confidence interval (which is configurable but
+defaults to 95%).
+
+ [bootstrapping]: http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29
+
+<a id="benchmark-confidence-interval"></a>
+## Specify the confidence-interval for bootstrapping
+<pre>--benchmark-confidence-interval &lt;confidence-interval&gt;</pre>
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
+
+The confidence-interval is used for statistical bootstrapping on the samples to
+calculate the upper and lower bounds of mean and standard deviation.
+Must be between 0 and 1 and defaults to 0.95.
+
+<a id="benchmark-no-analysis"></a>
+## Disable statistical analysis of collected benchmark samples
+<pre>--benchmark-no-analysis</pre>
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0.
+
+When this flag is specified no bootstrapping or any other statistical analysis is performed.
+Instead the user code is only measured and the plain mean from the samples is reported.
 
 <a id="usage"></a>
 ## Usage
@@ -287,7 +374,17 @@ filename it is found in, with any extension stripped, prefixed with the `#` char
 
 So, for example,  tests within the file `~\Dev\MyProject\Ferrets.cpp` would be tagged `[#Ferrets]`.
 
+<a id="use-colour"></a>
+## Override output colouring
+<pre>--use-colour &lt;yes|no|auto&gt;</pre>
+
+Catch colours output for terminals, but omits colouring when it detects that
+output is being sent to a pipe. This is done to avoid interfering with automated
+processing of output.
+
+`--use-colour yes` forces coloured output, `--use-colour no` disables coloured
+output. The default behaviour is `--use-colour auto`.
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 5 - 1
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/commercial-users.md

@@ -1,6 +1,7 @@
+<a id="top"></a>
 # Commercial users of Catch
 
-As well as [Open Source](opensource-users.md) users Catch is widely used within proprietary code bases too.
+As well as [Open Source](opensource-users.md#top) users Catch is widely used within proprietary code bases too.
 Many organisations like to keep this information internal, and that's fine, 
 but if you're more open it would be great if we could list the names of as
 many organisations as possible that use Catch somewhere in their codebase. 
@@ -12,5 +13,8 @@ fact then please let us know - either directly, via a PR or
 [issue](https://github.com/philsquared/Catch/issues), or on the [forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum).
  
  - Bloomberg
+ - [Bloomlife](https://bloomlife.com)
  - NASA
  - [Inscopix Inc.](https://www.inscopix.com/)
+ - [Makimo](https://makimo.pl/)
+ - [UX3D] (https://ux3d.io)

+ 186 - 64
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/configuration.md

@@ -1,26 +1,53 @@
+<a id="top"></a>
+# Compile-time configuration
+
+**Contents**<br>
+[main()/ implementation](#main-implementation)<br>
+[Reporter / Listener interfaces](#reporter--listener-interfaces)<br>
+[Prefixing Catch macros](#prefixing-catch-macros)<br>
+[Terminal colour](#terminal-colour)<br>
+[Console width](#console-width)<br>
+[stdout](#stdout)<br>
+[Fallback stringifier](#fallback-stringifier)<br>
+[Default reporter](#default-reporter)<br>
+[C++11 toggles](#c11-toggles)<br>
+[C++17 toggles](#c17-toggles)<br>
+[Other toggles](#other-toggles)<br>
+[Windows header clutter](#windows-header-clutter)<br>
+[Enabling stringification](#enabling-stringification)<br>
+[Disabling exceptions](#disabling-exceptions)<br>
+
 Catch is designed to "just work" as much as possible. For most people the only configuration needed is telling Catch which source file should host all the implementation code (```CATCH_CONFIG_MAIN```).
 
 Nonetheless there are still some occasions where finer control is needed. For these occasions Catch exposes a set of macros for configuring how it is built.
 
-#  main()/ implementation
+## main()/ implementation
 
-	CATCH_CONFIG_MAIN	// Designates this as implementation file and defines main()
-	CATCH_CONFIG_RUNNER	// Designates this as implementation file
+    CATCH_CONFIG_MAIN      // Designates this as implementation file and defines main()
+    CATCH_CONFIG_RUNNER    // Designates this as implementation file
 
 Although Catch is header only it still, internally, maintains a distinction between interface headers and headers that contain implementation. Only one source file in your test project should compile the implementation headers and this is controlled through the use of one of these macros - one of these identifiers should be defined before including Catch in *exactly one implementation file in your project*.
 
-#  Prefixing Catch macros
+## Reporter / Listener interfaces
+
+    CATCH_CONFIG_EXTERNAL_INTERFACES  // Brings in necessary headers for Reporter/Listener implementation
+
+Brings in various parts of Catch that are required for user defined Reporters and Listeners. This means that new Reporters and Listeners can be defined in this file as well as in the main file.
 
-	CATCH_CONFIG_PREFIX_ALL
+Implied by both `CATCH_CONFIG_MAIN` and `CATCH_CONFIG_RUNNER`.
+
+## Prefixing Catch macros
+
+    CATCH_CONFIG_PREFIX_ALL
 
 To keep test code clean and uncluttered Catch uses short macro names (e.g. ```TEST_CASE``` and ```REQUIRE```). Occasionally these may conflict with identifiers from platform headers or the system under test. In this case the above identifier can be defined. This will cause all the Catch user macros to be prefixed with ```CATCH_``` (e.g. ```CATCH_TEST_CASE``` and ```CATCH_REQUIRE```).
 
 
-#  Terminal colour
+## Terminal colour
 
-	CATCH_CONFIG_COLOUR_NONE	// completely disables all text colouring
-	CATCH_CONFIG_COLOUR_WINDOWS	// forces the Win32 console API to be used
-	CATCH_CONFIG_COLOUR_ANSI	// forces ANSI colour codes to be used
+    CATCH_CONFIG_COLOUR_NONE      // completely disables all text colouring
+    CATCH_CONFIG_COLOUR_WINDOWS   // forces the Win32 console API to be used
+    CATCH_CONFIG_COLOUR_ANSI      // forces ANSI colour codes to be used
 
 Yes, I am English, so I will continue to spell "colour" with a 'u'.
 
@@ -32,82 +59,106 @@ Note that when ANSI colour codes are used "unistd.h" must be includable - along
 
 Typically you should place the ```#define``` before #including "catch.hpp" in your main source file - but if you prefer you can define it for your whole project by whatever your IDE or build system provides for you to do so.
 
-#  Console width
+## Console width
 
-	CATCH_CONFIG_CONSOLE_WIDTH = x // where x is a number
+    CATCH_CONFIG_CONSOLE_WIDTH = x // where x is a number
 
 Catch formats output intended for the console to fit within a fixed number of characters. This is especially important as indentation is used extensively and uncontrolled line wraps break this.
 By default a console width of 80 is assumed but this can be controlled by defining the above identifier to be a different value.
 
-#  stdout
+## stdout
 
-	CATCH_CONFIG_NOSTDOUT
+    CATCH_CONFIG_NOSTDOUT
 
-Catch does not use ```std::cout```, ```std::cerr``` and ```std::clog``` directly but gets them from ```Catch::cout()```, ```Catch::cerr()``` and ```Catch::clog``` respectively. If the above identifier is defined these functions are left unimplemented and you must implement them yourself. Their signatures are:
+To support platforms that do not provide `std::cout`, `std::cerr` and
+`std::clog`, Catch does not usem the directly, but rather calls
+`Catch::cout`, `Catch::cerr` and `Catch::clog`. You can replace their
+implementation by defining `CATCH_CONFIG_NOSTDOUT` and implementing
+them yourself, their signatures are:
 
     std::ostream& cout();
     std::ostream& cerr();
     std::ostream& clog();
 
-This can be useful on certain platforms that do not provide the standard iostreams, such as certain embedded systems.
+[You can see an example of replacing these functions here.](
+../examples/231-Cfg-OutputStreams.cpp)
 
-# Default reporter
 
-    CATCH_CONFIG_DEFAULT_REPORTER <reporter>
+## Fallback stringifier
 
-The default reporter (reporter used when no reporters are explicitly specified) can be overriden during compilation time by using the above macro. Note that desired value of the macro is a C string and quotes have to be escaped during compilation: `clang++ test.cpp -DCATCH_CONFIG_DEFAULT_REPORTER=\"xml\"`.
+By default, when Catch's stringification machinery has to stringify
+a type that does not specialize `StringMaker`, does not overload `operator<<`,
+is not an enumeration and is not a range, it uses `"{?}"`. This can be
+overridden by defining `CATCH_CONFIG_FALLBACK_STRINGIFIER` to name of a
+function that should perform the stringification instead.
 
-# C++ conformance toggles
+All types that do not provide `StringMaker` specialization or `operator<<`
+overload will be sent to this function (this includes enums and ranges).
+The provided function must return `std::string` and must accept any type,
+e.g. via overloading.
 
-    CATCH_CONFIG_CPP11_NULLPTR                 // nullptr is supported?
-    CATCH_CONFIG_CPP11_NOEXCEPT                // noexcept is supported?
-    CATCH_CONFIG_CPP11_GENERATED_METHODS       // delete and default keywords for methods
-    CATCH_CONFIG_CPP11_IS_ENUM                 // std::is_enum is supported?
-    CATCH_CONFIG_CPP11_TUPLE                   // std::tuple is supported
-    CATCH_CONFIG_VARIADIC_MACROS               // Usually pre-C++11 compiler extensions are sufficient
-    CATCH_CONFIG_CPP11_LONG_LONG               // generates overloads for the long long type
-    CATCH_CONFIG_CPP11_OVERRIDE                // CATCH_OVERRIDE expands to override (for virtual function implementations)
-    CATCH_CONFIG_CPP11_UNIQUE_PTR              // Use std::unique_ptr instead of std::auto_ptr
-    CATCH_CONFIG_CPP11_SHUFFLE                 // Use std::shuffle instead of std::random_shuffle
-    CATCH_CONFIG_CPP11_TYPE_TRAITS             // Use std::enable_if and <type_traits>
-    CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK // Use C++11 expression SFINAE to check if class can be inserted to std::ostream
+_Note that if the provided function does not handle a type and this type
+requires to be stringified, the compilation will fail._
 
-Catch has some basic compiler detection that will attempt to select the appropriate mix of these macros. However being incomplete - and often without access to the respective compilers - this detection tends to be conservative.
-So overriding control is given to the user. If a compiler supports a feature (and Catch does not already detect it) then one or more of these may be defined to enable it (or suppress it, in some cases). If you do do this please raise an issue, specifying your compiler version (ideally with an idea of how to detect it) and stating that it has such support.
-You may also suppress any of these features by using the `_NO_` form, e.g. `CATCH_CONFIG_CPP11_NO_NULLPTR`.
 
-All C++11 support can be disabled with `CATCH_CONFIG_NO_CPP11`
+## Default reporter
 
-## `CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK`
+Catch's default reporter can be changed by defining macro
+`CATCH_CONFIG_DEFAULT_REPORTER` to string literal naming the desired
+default reporter.
 
-This flag is off by default, but allows you to resolve problems caused by types with private base class that are streamable, but the classes themselves are not. Without it, the following code will cause a compilation error:
-```cpp
-#define CATCH_CONFIG_MAIN
-#include <catch.hpp>
-struct A {};
-std::ostream &operator<< (std::ostream &o, const A &v) { return o << 0; }
+This means that defining `CATCH_CONFIG_DEFAULT_REPORTER` to `"console"`
+is equivalent with the out-of-the-box experience.
 
-struct B : private A {
-    bool operator==(int){ return true;}
-};
 
-B f ();
-std::ostream g ();
+## C++11 toggles
 
-TEST_CASE ("Error in streamable check") {
-    B x;
-    REQUIRE (x == 4);
-}
-```
+    CATCH_CONFIG_CPP11_TO_STRING // Use `std::to_string`
+
+Because we support platforms whose standard library does not contain
+`std::to_string`, it is possible to force Catch to use a workaround
+based on `std::stringstream`. On platforms other than Android,
+the default is to use `std::to_string`. On Android, the default is to
+use the `stringstream` workaround. As always, it is possible to override
+Catch's selection, by defining either `CATCH_CONFIG_CPP11_TO_STRING` or
+`CATCH_CONFIG_NO_CPP11_TO_STRING`.
+
+
+## C++17 toggles
 
-# Other toggles
+    CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS  // Use std::uncaught_exceptions instead of std::uncaught_exception
+    CATCH_CONFIG_CPP17_STRING_VIEW          // Override std::string_view support detection(Catch provides a StringMaker specialization by default)
+    CATCH_CONFIG_CPP17_VARIANT              // Override std::variant support detection (checked by CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER)
+    CATCH_CONFIG_CPP17_OPTIONAL             // Override std::optional support detection (checked by CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER)
+    CATCH_CONFIG_CPP17_BYTE                 // Override std::byte support detection (Catch provides a StringMaker specialization by default)
+
+> `CATCH_CONFIG_CPP17_STRING_VIEW` was [introduced](https://github.com/catchorg/Catch2/issues/1376) in Catch 2.4.1.
+
+Catch contains basic compiler/standard detection and attempts to use
+some C++17 features whenever appropriate. This automatic detection
+can be manually overridden in both directions, that is, a feature
+can be enabled by defining the macro in the table above, and disabled
+by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`.
+
+
+## Other toggles
 
     CATCH_CONFIG_COUNTER                    // Use __COUNTER__ to generate unique names for test cases
     CATCH_CONFIG_WINDOWS_SEH                // Enable SEH handling on Windows
     CATCH_CONFIG_FAST_COMPILE               // Sacrifices some (rather minor) features for compilation speed
+    CATCH_CONFIG_DISABLE_MATCHERS           // Do not compile Matchers in this compilation unit
     CATCH_CONFIG_POSIX_SIGNALS              // Enable handling POSIX signals
     CATCH_CONFIG_WINDOWS_CRTDBG             // Enable leak checking using Windows's CRT Debug Heap
     CATCH_CONFIG_DISABLE_STRINGIFICATION    // Disable stringifying the original expression
+    CATCH_CONFIG_DISABLE                    // Disables assertions and test case registration
+    CATCH_CONFIG_WCHAR                      // Enables use of wchart_t
+    CATCH_CONFIG_EXPERIMENTAL_REDIRECT      // Enables the new (experimental) way of capturing stdout/stderr
+    CATCH_CONFIG_ENABLE_BENCHMARKING        // Enables the integrated benchmarking features (has a significant effect on compilation speed)
+    CATCH_CONFIG_USE_ASYNC                  // Force parallel statistical processing of samples during benchmarking
+    CATCH_CONFIG_ANDROID_LOGWRITE           // Use android's logging system for debug output
+    CATCH_CONFIG_GLOBAL_NEXTAFTER           // Use nextafter{,f,l} instead of std::nextafter
+
+> [`CATCH_CONFIG_ANDROID_LOGWRITE`](https://github.com/catchorg/Catch2/issues/1743) and [`CATCH_CONFIG_GLOBAL_NEXTAFTER`](https://github.com/catchorg/Catch2/pull/1739) were introduced in Catch 2.10.0
 
 Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support.
 
@@ -115,26 +166,97 @@ Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC,
 
 `CATCH_CONFIG_WINDOWS_CRTDBG` is off by default. If enabled, Windows's CRT is used to check for memory leaks, and displays them after the tests finish running.
 
-Just as with the C++11 conformance toggles, these toggles can be disabled by using `_NO_` form of the toggle, e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`.
+`CATCH_CONFIG_WCHAR` is on by default, but can be disabled. Currently
+it is only used in support for DJGPP cross-compiler.
+
+With the exception of `CATCH_CONFIG_EXPERIMENTAL_REDIRECT`,
+these toggles can be disabled by using `_NO_` form of the toggle,
+e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`.
+
+### `CATCH_CONFIG_FAST_COMPILE`
+This compile-time flag speeds up compilation of assertion macros by ~20%,
+by disabling the generation of assertion-local try-catch blocks for
+non-exception family of assertion macros ({`REQUIRE`,`CHECK`}{``,`_FALSE`, `_THAT`}).
+This disables translation of exceptions thrown under these assertions, but
+should not lead to false negatives.
+
+`CATCH_CONFIG_FAST_COMPILE` has to be either defined, or not defined,
+in all translation units that are linked into single test binary.
+
+### `CATCH_CONFIG_DISABLE_MATCHERS`
+When `CATCH_CONFIG_DISABLE_MATCHERS` is defined, all mentions of Catch's Matchers are ifdef-ed away from the translation unit. Doing so will speed up compilation of that TU.
+
+_Note: If you define `CATCH_CONFIG_DISABLE_MATCHERS` in the same file as Catch's main is implemented, your test executable will fail to link if you use Matchers anywhere._
 
-## `CATCH_CONFIG_FAST_COMPILE`
-Defining this flag speeds up compilation of test files by ~20%, by making 2 changes:
-* The `-b` (`--break`) flag no longer makes Catch break into debugger in the same stack frame as the failed test, but rather in a stack frame *below*.
-* The `REQUIRE` family of macros (`REQUIRE`, `REQUIRE_FALSE` and `REQUIRE_THAT`) no longer uses local try-catch block. This disables exception translation, but should not lead to false negatives.
+### `CATCH_CONFIG_DISABLE_STRINGIFICATION`
+This toggle enables a workaround for VS 2017 bug. For details see [known limitations](limitations.md#visual-studio-2017----raw-string-literal-in-assert-fails-to-compile).
 
-`CATCH_CONFIG_FAST_COMPILE` has to be either defined, or not defined, in all translation units that are linked into single test binary, or the behaviour of setting `-b` flag and throwing unexpected exceptions will be unpredictable.
+### `CATCH_CONFIG_DISABLE`
+This toggle removes most of Catch from given file. This means that `TEST_CASE`s are not registered and assertions are turned into no-ops. Useful for keeping tests within implementation files (ie for functions with internal linkage), instead of in external files.
 
-## `CATCH_CONFIG_DISABLE_STRINGIFICATION`
-This toggle enables a workaround for VS 2017 bug. For details see
-[known limitations](limitations.md#visual-studio-2017----raw-string-literal-in-assert-fails-to-compile).
+This feature is considered experimental and might change at any point.
 
-# Windows header clutter
+_Inspired by Doctest's `DOCTEST_CONFIG_DISABLE`_
+
+## Windows header clutter
 
 On Windows Catch includes `windows.h`. To minimize global namespace clutter in the implementation file, it defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including it. You can control this behaviour via two macros:
 
     CATCH_CONFIG_NO_NOMINMAX            // Stops Catch from using NOMINMAX macro 
     CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN // Stops Catch from using WIN32_LEAN_AND_MEAN macro
 
+
+## Enabling stringification
+
+By default, Catch does not stringify some types from the standard library. This is done to avoid dragging in various standard library headers by default. However, Catch does contain these and can be configured to provide them, using these macros:
+
+    CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER     // Provide StringMaker specialization for std::pair
+    CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER    // Provide StringMaker specialization for std::tuple
+    CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER   // Provide StringMaker specialization for std::chrono::duration, std::chrono::timepoint
+    CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER  // Provide StringMaker specialization for std::variant, std::monostate (on C++17)
+    CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional (on C++17)
+    CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS     // Defines all of the above
+
+> `CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1380) in Catch 2.4.1.
+
+> `CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1510) in Catch 2.6.0.
+
+## Disabling exceptions
+
+> Introduced in Catch 2.4.0.
+
+By default, Catch2 uses exceptions to signal errors and to abort tests
+when an assertion from the `REQUIRE` family of assertions fails. We also
+provide an experimental support for disabling exceptions. Catch2 should
+automatically detect when it is compiled with exceptions disabled, but
+it can be forced to compile without exceptions by defining
+
+    CATCH_CONFIG_DISABLE_EXCEPTIONS
+
+Note that when using Catch2 without exceptions, there are 2 major
+limitations:
+
+1) If there is an error that would normally be signalled by an exception,
+the exception's message will instead be written to `Catch::cerr` and
+`std::terminate` will be called.
+2) If an assertion from the `REQUIRE` family of macros fails,
+`std::terminate` will be called after the active reporter returns.
+
+
+There is also a customization point for the exact behaviour of what
+happens instead of exception being thrown. To use it, define
+
+    CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER
+
+and provide a definition for this function:
+
+```cpp
+namespace Catch {
+    [[noreturn]]
+    void throw_exception(std::exception const&);
+}
+```
+
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 126 - 17
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/contributing.md

@@ -1,7 +1,15 @@
+<a id="top"></a>
 # Contributing to Catch
 
-So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for 
-additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated. 
+**Contents**<br>
+[Branches](#branches)<br>
+[Directory structure](#directory-structure)<br>
+[Testing your changes](#testing-your-changes)<br>
+[Documenting your code](#documenting-your-code)<br>
+[Code constructs to watch out for](#code-constructs-to-watch-out-for)<br>
+
+So you want to contribute something to Catch? That's great! Whether it's a bug fix, a new feature, support for
+additional compilers - or just a fix to the documentation - all contributions are very welcome and very much appreciated.
 Of course so are bug reports and other comments and questions.
 
 If you are contributing to the code base there are a few simple guidelines to keep in mind. This also includes notes to
@@ -15,7 +23,7 @@ Ongoing development is currently on _master_. At some point an integration branc
 
 ## Directory structure
 
-_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still, 
+_Users_ of Catch primarily use the single header version. _Maintainers_ should work with the full source (which is still,
 primarily, in headers). This can be found in the `include` folder. There are a set of test files, currently under
 `projects/SelfTest`. The test app can be built via CMake from the `CMakeLists.txt` file in the root, or you can generate
 project files for Visual Studio, XCode, and others (instructions in the `projects` folder). If you have access to CLion,
@@ -36,25 +44,126 @@ as these are managed by the scripts!__
 
 ## Testing your changes
 
-Obviously all changes to Catch's code should be tested. If you added new functionality, you should add tests covering and
-showcasing it. Even if you have only made changes to Catch internals (ie you implemented some performance improvements),
-you should still test your changes.
+Obviously all changes to Catch's code should be tested. If you added new
+functionality, you should add tests covering and showcasing it. Even if you have
+only made changes to Catch internals (i.e. you implemented some performance
+improvements), you should still test your changes.
+
+This means 2 things
+
+* Compiling Catch's SelfTest project:
+```
+$ cd Catch2
+$ cmake -Bdebug-build -H. -DCMAKE_BUILD_TYPE=Debug
+$ cmake --build debug-build
+```
+because code that does not compile is evidently incorrect. Obviously,
+you are not expected to have access to all the compilers and platforms
+supported by Catch2, but you should at least smoke test your changes
+on your platform. Our CI pipeline will check your PR against most of
+the supported platforms, but it takes an hour to finish -- compiling
+locally takes just a few minutes.
+
+
+* Running the tests via CTest:
+```
+$ cd debug-build
+$ ctest -j 2 --output-on-failure
+```
+If you added new tests, approval tests are very likely to fail. If they
+do not, it means that your changes weren't run as part of them. This
+_might_ be intentional, but usually is not.
+
+The approval tests compare current output of the SelfTest binary in various
+configurations against known good outputs. The reason it fails is,
+_usually_, that you've added new tests but have not yet approved the changes
+they introduce. This is done with the `scripts/approve.py` script, but
+before you do so, you need to check that the introduced changes are indeed
+intentional.
+
+
+## Documenting your code
+
+If you have added new feature to Catch2, it needs documentation, so that
+other people can use it as well. This section collects some technical
+information that you will need for updating Catch2's documentation, and
+possibly some generic advise as well.
+
+First, the technicalities:
+
+* We introduced version tags to the documentation, which show users in
+which version a specific feature was introduced. This means that newly
+written documentation should be tagged with a placeholder, that will
+be replaced with the actual version upon release. There are 2 styles
+of placeholders used through the documentation, you should pick one that
+fits your text better (if in doubt, take a look at the existing version
+tags for other features).
+  * `> [Introduced](link-to-issue-or-PR) in Catch X.Y.Z` - this
+  placeholder is usually used after a section heading
+  * `> X (Y and Z) was [introduced](link-to-issue-or-PR) in Catch X.Y.Z`
+  - this placeholder is used when you need to tag a subpart of something,
+  e.g. list
+* Crosslinks to different pages should target the `top` anchor, like this
+`[link to contributing](contributing.md#top)`.
+* If you have introduced a new document, there is a simple template you
+should use. It provides you with the top anchor mentioned above, and also
+with a backlink to the top of the documentation:
+```markdown
+<a id="top"></a>
+# Cool feature
+
+Text that explains how to use the cool feature.
+
+
+---
+
+[Home](Readme.md#top)
+```
+* For pages with more than 4 subheadings, we provide a table of contents
+(ToC) at the top of the page. Because GitHub markdown does not support
+automatic generation of ToC, it has to be handled semi-manually. Thus,
+if you've added a new subheading to some page, you should add it to the
+ToC. This can be done either manually, or by running the
+`updateDocumentToC.py` script in the `scripts/` folder.
+
+
+Now, for the generic tips:
+  * Usage examples are good
+  * Don't be afraid to introduce new pages
+  * Try to be reasonably consistent with the surrounding documentation
+
+
+
+
+## Code constructs to watch out for
+
+This section is a (sadly incomplete) listing of various constructs that
+are problematic and are not always caught by our CI infrastructure.
+
+### Naked exceptions and exceptions-related function
+
+If you are throwing an exception, it should be done via `CATCH_ERROR`
+or `CATCH_RUNTIME_ERROR` in `catch_enforce.h`. These macros will handle
+the differences between compilation with or without exceptions for you.
+However, some platforms (IAR) also have problems with exceptions-related
+functions, such as `std::current_exceptions`. We do not have IAR in our
+CI, but luckily there should not be too many reasons to use these.
+However, if you do, they should be kept behind a
+`CATCH_CONFIG_DISABLE_EXCEPTIONS` macro.
 
-This means 3 things
+### Unqualified usage of functions from C's stdlib
 
-* Compiling Catch's SelfTest project -- code that does not compile is evidently incorrect. Obviously, you are not expected to
-have access to all compilers and platforms Catch supports, Catch's CI pipeline will compile your code using supported compilers
-once you open a PR.
-* Running the SelfTest binary. There should be no unexpected failures on simple run.
-* Running Catch's approval tests. Approval tests compare current output of the SelfTest binary in various configurations against
-known good output. Catch's repository provides utility scripts `approvalTests.py` to help you with this. It needs to be passed
-the SelfTest binary compiled with your changes, like so: `$ ./scripts/approvalTests.py clang-build/SelfTest`. The output should
-be fairly self-explanatory.
+If you are using a function from C's stdlib, please include the header
+as `<cfoo>` and call the function qualified. The common knowledge that
+there is no difference is wrong, QNX and VxWorks won't compile if you
+include the header as `<cfoo>` and call the function unqualified.
 
 
+----
 
- *this document is still in-progress...*
+_This documentation will always be in-progress as new information comes
+up, but we are trying to keep it as up to date as possible._
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 11 - 9
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/event-listeners.md

@@ -1,3 +1,4 @@
+<a id="top"></a>
 # Event Listeners
 
 A `Listener` is a class you can register with Catch that will then be passed events,
@@ -12,12 +13,13 @@ so you are not forced to implement events you're not interested in.
 
 
 ## Implementing a Listener
+Simply derive a class from `Catch::TestEventListenerBase` and implement the methods you are interested in, either in
+the main source file (i.e. the one that defines `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`), or in a
+file that defines `CATCH_CONFIG_EXTERNAL_INTERFACES`.
 
-In your main source file (i.e. the one that has the `#define` for `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`),
-simply derive a class from `Catch::TestEventListenerBase` and implement the methods you are interested in.
-Then register it using `INTERNAL_CATCH_REGISTER_LISTENER`.
+Then register it using `CATCH_REGISTER_LISTENER`.
 
-For example:
+For example ([complete source code](../examples/210-Evt-EventListeners.cpp)):
 
 ```c++
 #define CATCH_CONFIG_MAIN
@@ -27,13 +29,13 @@ struct MyListener : Catch::TestEventListenerBase {
 
     using TestEventListenerBase::TestEventListenerBase; // inherit constructor
 
-    virtual void testCaseStarting( Catch::TestCaseInfo const& testInfo ) override {
+    void testCaseStarting( Catch::TestCaseInfo const& testInfo ) override {
         // Perform some setup before a test case is run
     }
     
-    virtual void testCaseEnded( Catch::TestCaseStats const& testCaseStats ) override {
+    void testCaseEnded( Catch::TestCaseStats const& testCaseStats ) override {
         // Tear-down after a test case is run
-    }    
+    }
 };
 CATCH_REGISTER_LISTENER( MyListener )
 ```
@@ -42,7 +44,7 @@ _Note that you should not use any assertion macros within a Listener!_
 
 ## Events that can be hooked
 
-The following are the methods that can be overriden in the Listener:
+The following are the methods that can be overridden in the Listener:
 
 ```c++
 // The whole test run, starting and ending
@@ -70,4 +72,4 @@ just look in the source code to see what fields are available.
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 74 - 27
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/limitations.md

@@ -1,12 +1,57 @@
+<a id="top"></a>
 # Known limitations
 
-Catch has some known limitations, that we are not planning to change. Some of these are caused by our desire to support C++98 compilers, some of these are caused by our desire to keep Catch crossplatform, some exist because their priority is seen as low compared to the development effort they would need and some other yet are compiler/runtime bugs.
+Over time, some limitations of Catch2 emerged. Some of these are due
+to implementation details that cannot be easily changed, some of these
+are due to lack of development resources on our part, and some of these
+are due to plain old 3rd party bugs.
+
+
+## Implementation limits
+### Sections nested in loops
+
+If you are using `SECTION`s inside loops, you have to create them with
+different name per loop's iteration. The recommended way to do so is to
+incorporate the loop's counter into section's name, like so:
+
+```cpp
+TEST_CASE( "Looped section" ) {
+    for (char i = '0'; i < '5'; ++i) {
+        SECTION(std::string("Looped section ") + i) {
+            SUCCEED( "Everything is OK" );
+        }
+    }
+}
+```
+
+or with a `DYNAMIC_SECTION` macro (that was made for exactly this purpose):
+
+```cpp
+TEST_CASE( "Looped section" ) {
+    for (char i = '0'; i < '5'; ++i) {
+        DYNAMIC_SECTION( "Looped section " << i) {
+            SUCCEED( "Everything is OK" );
+        }
+    }
+}
+```
+
+### Tests might be run again if last section fails
+
+If the last section in a test fails, it might be run again. This is because
+Catch2 discovers `SECTION`s dynamically, as they are about to run, and
+if the last section in test case is aborted during execution (e.g. via
+the `REQUIRE` family of macros), Catch2 does not know that there are no
+more sections in that test case and must run the test case again.
+
 
 ## Features
 This section outlines some missing features, what is their status and their possible workarounds.
 
 ### Thread safe assertions
-Because threading support in standard C++98 is limited (well, non-existent), assertion macros in Catch are not thread safe. This does not mean that you cannot use threads inside Catch's test, but that only single thread can interact with Catch's assertions and other macros.
+Catch2's assertion macros are not thread safe. This does not mean that
+you cannot use threads inside Catch's test, but that only single thread
+can interact with Catch's assertions and other macros.
 
 This means that this is ok
 ```cpp
@@ -34,8 +79,8 @@ because only one thread passes the `REQUIRE` macro and this is not
     REQUIRE(cnt == 16);
 ```
 
-
-_This limitation is highly unlikely to be lifted before Catch 2 is released._
+Because C++11 provides the necessary tools to do this, we are planning
+to remove this limitation in the future.
 
 ### Process isolation in a test
 Catch does not support running tests in isolated (forked) processes. While this might in the future, the fact that Windows does not support forking and only allows full-on process creation and the desire to keep code as similar as possible across platforms, mean that this is likely to take significant development time, that is not currently available.
@@ -81,34 +126,20 @@ with expansion:
   ""\" == ""\"
 ```
 
+### Visual Studio 2015 -- Alignment compilation error (C2718)
 
-### Visual Studio 2013 -- do-while loop withing range based for fails to compile (C2059)
-There is a known bug in Visual Studio 2013 (VC 12), that causes compilation error if range based for is followed by an assertion macro, without enclosing the block in braces. This snippet is sufficient to trigger the error
-```cpp
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
+VS 2015 has a known bug, where `declval<T>` can cause compilation error
+if `T` has alignment requirements that it cannot meet.
 
-TEST_CASE("Syntax error with VC12") {
-    for ( auto x : { 1 , 2, 3 } )
-        REQUIRE( x < 3.14 );
-}
-```
-An easy workaround is possible, use braces:
-```cpp
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
 
-TEST_CASE("No longer a syntax error with VC12") {
-    for ( auto x : { 1 , 2, 3 } ) {
-        REQUIRE( x < 3.14 );
-    }
-}
-```
+A workaround is to explicitly specialize `Catch::is_range` for given
+type (this avoids code path that uses `declval<T>` in a SFINAE context).
+
 
-### Visual Studio 2003 -- Syntax error caused by improperly expanded `__LINE__` macro
-Older version of Visual Studio can have trouble compiling Catch, not expanding the `__LINE__` macro properly when recompiling the test binary. This is caused by Edit and Continue being on.
+### Visual Studio 2015 -- Wrong line number reported in debug mode
+VS 2015 has a known bug where `__LINE__` macro can be improperly expanded under certain circumstances, while compiling multi-file project in Debug mode.
 
-A workaround is to turn off Edit and Continue when compiling the test binary.
+A workaround is to compile the binary in Release mode.
 
 ### Clang/G++ -- skipping leaf sections after an exception
 Some versions of `libc++` and `libstdc++` (or their runtimes) have a bug with `std::uncaught_exception()` getting stuck returning `true` after rethrow, even if there are no active exceptions. One such case is this snippet, which skipped the sections "a" and "b", when compiled against `libcxxrt` from master
@@ -129,3 +160,19 @@ TEST_CASE("b") {
 ```
 
 If you are seeing a problem like this, i.e. a weird test paths that trigger only under Clang with `libc++`, or only under very specific version of `libstdc++`, it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library.
+
+### Clang/G++ -- `Matches` string matcher always returns false
+This is a bug in `libstdc++-4.8`, where all matching methods from `<regex>` return false. Since `Matches` uses `<regex>` internally, if the underlying implementation does not work, it doesn't work either.
+
+Workaround: Use newer version of `libstdc++`.
+
+
+### libstdc++, `_GLIBCXX_DEBUG` macro and random ordering of tests
+
+Running a Catch2 binary compiled against libstdc++ with `_GLIBCXX_DEBUG`
+macro defined with `--order rand` will cause a debug check to trigger and
+abort the run due to self-assignment.
+[This is a known bug inside libstdc++](https://stackoverflow.com/questions/22915325/avoiding-self-assignment-in-stdshuffle/23691322)
+
+Workaround: Don't use `--order rand` when compiling against debug-enabled
+libstdc++.

+ 95 - 18
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/logging.md

@@ -1,6 +1,7 @@
+<a id="top"></a>
 # Logging macros
 
-Additional messages can be logged during a test case. Note that the messages are scoped and thus will not be reported if failure occurs in scope preceding the message declaration. An example:
+Additional messages can be logged during a test case. Note that the messages logged with `INFO` are scoped and thus will not be reported if failure occurs in scope preceding the message declaration. An example:
 
 ```cpp
 TEST_CASE("Foo") {
@@ -27,10 +28,66 @@ The number is 1
 ```
 When the last `CHECK` fails in the "Bar" test case, then only one message will be printed: `Test case start`.
 
+## Logging without local scope
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch 2.7.0.
+
+`UNSCOPED_INFO` is similar to `INFO` with two key differences:
+
+- Lifetime of an unscoped message is not tied to its own scope.
+- An unscoped message can be reported by the first following assertion only, regardless of the result of that assertion.
+
+In other words, lifetime of `UNSCOPED_INFO` is limited by the following assertion (or by the end of test case/section, whichever comes first) whereas lifetime of `INFO` is limited by its own scope.
+
+These differences make this macro useful for reporting information from helper functions or inner scopes. An example:
+
+```cpp
+void print_some_info() {
+    UNSCOPED_INFO("Info from helper");
+}
+
+TEST_CASE("Baz") {
+    print_some_info();
+    for (int i = 0; i < 2; ++i) {
+        UNSCOPED_INFO("The number is " << i);
+    }
+    CHECK(false);
+}
+
+TEST_CASE("Qux") {
+    INFO("First info");
+    UNSCOPED_INFO("First unscoped info");
+    CHECK(false);
+
+    INFO("Second info");
+    UNSCOPED_INFO("Second unscoped info");
+    CHECK(false);
+}
+```
+
+"Baz" test case prints:
+```
+Info from helper
+The number is 0
+The number is 1
+```
+
+With "Qux" test case, two messages will be printed when the first `CHECK` fails:
+```
+First info
+First unscoped info
+```
+
+"First unscoped info" message will be cleared after the first `CHECK`, while "First info" message will persist until the end of the test case. Therefore, when the second `CHECK` fails, three messages will be printed:
+```
+First info
+Second info
+Second unscoped info
+```
 
 ## Streaming macros
 
-All these macros allow heterogenous sequences of values to be streaming using the insertion operator (```<<```) in the same way that std::ostream, std::cout, etc support it.
+All these macros allow heterogeneous sequences of values to be streaming using the insertion operator (```<<```) in the same way that std::ostream, std::cout, etc support it.
 
 E.g.:
 ```c++
@@ -42,7 +99,16 @@ These macros come in three forms:
 
 **INFO(** _message expression_ **)**
 
-The message is logged to a buffer, but only reported with the next assertion that is logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops.
+The message is logged to a buffer, but only reported with next assertions that are logged. This allows you to log contextual information in case of failures which is not shown during a successful test run (for the console reporter, without -s). Messages are removed from the buffer at the end of their scope, so may be used, for example, in loops.
+
+_Note that in Catch2 2.x.x `INFO` can be used without a trailing semicolon as there is a trailing semicolon inside macro.
+This semicolon will be removed with next major version. It is highly advised to use a trailing semicolon after `INFO` macro._
+
+**UNSCOPED_INFO(** _message expression_ **)**
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch 2.7.0.
+
+Similar to `INFO`, but messages are not limited to their own scope: They are removed from the buffer after each assertion, section or test case, whichever comes first.
 
 **WARN(** _message expression_ **)**
 
@@ -56,27 +122,38 @@ The message is reported and the test case fails.
 
 AS `FAIL`, but does not abort the test
 
-## Quickly capture a variable value
+## Quickly capture value of variables or expressions
 
-**CAPTURE(** _expression_ **)**
+**CAPTURE(** _expression1_, _expression2_, ... **)**
 
-Sometimes you just want to log the name and value of a variable. While you can easily do this with the INFO macro, above, as a convenience the CAPTURE macro handles the stringising of the variable name for you (actually it works with any expression, not just variables).
+Sometimes you just want to log a value of variable, or expression. For
+convenience, we provide the `CAPTURE` macro, that can take a variable,
+or an expression, and prints out that variable/expression and its value
+at the time of capture.
 
-E.g.
-```c++
-CAPTURE( theAnswer );
+e.g. `CAPTURE( theAnswer );` will log message "theAnswer := 42", while
+```cpp
+int a = 1, b = 2, c = 3;
+CAPTURE( a, b, c, a + b, c > b, a == 1);
+```
+will log a total of 6 messages:
+```
+a := 1
+b := 2
+c := 3
+a + b := 3
+c > b := true
+a == 1 := true
 ```
 
-This would log something like:
-
-<pre>"theAnswer := 42"</pre>
-
-## Deprecated macros
-
-**SCOPED_INFO and SCOPED_CAPTURE**
+You can also capture expressions that use commas inside parentheses
+(e.g. function calls), brackets, or braces (e.g. initializers). To
+properly capture expression that contains template parameters list
+(in other words, it contains commas between angle brackets), you need
+to enclose the expression inside parentheses:
+`CAPTURE( (std::pair<int, int>{1, 2}) );`
 
-These macros are now deprecated and are just aliases for INFO and CAPTURE (which were not previously scoped).
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 102 - 15
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/matchers.md

@@ -1,3 +1,4 @@
+<a id="top"></a>
 # Matchers
 
 Matchers are an alternative way to do assertions which are easily extensible and composable.
@@ -11,11 +12,11 @@ The first argument is the thing (object or value) under test. The second part is
 which consists of either a single matcher or one or more matchers combined using `&&`, `||` or `!` operators.
 
 For example, to assert that a string ends with a certain substring:
- 
+
  ```c++
 using Catch::Matchers::EndsWith; // or Catch::EndsWith
 std::string str = getStringFromSomewhere();
-REQUIRE_THAT( str, EndsWith( "as a service" ) ); 
+REQUIRE_THAT( str, EndsWith( "as a service" ) );
  ```
 
 The matcher objects can take multiple arguments, allowing more fine tuning.
@@ -23,30 +24,116 @@ The built-in string matchers, for example, take a second argument specifying whe
 case sensitive or not:
 
 ```c++
-REQUIRE_THAT( str, EndsWith( "as a service", Catch::CaseSensitive::No ) ); 
+REQUIRE_THAT( str, EndsWith( "as a service", Catch::CaseSensitive::No ) );
  ```
 
 And matchers can be combined:
 
 ```c++
-REQUIRE_THAT( str, 
-    EndsWith( "as a service" ) || 
-    (StartsWith( "Big data" ) && !Contains( "web scale" ) ) ); 
+REQUIRE_THAT( str,
+    EndsWith( "as a service" ) ||
+    (StartsWith( "Big data" ) && !Contains( "web scale" ) ) );
 ```
 
 ## Built in matchers
-Currently Catch has some string matchers and some vector matchers. They are in the `Catch::Matchers` and `Catch` namespaces.
-The string matchers are `StartsWith`, `EndsWith`, `Contains` and `Equals`. Each of them also takes an optional second argument, that decides case sensitivity (by-default, they are case sensitive).
-The vector matchers are `Contains`, `VectorContains` and `Equals`. `VectorContains` looks for a single element in the matched vector, `Contains` looks for a set (vector) of elements inside the matched vector.
+Catch2 provides some matchers by default. They can be found in the
+`Catch::Matchers::foo` namespace and are imported into the `Catch`
+namespace as well.
+
+There are two parts to each of the built-in matchers, the matcher
+type itself and a helper function that provides template argument
+deduction when creating templated matchers. As an example, the matcher
+for checking that two instances of `std::vector` are identical is
+`EqualsMatcher<T>`, but the user is expected to use the `Equals`
+helper function instead.
+
+
+### String matchers
+The string matchers are `StartsWith`, `EndsWith`, `Contains`, `Equals` and `Matches`. The first four match a literal (sub)string against a result, while `Matches` takes and matches an ECMAScript regex. Do note that `Matches` matches the string as a whole, meaning that "abc" will not match against "abcd", but "abc.*" will.
+
+Each of the provided `std::string` matchers also takes an optional second argument, that decides case sensitivity (by-default, they are case sensitive).
+
+
+### Vector matchers
+Catch2 currently provides 5 built-in matchers that work on `std::vector`.
+These are
+
+ * `Contains` which checks whether a specified vector is present in the result
+ * `VectorContains` which checks whether a specified element is present in the result
+ * `Equals` which checks whether the result is exactly equal (order matters) to a specific vector
+ * `UnorderedEquals` which checks whether the result is equal to a specific vector under a permutation
+ * `Approx` which checks whether the result is "approx-equal" (order matters, but comparison is done via `Approx`) to a specific vector
+> Approx matcher was [introduced](https://github.com/catchorg/Catch2/issues/1499) in Catch 2.7.2.
+
+
+### Floating point matchers
+Catch2 provides 3 matchers for working with floating point numbers. These
+are `WithinAbsMatcher`, `WithinUlpsMatcher` and `WithinRelMatcher`.
+
+The `WithinAbsMatcher` matcher accepts floating point numbers that are
+within a certain distance of target. It should be constructed with the
+`WithinAbs(double target, double margin)` helper.
+
+The `WithinUlpsMatcher` matcher accepts floating point numbers that are
+within a certain number of [ULPs](https://en.wikipedia.org/wiki/Unit_in_the_last_place)
+of the target. Because ULP comparisons need to be done differently for
+`float`s and for `double`s, there are two overloads of the helpers for
+this matcher, `WithinULP(float target, int64_t ULPs)`, and
+`WithinULP(double target, int64_t ULPs)`.
+
+The `WithinRelMatcher` matcher accepts floating point numbers that are
+_approximately equal_ with the target number with some specific tolerance.
+In other words, it checks that `|lhs - rhs| <= epsilon * max(|lhs|, |rhs|)`,
+with special casing for `INFINITY` and `NaN`. There are _4_ overloads of
+the helpers for this matcher, `WithinRel(double target, double margin)`,
+`WithinRel(float target, float margin)`, `WithinRel(double target)`, and
+`WithinRel(float target)`. The latter two provide a default epsilon of
+machine epsilon * 100.
+
+> `WithinRel` matcher was introduced in Catch 2.10.0
+
+### Generic matchers
+Catch also aims to provide a set of generic matchers. Currently this set
+contains only a matcher that takes arbitrary callable predicate and applies
+it onto the provided object.
+
+Because of type inference limitations, the argument type of the predicate
+has to be provided explicitly. Example:
+```cpp
+REQUIRE_THAT("Hello olleH",
+             Predicate<std::string>(
+                 [] (std::string const& str) -> bool { return str.front() == str.back(); },
+                 "First and last character should be equal")
+);
+```
+
+The second argument is an optional description of the predicate, and is
+used only during reporting of the result.
+
+
+### Exception matchers
+Catch2 also provides an exception matcher that can be used to verify
+that an exception's message exactly matches desired string. The matcher
+is `ExceptionMessageMatcher`, and we also provide a helper function
+`Message`.
 
+The matched exception must publicly derive from `std::exception` and
+the message matching is done _exactly_, including case.
+
+> `ExceptionMessageMatcher` was introduced in Catch 2.10.0
+
+Example use:
+```cpp
+REQUIRE_THROWS_MATCHES(throwsDerivedException(),  DerivedException,  Message("DerivedException::what"));
+```
 
 ## Custom matchers
 It's easy to provide your own matchers to extend Catch or just to work with your own types.
 
-You need to provide two things: 
+You need to provide two things:
 1. A matcher class, derived from `Catch::MatcherBase<T>` - where `T` is the type being tested.
 The constructor takes and stores any arguments needed (e.g. something to compare against) and you must
-override two methods: `match()` and `describe()`. 
+override two methods: `match()` and `describe()`.
 2. A simple builder function. This is what is actually called from the test code and allows overloading.
 
 Here's an example for asserting that an integer falls within a given range
@@ -60,7 +147,7 @@ public:
     IntRange( int begin, int end ) : m_begin( begin ), m_end( end ) {}
 
     // Performs the test for this matcher
-    virtual bool match( int const& i ) const override {
+    bool match( int const& i ) const override {
         return i >= m_begin && i <= m_end;
     }
 
@@ -68,7 +155,7 @@ public:
     // include any provided data (the begin/ end in this case) and
     // be written as if it were stating a fact (in the output it will be
     // preceded by the value under test).
-    virtual std::string describe() const {
+    virtual std::string describe() const override {
         std::ostringstream ss;
         ss << "is between " << m_begin << " and " << m_end;
         return ss.str();
@@ -91,7 +178,7 @@ TEST_CASE("Integers are within a range")
 ```
 
 Running this test gives the following in the console:
- 
+
 ```
 /**/TestFile.cpp:123: FAILED:
   CHECK_THAT( 100, IsBetween( 1, 10 ) )
@@ -101,4 +188,4 @@ with expansion:
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 55 - 18
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/opensource-users.md

@@ -1,41 +1,66 @@
+<a id="top"></a>
 # Open Source projects using Catch
 
-Catch is great for open source. With its [liberal license](../LICENSE.txt) and single-header, dependency-free, distribution 
+Catch is great for open source. With its [liberal license](../LICENSE.txt) and single-header, dependency-free, distribution
 it's easy to just drop the header into your project and start writing tests - what's not to like?
 
 As a result Catch is now being used in many Open Source projects, including some quite well known ones.
 This page is an attempt to track those projects. Obviously it can never be complete.
 This effort largely relies on the maintainers of the projects themselves updating this page and submitting a PR
-(or, if you prefer contact one of the maintainers of Catch directly, use the 
+(or, if you prefer contact one of the maintainers of Catch directly, use the
 [forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum)), or raise an [issue](https://github.com/philsquared/Catch/issues) to let us know).
 Of course users of those projects might want to update this page too. That's fine - as long you're confident the project maintainers won't mind.
-If you're an Open Source project maintainer and see your project listed here but would rather it wasn't - 
+If you're an Open Source project maintainer and see your project listed here but would rather it wasn't -
 just let us know via any of the previously mentioned means - although I'm sure there won't be many who feel that way.
- 
+
 Listing a project here does not imply endorsement and the plan is to keep these ordered alphabetically to avoid an implication of relative importance.
 
 ## Libraries & Frameworks
 
+### [ApprovalTests.cpp](https://github.com/approvals/ApprovalTests.cpp)
+C++11 implementation of Approval Tests, for quick, convenient testing of legacy code.
+
 ### [Azmq](https://github.com/zeromq/azmq)
-Boost Asio style bindings for ZeroMQ
+Boost Asio style bindings for ZeroMQ.
+
+### [Cataclysm: Dark Days Ahead](https://github.com/CleverRaven/Cataclysm-DDA)
+Post-apocalyptic survival RPG.
 
 ### [ChakraCore](https://github.com/Microsoft/ChakraCore)
-The core part of the Chakra Javascript engine that powers Microsoft Edge
+The core part of the Chakra JavaScript engine that powers Microsoft Edge.
 
 ### [ChaiScript](https://github.com/ChaiScript/ChaiScript)
-A, header-only, embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques
+A, header-only, embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques.
 
 ### [Clara](https://github.com/philsquared/Clara)
 A, single-header-only, type-safe, command line parser - which also prints formatted usage strings.
 
 ### [Couchbase-lite-core](https://github.com/couchbase/couchbase-lite-core)
-The next-generation core storage and query engine for Couchbase Lite/
+The next-generation core storage and query engine for Couchbase Lite.
+
+### [cppcodec](https://github.com/tplgy/cppcodec)
+Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32.
+
+### [DtCraft](https://github.com/twhuang-uiuc/DtCraft)
+A High-performance Cluster Computing Engine.
+
+### [forest](https://github.com/xorz57/forest)
+Template Library of Tree Data Structures.
+
+### [Fuxedo](https://github.com/fuxedo/fuxedo)
+Open source Oracle Tuxedo-like XATMI middleware for C and C++.
+
+### [Inja](https://github.com/pantor/inja)
+A header-only template engine for modern C++.
 
 ### [JSON for Modern C++](https://github.com/nlohmann/json)
 A, single-header, JSON parsing library that takes advantage of what C++ has to offer.
 
+### [libcluon](https://github.com/chrberger/libcluon)
+A single-header-only library written in C++14 to glue distributed software components (UDP, TCP, shared memory) supporting natively Protobuf, LCM/ZCM, MsgPack, and JSON for dynamic message transformations in-between. 
+
 ### [MNMLSTC Core](https://github.com/mnmlstc/core)
-a small and easy to use C++11 library that adds a functionality set that will be available in C++14 and later, as well as some useful additions
+A small and easy to use C++11 library that adds a functionality set that will be available in C++14 and later, as well as some useful additions.
 
 ### [nanodbc](https://github.com/lexicalunit/nanodbc/)
 A small C++ library wrapper for the native C ODBC API.
@@ -44,22 +69,25 @@ A small C++ library wrapper for the native C ODBC API.
 A header-only framework for benchmarking small snippets of C++ code.
 
 ### [SOCI](https://github.com/SOCI/soci)
-The C++ Database Access Library
+The C++ Database Access Library.
 
 ### [polymorphic_value](https://github.com/jbcoe/polymorphic_value)
-A polymorphic value-type for C++
+A polymorphic value-type for C++.
 
 ### [Ppconsul](https://github.com/oliora/ppconsul)
-A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure
+A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure.
 
 ### [Reactive-Extensions/ RxCpp](https://github.com/Reactive-Extensions/RxCpp)
-A library of algorithms for values-distributed-in-time
+A library of algorithms for values-distributed-in-time.
+
+### [thor](https://github.com/xorz57/thor)
+Wrapper Library for CUDA.
 
 ### [TextFlowCpp](https://github.com/philsquared/textflowcpp)
-A small, single-header-only, library for wrapping and composing columns of text
+A small, single-header-only, library for wrapping and composing columns of text.
 
 ### [Trompeloeil](https://github.com/rollbear/trompeloeil)
-A thread safe header only mocking framework for C++14
+A thread-safe header-only mocking framework for C++14.
 
 ### [args](https://github.com/Taywee/args)
 A simple header-only C++ argument parser library.
@@ -73,14 +101,23 @@ ArangoDB is a native multi-model database with flexible data models for document
 Minimal, open-source and cross-platform audio tool for live music production.
 
 ### [MAME](https://github.com/mamedev/mame)
-MAME originally stood for Multiple Arcade Machine Emulator
+MAME originally stood for Multiple Arcade Machine Emulator.
 
 ### [Newsbeuter](https://github.com/akrennmair/newsbeuter)
 Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
 
+### [raspigcd](https://github.com/pantadeusz/raspigcd)
+Low level CLI app and library for execution of GCODE on Raspberry Pi without any additional microcontrolers (just RPi + Stepsticks).
+
+### [SpECTRE](https://github.com/sxs-collaboration/spectre)
+SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
+
 ### [Standardese](https://github.com/foonathan/standardese)
-Standardese aims to be a nextgen Doxygen
+Standardese aims to be a nextgen Doxygen.
+
+### [PopHead](https://github.com/SPC-Some-Polish-Coders/PopHead)
+A 2D, Zombie, RPG game which is being made on our own engine.
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 73 - 14
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/own-main.md

@@ -1,5 +1,12 @@
+<a id="top"></a>
 # Supplying main() yourself
 
+**Contents**<br>
+[Let Catch take full control of args and config](#let-catch-take-full-control-of-args-and-config)<br>
+[Amending the config](#amending-the-config)<br>
+[Adding your own command line options](#adding-your-own-command-line-options)<br>
+[Version detection](#version-detection)<br>
+
 The easiest way to use Catch is to let it supply ```main()``` for you and handle configuring itself from the command line.
 
 This is achieved by writing ```#define CATCH_CONFIG_MAIN``` before the ```#include "catch.hpp"``` in *exactly one* source file.
@@ -16,21 +23,20 @@ If you just need to have code that executes before and/ or after Catch this is t
 #define CATCH_CONFIG_RUNNER
 #include "catch.hpp"
 
-int main( int argc, char* argv[] )
-{
+int main( int argc, char* argv[] ) {
   // global setup...
 
   int result = Catch::Session().run( argc, argv );
 
   // global clean-up...
 
-  return ( result < 0xff ? result : 0xff );
+  return result;
 }
 ```
 
 ## Amending the config
 
-If you still want Catch to process the command line, but you want to programatically tweak the config, you can do so in one of two ways:
+If you still want Catch to process the command line, but you want to programmatically tweak the config, you can do so in one of two ways:
 
 ```c++
 #define CATCH_CONFIG_RUNNER
@@ -39,23 +45,24 @@ If you still want Catch to process the command line, but you want to programatic
 int main( int argc, char* argv[] )
 {
   Catch::Session session; // There must be exactly one instance
-
+ 
   // writing to session.configData() here sets defaults
   // this is the preferred way to set them
-
+    
   int returnCode = session.applyCommandLine( argc, argv );
   if( returnCode != 0 ) // Indicates a command line error
-  	return returnCode;
-
+        return returnCode;
+ 
   // writing to session.configData() or session.Config() here 
   // overrides command line args
   // only do this if you know you need to
 
   int numFailed = session.run();
-  // Note that on unices only the lower 8 bits are usually used, clamping
-  // the return value to 255 prevents false negative when some multiple
-  // of 256 tests has failed
-  return ( numFailed < 0xff ? numFailed : 0xff );
+  
+  // numFailed is clamped to 255 as some unices only use the lower 8 bits.
+  // This clamping has already been applied, so just return it here
+  // You can also do any post run clean-up here
+  return numFailed;
 }
 ```
 
@@ -65,8 +72,60 @@ To take full control of the config simply omit the call to ```applyCommandLine()
 
 ## Adding your own command line options
 
-Catch embeds a powerful command line parser which you can also use to parse your own options out. This capability is still in active development but will be documented here when it is ready.
+Catch embeds a powerful command line parser called [Clara](https://github.com/philsquared/Clara). 
+As of Catch2 (and Clara 1.0) Clara allows you to write _composable_ option and argument parsers, 
+so extending Catch's own command line options is now easy.
+
+```c++
+#define CATCH_CONFIG_RUNNER
+#include "catch.hpp"
+
+int main( int argc, char* argv[] )
+{
+  Catch::Session session; // There must be exactly one instance
+  
+  int height = 0; // Some user variable you want to be able to set
+  
+  // Build a new parser on top of Catch's
+  using namespace Catch::clara;
+  auto cli 
+    = session.cli() // Get Catch's composite command line parser
+    | Opt( height, "height" ) // bind variable to a new option, with a hint string
+        ["-g"]["--height"]    // the option names it will respond to
+        ("how high?");        // description string for the help output
+        
+  // Now pass the new composite back to Catch so it uses that
+  session.cli( cli ); 
+  
+  // Let Catch (using Clara) parse the command line
+  int returnCode = session.applyCommandLine( argc, argv );
+  if( returnCode != 0 ) // Indicates a command line error
+      return returnCode;
+
+  // if set on the command line then 'height' is now set at this point
+  if( height > 0 )
+      std::cout << "height: " << height << std::endl;
+
+  return session.run();
+}
+```
+
+See the [Clara documentation](https://github.com/philsquared/Clara/blob/master/README.md) for more details.
+
+
+## Version detection
+
+Catch provides a triplet of macros providing the header's version, 
+
+* `CATCH_VERSION_MAJOR`
+* `CATCH_VERSION_MINOR`
+* `CATCH_VERSION_PATCH`
+
+these macros expand into a single number, that corresponds to the appropriate
+part of the version. As an example, given single header version v2.3.4,
+the macros would expand into `2`, `3`, and `4` respectively.
+
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 737 - 96
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/release-notes.md

@@ -1,27 +1,682 @@
-# 1.12.2
+<a id="top"></a>
+
+# Release notes
+**Contents**<br>
+[2.10.0](#2100)<br>
+[2.9.2](#292)<br>
+[2.9.1](#291)<br>
+[2.9.0](#290)<br>
+[2.8.0](#280)<br>
+[2.7.2](#272)<br>
+[2.7.1](#271)<br>
+[2.7.0](#270)<br>
+[2.6.1](#261)<br>
+[2.6.0](#260)<br>
+[2.5.0](#250)<br>
+[2.4.2](#242)<br>
+[2.4.1](#241)<br>
+[2.4.0](#240)<br>
+[2.3.0](#230)<br>
+[2.2.3](#223)<br>
+[2.2.2](#222)<br>
+[2.2.1](#221)<br>
+[2.2.0](#220)<br>
+[2.1.2](#212)<br>
+[2.1.1](#211)<br>
+[2.1.0](#210)<br>
+[2.0.1](#201)<br>
+[Older versions](#older-versions)<br>
+[Even Older versions](#even-older-versions)<br>
+
+
+
+## 2.10.0
+
 ### Fixes
-* Fixed missing <cassert> include
+* `TEMPLATE_LIST_TEST_CASE` now properly handles non-copyable and non-movable types (#1729)
+* Fixed compilation error on Solaris caused by a system header defining macro `TT` (#1722, #1723)
+* `REGISTER_ENUM` will now fail at compilation time if the registered enum is too large
+* Removed use of `std::is_same_v` in C++17 mode (#1757)
+* Fixed parsing of escaped special characters when reading test specs from a file (#1767, #1769)
+
 
-# 1.12.1
+### Improvements
+* Trailing and leading whitespace in test/section specs are now ignored.
+* Writing to Android debug log now uses `__android_log_write` instead of `__android_log_print`
+* Android logging support can now be turned on/off at compile time (#1743)
+  * The toggle is `CATCH_CONFIG_ANDROID_LOGWRITE`
+* Added a generator that returns elements of a range
+  * Use via `from_range(from, to)` or `from_range(container)`
+* Added support for CRTs that do not provide `std::nextafter` (#1739)
+  * They must still provide global `nextafter{f,l,}`
+  * Enabled via `CATCH_CONFIG_GLOBAL_NEXTAFTER`
+* Special cased `Approx(inf)` not to match non-infinite values
+  * Very strictly speaking this might be a breaking change, but it should match user expectations better
+* The output of benchmarking through the Console reporter when `--benchmark-no-analysis` is set is now much simpler (#1768)
+* Added a matcher that can be used for checking an exceptions message (#1649, #1728)
+  * The matcher helper function is called `Message`
+  * The exception must publicly derive from `std::exception`
+  * The matching is done exactly, including case and whitespace
+* Added a matcher that can be used for checking relative equality of floating point numbers (#1746)
+  * Unlike `Approx`, it considers both sides when determining the allowed margin
+  * Special cases `NaN` and `INFINITY` to match user expectations
+  * The matcher helper function is called `WithinRel`
+* The ULP matcher now allows for any possible distance between the two numbers
+* The random number generators now use Catch-global instance of RNG (#1734, #1736)
+  * This means that nested random number generators actually generate different numbers
+
+
+### Miscellaneous
+* In-repo PNGs have been optimized to lower overhead of using Catch2 via git clone
+* Catch2 now uses its own implementation of the URBG concept
+  * In the future we also plan to use our own implementation of the distributions from `<random>` to provide cross-platform repeatability of random results
+
+
+
+## 2.9.2
 
 ### Fixes
-* Fixed deprecation warning in `ScopedMessage::~ScopedMessage`
-* All uses of `min` or `max` identifiers are now wrapped in parentheses
-  * This avoids problems when Windows headers define `min` and `max` macros
+* `ChunkGenerator` can now be used with chunks of size 0 (#1671)
+* Nested subsections are now run properly when specific section is run via the `-c` argument (#1670, #1673)
+* Catch2 now consistently uses `_WIN32` to detect Windows platform (#1676)
+* `TEMPLATE_LIST_TEST_CASE` now support non-default constructible type lists (#1697)
+* Fixed a crash in the XMLReporter when a benchmark throws exception during warmup (#1706)
+* Fixed a possible infinite loop in CompactReporter (#1715)
+* Fixed `-w NoTests` returning 0 even when no tests were matched (#1449, #1683, #1684)
+* Fixed matcher compilation under Obj-C++ (#1661)
+
+### Improvements
+* `RepeatGenerator` and `FixedValuesGenerator` now fail to compile when used with `bool` (#1692)
+  * Previously they would fail at runtime.
+* Catch2 now supports Android's debug logging for its debug output (#1710)
+* Catch2 now detects and configures itself for the RTX platform (#1693)
+  * You still need to pass `--benchmark-no-analysis` if you are using benchmarking under RTX
+* Removed a "storage class is not first" warning when compiling Catch2 with PGI compiler (#1717)
+
+### Miscellaneous
+* Documentation now contains indication when a specific feature was introduced (#1695)
+  * These start with Catch2 v2.3.0, (a bit over a year ago).
+  * `docs/contributing.md` has been updated to provide contributors guidance on how to add these to newly written documentation
+* Various other documentation improvements
+  * ToC fixes
+  * Documented `--order` and `--rng-seed` command line options
+  * Benchmarking documentation now clearly states that it requires opt-in
+  * Documented `CATCH_CONFIG_CPP17_OPTIONAL` and `CATCH_CONFIG_CPP17_BYTE` macros
+  * Properly documented built-in vector matchers
+  * Improved `*_THROWS_MATCHES` documentation a bit
+* CMake config file is now arch-independent even if `CMAKE_SIZEOF_VOID_P` is in CMake cache (#1660)
+* `CatchAddTests` now properly escapes `[` and `]` in test names (#1634, #1698)
+* Reverted `CatchAddTests` adding tags as CTest labels (#1658)
+  * The script broke when test names were too long
+  * Overwriting `LABELS` caused trouble for users who set them manually
+  * CMake does not let users append to `LABELS` if the test name has spaces
+
+
+## 2.9.1
+
+### Fixes
+* Fix benchmarking compilation failure in files without `CATCH_CONFIG_EXTERNAL_INTERFACES` (or implementation)
+
+## 2.9.0
+
+### Improvements
+* The experimental benchmarking support has been replaced by integrating Nonius code (#1616)
+  * This provides a much more featurefull micro-benchmarking support.
+  * Due to the compilation cost, it is disabled by default. See the documentation for details.
+  * As far as backwards compatibility is concerned, this feature is still considered experimental in that we might change the interface based on user feedback.
+* `WithinULP` matcher now shows the acceptable range (#1581)
+* Template test cases now support type lists (#1627)
+
+
+## 2.8.0
+
+### Improvements
+* Templated test cases no longer check whether the provided types are unique (#1628)
+  * This allows you to e.g. test over `uint32_t`, `uint64_t`, and `size_t` without compilation failing
+* The precision of floating point stringification can be modified by user (#1612, #1614)
+* We now provide `REGISTER_ENUM` convenience macro for generating `StringMaker` specializations for enums
+  * See the "String conversion" documentation for details
+* Added new set of macros for template test cases that enables the use of NTTPs (#1531, #1609)
+  * See "Test cases and sections" documentation for details
+
+### Fixes
+* `UNSCOPED_INFO` macro now has a prefixed/disabled/prefixed+disabled versions (#1611)
+* Reporting errors at startup should no longer cause a segfault under certain circumstances (#1626)
+
+
+### Miscellaneous
+* CMake will now prevent you from attempting in-tree build (#1636, #1638)
+  * Previously it would break with an obscure error message during the build step
+
+
+## 2.7.2
+
+### Improvements
+* Added an approximate vector matcher (#1499)
+
+### Fixes
+* Filters will no longer be shown if there were none
+* Fixed compilation error when using Homebrew GCC on OS X (#1588, #1589)
+* Fixed the console reporter not showing messages that start with a newline (#1455, #1470)
+* Modified JUnit reporter's output so that rng seed and filters are reported according to the JUnit schema (#1598)
+* Fixed some obscure warnings and static analysis passes
+
+### Miscellaneous
+* Various improvements to `ParseAndAddCatchTests` (#1559, #1601)
+  * When a target is parsed, it receives `ParseAndAddCatchTests_TESTS` property which summarizes found tests
+  * Fixed problem with tests not being found if the `OptionalCatchTestLauncher` variables is used
+  * Including the script will no longer forcefully modify `CMAKE_MINIMUM_REQUIRED_VERSION`
+  * CMake object libraries are ignored when parsing to avoid needless warnings
+* `CatchAddTests` now adds test's tags to their CTest labels (#1600)
+* Added basic CPack support to our build
+
+## 2.7.1
+
+### Improvements
+* Reporters now print out the filters applied to test cases (#1550, #1585)
+* Added `GENERATE_COPY` and `GENERATE_REF` macros that can use variables inside the generator expression
+  * Because of the significant danger of lifetime issues, the default `GENERATE` macro still does not allow variables
+* The `map` generator helper now deduces the mapped return type (#1576)
+
+### Fixes
+* Fixed ObjC++ compilation (#1571)
+* Fixed test tag parsing so that `[.foo]` is now parsed as `[.][foo]`.
+* Suppressed warning caused by the Windows headers defining SE codes in different manners (#1575)
+
+## 2.7.0
+
+### Improvements
+* `TEMPLATE_PRODUCT_TEST_CASE` now uses the resulting type in the name, instead of the serial number (#1544)
+* Catch2's single header is now strictly ASCII (#1542)
+* Added generator for random integral/floating point types
+  * The types are inferred within the `random` helper
+* Added back RangeGenerator (#1526)
+  * RangeGenerator returns elements within a certain range
+* Added ChunkGenerator generic transform (#1538)
+  * A ChunkGenerator returns the elements from different generator in chunks of n elements
+* Added `UNSCOPED_INFO` (#415, #983, #1522)
+  * This is a variant of `INFO` that lives until next assertion/end of the test case.
+
+
+### Fixes
+* All calls to C stdlib functions are now `std::` qualified (#1541)
+  * Code brought in from Clara was also updated.
+* Running tests will no longer open the specified output file twice (#1545)
+  * This would cause trouble when the file was not a file, but rather a named pipe
+  * Fixes the CLion/Resharper integration with Catch
+* Fixed `-Wunreachable-code` occurring with (old) ccache+cmake+clang combination (#1540)
+* Fixed `-Wdefaulted-function-deleted` warning with Clang 8 (#1537)
+* Catch2's type traits and helpers are now properly namespaced inside `Catch::` (#1548)
+* Fixed std{out,err} redirection for failing test (#1514, #1525)
+  * Somehow, this bug has been present for well over a year before it was reported
+
+
+### Contrib
+* `ParseAndAddCatchTests` now properly escapes commas in the test name
+
+
+
+## 2.6.1
+
+### Improvements
+* The JUnit reporter now also reports random seed (#1520, #1521)
+
+### Fixes
+* The TAP reporter now formats comments with test name properly (#1529)
+* `CATCH_REQUIRE_THROWS`'s internals were unified with `REQUIRE_THROWS` (#1536)
+  * This fixes a potential `-Wunused-value` warning when used
+* Fixed a potential segfault when using any of the `--list-*` options (#1533, #1534)
+
+
+## 2.6.0
+
+**With this release the data generator feature is now fully supported.**
+
+
+### Improvements
+* Added `TEMPLATE_PRODUCT_TEST_CASE` (#1454, #1468)
+  * This allows you to easily test various type combinations, see documentation for details
+* The error message for `&&` and `||` inside assertions has been improved (#1273, #1480)
+* The error message for chained comparisons inside assertions has been improved (#1481)
+* Added `StringMaker` specialization for `std::optional` (#1510)
+* The generator interface has been redone once again (#1516)
+  * It is no longer considered experimental and is fully supported
+  * The new interface supports "Input" generators
+  * The generator documentation has been fully updated
+  * We also added 2 generator examples
+
+
+### Fixes
+* Fixed `-Wredundant-move` on newer Clang (#1474)
+* Removed unreachable mentions `std::current_exception`, `std::rethrow_exception` in no-exceptions mode (#1462)
+  * This should fix compilation with IAR
+* Fixed missing `<type_traits>` include (#1494)
+* Fixed various static analysis warnings
+  * Unrestored stream state in `XmlWriter` (#1489)
+  * Potential division by zero in `estimateClockResolution` (#1490)
+  * Uninitialized member in `RunContext` (#1491)
+  * `SourceLineInfo` move ops are now marked `noexcept`
+  * `CATCH_BREAK_INTO_DEBUGGER` is now always a function
+* Fix double run of a test case if user asks for a specific section (#1394, #1492)
+* ANSI colour code output now respects `-o` flag and writes to the file as well (#1502)
+* Fixed detection of `std::variant` support for compilers other than Clang (#1511)
+
+
+### Contrib
+* `ParseAndAddCatchTests` has learned how to use `DISABLED` CTest property (#1452)
+* `ParseAndAddCatchTests` now works when there is a whitspace before the test name (#1493)
+
+
+### Miscellaneous
+* We added new issue templates for reporting issues on GitHub
+* `contributing.md` has been updated to reflect the current test status (#1484)
+
+
+
+## 2.5.0
+
+### Improvements
+* Added support for templated tests via `TEMPLATE_TEST_CASE` (#1437)
+
+
+### Fixes
+* Fixed compilation of `PredicateMatcher<const char*>` by removing partial specialization of `MatcherMethod<T*>`
+* Listeners now implicitly support any verbosity (#1426)
+* Fixed compilation with Embarcadero builder by introducing `Catch::isnan` polyfill (#1438)
+* Fixed `CAPTURE` asserting for non-trivial captures (#1436, #1448)
+
+
+### Miscellaneous
+* We should now be providing first party Conan support via https://bintray.com/catchorg/Catch2 (#1443)
+* Added new section "deprecations and planned changes" to the documentation
+  * It contains summary of what is deprecated and might change with next major version
+* From this release forward, the released headers should be pgp signed (#430)
+  * KeyID `E29C 46F3 B8A7 5028 6079 3B7D ECC9 C20E 314B 2360`
+  * or https://codingnest.com/files/horenmar-publickey.asc
+
+
+## 2.4.2
+
+### Improvements
+* XmlReporter now also outputs the RNG seed that was used in a run (#1404)
+* `Catch::Session::applyCommandLine` now also accepts `wchar_t` arguments.
+  * However, Catch2 still does not support unicode.
+* Added `STATIC_REQUIRE` macro (#1356, #1362)
+* Catch2's singleton's are now cleaned up even if tests are run (#1411)
+  * This is mostly useful as a FP prevention for users who define their own main.
+* Specifying an invalid reporter via `-r` is now reported sooner (#1351, #1422)
+
+
+### Fixes
+* Stringification no longer assumes that `char` is signed (#1399, #1407)
+  * This caused a `Wtautological-compare` warning.
+* SFINAE for `operator<<` no longer sees different overload set than the actual insertion (#1403)
+
+
+### Contrib
+* `catch_discover_tests` correctly adds tests with comma in name (#1327, #1409)
+* Added a new customization point in how the tests are launched to `catch_discover_tests`
+
+
+## 2.4.1
+
+### Improvements
+* Added a StringMaker for `std::(w)string_view` (#1375, #1376)
+* Added a StringMaker for `std::variant` (#1380)
+  * This one is disabled by default to avoid increased compile-time drag
+* Added detection for cygwin environment without `std::to_string` (#1396, #1397)
+
+### Fixes
+* `UnorderedEqualsMatcher` will no longer accept erroneously accept
+vectors that share suffix, but are not permutation of the desired vector
+* Abort after (`-x N`) can no longer be overshot by nested `REQUIRES` and
+subsequently ignored (#1391, #1392)
+
+
+## 2.4.0
+
+**This release brings two new experimental features, generator support
+and a `-fno-exceptions` support. Being experimental means that they
+will not be subject to the usual stability guarantees provided by semver.**
+
+### Improvements
+* Various small runtime performance improvements
+* `CAPTURE` macro is now variadic
+* Added `AND_GIVEN` macro (#1360)
+* Added experimental support for data generators
+  * See [their documentation](generators.md) for details
+* Added support for compiling and running Catch without exceptions
+  * Doing so limits the functionality somewhat
+  * Look [into the documentation](configuration.md#disablingexceptions) for details
+
+### Fixes
+* Suppressed `-Wnon-virtual-dtor` warnings in Matchers (#1357)
+* Suppressed `-Wunreachable-code` warnings in floating point matchers (#1350)
+
+### CMake
+* It is now possible to override which Python is used to run Catch's tests (#1365)
+* Catch now provides infrastructure for adding tests that check compile-time configuration
+* Catch no longer tries to install itself when used as a subproject (#1373)
+* Catch2ConfigVersion.cmake is now generated as arch-independent (#1368)
+  * This means that installing Catch from 32-bit machine and copying it to 64-bit one works
+  * This fixes conan installation of Catch
+
+
+## 2.3.0
 
+**This release changes the include paths provided by our CMake and
+pkg-config integration. The proper include path for the single-header
+when using one of the above is now `<catch2/catch.hpp>`. This change
+also necessitated changes to paths inside the repository, so that the
+single-header version is now at `single_include/catch2/catch.hpp`, rather
+than `single_include/catch.hpp`.**
 
 
-# 1.12.0
 
 ### Fixes
+* Fixed Objective-C++ build
+* `-Wunused-variable` suppression no longer leaks from Catch's header under Clang
+* Implementation of the experimental new output capture can now be disabled (#1335)
+  * This allows building Catch2 on platforms that do not provide things like `dup` or `tmpfile`.
+* The JUnit and XML reporters will no longer skip over successful tests when running without `-s`  (#1264, #1267, #1310)
+  * See improvements for more details
+
+### Improvements
+* pkg-config and CMake integration has been rewritten
+  * If you use them, the new include path is `#include <catch2/catch.hpp>`
+  * CMake installation now also installs scripts from `contrib/`
+  * For details see the [new documentation](cmake-integration.md#top)
+* Reporters now have a new customization point, `ReporterPreferences::shouldReportAllAssertions`
+  * When this is set to `false` and the tests are run without `-s`, passing assertions are not sent to the reporter.
+  * Defaults to `false`.
+* Added `DYNAMIC_SECTION`, a section variant that constructs its name using stream
+  * This means that you can do `DYNAMIC_SECTION("For X := " << x)`.
+
+
+## 2.2.3
+
+**To fix some of the bugs, some behavior had to change in potentially breaking manner.**
+**This means that even though this is a patch release, it might not be a drop-in replacement.**
+
+### Fixes
+* Listeners are now called before reporter
+  * This was always documented to be the case, now it actually works that way
+* Catch's commandline will no longer accept multiple reporters
+  * This was done because multiple reporters never worked properly and broke things in non-obvious ways
+  * **This has potential to be a breaking change**
+* MinGW is now detected as Windows platform w/o SEH support (#1257)
+  * This means that Catch2 no longer tries to use POSIX signal handling when compiled with MinGW
+* Fixed potential UB in parsing tags using non-ASCII characters (#1266)
+  * Note that Catch2 still supports only ASCII test names/tags/etc
+* `TEST_CASE_METHOD` can now be used on classnames containing commas (#1245)
+  * You have to enclose the classname in extra set of parentheses
+* Fixed insufficient alt stack size for POSIX signal handling (#1225)
+* Fixed compilation error on Android due to missing `std::to_string` in C++11 mode (#1280)
+* Fixed the order of user-provided `FALLBACK_STRINGIFIER` in stringification machinery (#1024)
+  * It was intended to be replacement for built-in fallbacks, but it was used _after_ them.
+  * **This has potential to be a breaking change**
+* Fixed compilation error when a type has an `operator<<` with templated lhs (#1285, #1306)
+
+### Improvements
+* Added a new, experimental, output capture (#1243)
+  * This capture can also redirect output written via C apis, e.g. `printf`
+  * To opt-in, define `CATCH_CONFIG_EXPERIMENTAL_REDIRECT` in the implementation file
+* Added a new fallback stringifier for classes derived from `std::exception`
+  * Both `StringMaker` specialization and `operator<<` overload are given priority
+
+### Miscellaneous
+* `contrib/` now contains dbg scripts that skip over Catch's internals (#904, #1283)
+  * `gdbinit` for gdb `lldbinit` for lldb
+* `CatchAddTests.cmake` no longer strips whitespace from tests (#1265, #1281)
+* Online documentation now describes `--use-colour` option (#1263)
+
+
+## 2.2.2
+
+### Fixes
+* Fixed bug in `WithinAbs::match()` failing spuriously (#1228)
+* Fixed clang-tidy diagnostic about virtual call in destructor (#1226)
+* Reduced the number of GCC warnings suppression leaking out of the header (#1090, #1091)
+  * Only `-Wparentheses` should be leaking now
+* Added upper bound on the time benchmark timer calibration is allowed to take (#1237)
+  * On platforms where `std::chrono::high_resolution_clock`'s resolution is low, the calibration would appear stuck
+* Fixed compilation error when stringifying static arrays of `unsigned char`s (#1238)
+
+### Improvements
+* XML encoder now hex-encodes invalid UTF-8 sequences (#1207)
+  * This affects xml and junit reporters
+  * Some invalid UTF-8 parts are left as is, e.g. surrogate pairs. This is because certain extensions of UTF-8 allow them, such as WTF-8.
+* CLR objects (`T^`) can now be stringified (#1216)
+  * This affects code compiled as C++/CLI
+* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236)
+  * See [documentation for details](https://github.com/catchorg/Catch2/blob/master/docs/matchers.md)
+
+### Others
+* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239)
+  * The plans to standardize on `#include <catch2/catch.hpp>` are still in effect
+
+
+## 2.2.1
+
+### Fixes
+* Fixed compilation error when compiling Catch2 with `std=c++17` against libc++ (#1214)
+  * Clara (Catch2's CLI parsing library) used `std::optional` without including it explicitly
+* Fixed Catch2 return code always being 0 (#1215)
+  * In the words of STL, "We feel superbad about letting this in"
+
+
+## 2.2.0
+
+### Fixes
+* Hidden tests are not listed by default when listing tests (#1175)
+  * This makes `catch_discover_tests` CMake script work better
+* Fixed regression that meant `<windows.h>` could potentially not be included properly (#1197)
+* Fixed installing `Catch2ConfigVersion.cmake` when Catch2 is a subproject.
+
+### Improvements
+* Added an option to warn (+ exit with error) when no tests were ran (#1158)
+  * Use as `-w NoTests`
+* Added provisional support for Emscripten (#1114)
+* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/master/docs/configuration.md#fallback-stringifier) (#1024)
+  * This allows project's own stringification machinery to be easily reused for Catch
+* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
+  * The embedded version of Clara was bumped to v1.1.3
+* Various minor performance improvements
+* Added support for DJGPP DOS crosscompiler (#1206)
+
+
+## 2.1.2
+
+### Fixes
+* Fixed compilation error with `-fno-rtti` (#1165)
+* Fixed NoAssertion warnings
+* `operator<<` is used before range-based stringification (#1172)
+* Fixed `-Wpedantic` warnings (extra semicolons and binary literals) (#1173)
+
+
+### Improvements
+* Added `CATCH_VERSION_{MAJOR,MINOR,PATCH}` macros (#1131)
+* Added `BrightYellow` colour for use in reporters (#979)
+  * It is also used by ConsoleReporter for reconstructed expressions
+
+### Other changes
+* Catch is now exported as a CMake package and linkable target (#1170)
+
+## 2.1.1
+
+### Improvements
+* Static arrays are now properly stringified like ranges across MSVC/GCC/Clang
+* Embedded newer version of Clara -- v1.1.1
+  * This should fix some warnings dragged in from Clara
+* MSVC's CLR exceptions are supported
+
+
+### Fixes
+* Fixed compilation when comparison operators do not return bool (#1147)
+* Fixed CLR exceptions blowing up the executable during translation (#1138)
+
+
+### Other changes
+* Many CMake changes
+  * `NO_SELFTEST` option is deprecated, use `BUILD_TESTING` instead.
+  * Catch specific CMake options were prefixed with `CATCH_` for namespacing purposes
+  * Other changes to simplify Catch2's packaging
+
+
+
+## 2.1.0
+
+### Improvements
+* Various performance improvements
+  * On top of the performance regression fixes
+* Experimental support for PCH was added (#1061)
+* `CATCH_CONFIG_EXTERNAL_INTERFACES` now brings in declarations of Console, Compact, XML and JUnit reporters
+* `MatcherBase` no longer has a pointless second template argument
+* Reduced the number of warning suppressions that leak into user's code
+  * Bugs in g++ 4.x and 5.x mean that some of them have to be left in
+
+
+### Fixes
+* Fixed performance regression from Catch classic
+  * One of the performance improvement patches for Catch classic was not applied to Catch2
+* Fixed platform detection for iOS (#1084)
+* Fixed compilation when `g++` is used together with `libc++` (#1110)
+* Fixed TeamCity reporter compilation with the single header version
+  * To fix the underlying issue we will be versioning reporters in single_include folder per release
+* The XML reporter will now report `WARN` messages even when not used with `-s`
+* Fixed compilation when `VectorContains` matcher was combined using `&&` (#1092)
+* Fixed test duration overflowing after 10 seconds (#1125, #1129)
+* Fixed `std::uncaught_exception` deprecation warning (#1124)
+
+
+### New features
+* New Matchers
+  * Regex matcher for strings, `Matches`.
+  * Set-equal matcher for vectors, `UnorderedEquals`
+  * Floating point matchers, `WithinAbs` and `WithinULP`.
+* Stringification now attempts to decompose all containers (#606)
+  * Containers are objects that respond to ADL `begin(T)` and `end(T)`.
+
+
+### Other changes
+* Reporters will now be versioned in the `single_include` folder to ensure their compatibility with the last released version
+
+
+
+
+## 2.0.1
+
+### Breaking changes
+* Removed C++98 support
+* Removed legacy reporter support
+* Removed legacy generator support
+  * Generator support will come back later, reworked
+* Removed `Catch::toString` support
+  * The new stringification machinery uses `Catch::StringMaker` specializations first and `operator<<` overloads second.
+* Removed legacy `SCOPED_MSG` and `SCOPED_INFO` macros
+* Removed `INTERNAL_CATCH_REGISTER_REPORTER`
+  * `CATCH_REGISTER_REPORTER` should be used to register reporters
+* Removed legacy `[hide]` tag
+  * `[.]`, `[.foo]` and `[!hide]` are still supported
+* Output into debugger is now colourized
+* `*_THROWS_AS(expr, exception_type)` now unconditionally appends `const&` to the exception type.
+* `CATCH_CONFIG_FAST_COMPILE` now affects the `CHECK_` family of assertions as well as `REQUIRE_` family of assertions
+  * This is most noticeable in `CHECK(throws())`, which would previously report failure, properly stringify the exception and continue. Now it will report failure and stop executing current section.
+* Removed deprecated matcher utility functions `Not`, `AllOf` and `AnyOf`.
+  * They are superseded by operators `!`, `&&` and `||`, which are natural and do not have limited arity
+* Removed support for non-const comparison operators
+  * Non-const comparison operators are an abomination that should not exist
+  * They were breaking support for comparing function to function pointer
+* `std::pair` and `std::tuple` are no longer stringified by default
+  * This is done to avoid dragging in `<tuple>` and `<utility>` headers in common path
+  * Their stringification can be enabled per-file via new configuration macros
+* `Approx` is subtly different and hopefully behaves more as users would expect
+  * `Approx::scale` defaults to `0.0`
+  * `Approx::epsilon` no longer applies to the larger of the two compared values, but only to the `Approx`'s value
+  * `INFINITY == Approx(INFINITY)` returns true
+
+
+### Improvements
+* Reporters and Listeners can be defined in files different from the main file
+  * The file has to define `CATCH_CONFIG_EXTERNAL_INTERFACES` before including catch.hpp.
+* Errors that happen during set up before main are now caught and properly reported once main is entered
+  * If you are providing your own main, you can access and use these as well.
+* New assertion macros, *_THROWS_MATCHES(expr, exception_type, matcher) are provided
+  * As the arguments suggest, these allow you to assert that an expression throws desired type of exception and pass the exception to a matcher.
+* JUnit reporter no longer has significantly different output for test cases with and without sections
+* Most assertions now support expressions containing commas (ie `REQUIRE(foo() == std::vector<int>{1, 2, 3});`)
+* Catch now contains experimental micro benchmarking support
+  * See `projects/SelfTest/Benchmark.tests.cpp` for examples
+  * The support being experiment means that it can be changed without prior notice
+* Catch uses new CLI parsing library (Clara)
+  * Users can now easily add new command line options to the final executable
+  * This also leads to some changes in `Catch::Session` interface
+* All parts of matchers can be removed from a TU by defining `CATCH_CONFIG_DISABLE_MATCHERS`
+  * This can be used to somewhat speed up compilation times
+* An experimental implementation of `CATCH_CONFIG_DISABLE` has been added
+  * Inspired by Doctest's `DOCTEST_CONFIG_DISABLE`
+  * Useful for implementing tests in source files
+    * ie for functions in anonymous namespaces
+  * Removes all assertions
+  * Prevents `TEST_CASE` registrations
+  * Exception translators are not registered
+  * Reporters are not registered
+  * Listeners are not registered
+* Reporters/Listeners are now notified of fatal errors
+  * This means specific signals or structured exceptions
+  * The Reporter/Listener interface provides default, empty, implementation to preserve backward compatibility
+* Stringification of `std::chrono::duration` and `std::chrono::time_point` is now supported
+  * Needs to be enabled by a per-file compile time configuration option
+* Add `pkg-config` support to CMake install command
+
+
+### Fixes
+* Don't use console colour if running in XCode
+* Explicit constructor in reporter base class
+* Swept out `-Wweak-vtables`, `-Wexit-time-destructors`, `-Wglobal-constructors` warnings
+* Compilation for Universal Windows Platform (UWP) is supported
+  * SEH handling and colorized output are disabled when compiling for UWP
+* Implemented a workaround for `std::uncaught_exception` issues in libcxxrt
+  * These issues caused incorrect section traversals
+  * The workaround is only partial, user's test can still trigger the issue by using `throw;` to rethrow an exception
+* Suppressed C4061 warning under MSVC
+
+
+### Internal changes
+* The development version now uses .cpp files instead of header files containing implementation.
+  * This makes partial rebuilds much faster during development
+* The expression decomposition layer has been rewritten
+* The evaluation layer has been rewritten
+* New library (TextFlow) is used for formatting text to output
+
+
+## Older versions
+
+### 1.12.x
+
+#### 1.12.2
+##### Fixes
+* Fixed missing <cassert> include
+
+#### 1.12.1
+
+##### Fixes
+* Fixed deprecation warning in `ScopedMessage::~ScopedMessage`
+* All uses of `min` or `max` identifiers are now wrapped in parentheses
+  * This avoids problems when Windows headers define `min` and `max` macros
+
+#### 1.12.0
+
+##### Fixes
 * Fixed compilation for strict C++98 mode (ie not gnu++98) and older compilers (#1103)
 * `INFO` messages are included in the `xml` reporter output even without `-s` specified.
 
 
+### 1.11.x
 
-# 1.11.0
+#### 1.11.0
 
-### Fixes
+##### Fixes
 * The original expression in `REQUIRE_FALSE( expr )` is now reporter properly as `!( expr )` (#1051)
   * Previously the parentheses were missing and `x != y` would be expanded as `!x != x`
 * `Approx::Margin` is now inclusive (#952)
@@ -29,7 +684,7 @@
   * This means that `REQUIRE( 0.25f == Approx( 0.0f ).margin( 0.25f ) )` passes, instead of fails
 * `RandomNumberGenerator::result_type` is now unsigned (#1050)
 
-### Improvements
+##### Improvements
 * `__JETBRAINS_IDE__` macro handling is now CLion version specific (#1017)
   * When CLion 2017.3 or newer is detected, `__COUNTER__` is used instead of
 * TeamCity reporter now explicitly flushes output stream after each report (#1057)
@@ -37,55 +692,35 @@
 * `ParseAndAddCatchTests` now can add test files as dependency to CMake configuration
   * This means you do not have to manually rerun CMake configuration step to detect new tests
 
+### 1.10.x
 
-# 1.10.0
+#### 1.10.0
 
-### Fixes
+##### Fixes
 * Evaluation layer has been rewritten (backported from Catch 2)
   * The new layer is much simpler and fixes some issues (#981)
 * Implemented workaround for VS 2017 raw string literal stringification bug (#995)
 * Fixed interaction between `[!shouldfail]` and `[!mayfail]` tags and sections
   * Previously sections with failing assertions would be marked as failed, not failed-but-ok
 
-### Improvements
+##### Improvements
 * Added [libidentify](https://github.com/janwilmans/LibIdentify) support
 * Added "wait-for-keypress" option
 
+### 1.9.x
 
-# 1.9.7
-
-### Fixes
-* Various warnings from clang-tidy, Resharper-C++ and PVS Studio have been addressed (#957)
-* Dynamically generated sections are now properly reported (#963)
-* Writes to `std::clog` are redirected for reporters (#989)
-  * Previously only `std::cerr` writes were redirected
-  * Interleaved writes to `std::cerr` and `std::clog` are combined properly
-* Assertions failed before signals/structured exceptions fails test case are properly reported as failed (#990)
-
-### Improvements
-* Catch's runtime overhead has been decreased further (#940)
-* Added support for IBM i ILE c++ compiler (#976)
-  * This means that AS/400 is now supported.
-* The default reporter can be configured at compile time (#978)
-  * That is, the reporter used if no reporter is explicitly specified
-
-### Other
-* `ParseAndAddCatchTests` cmake script has couple new customization options
-
+#### 1.9.6
 
-
-# 1.9.6
-
-### Improvements
+##### Improvements
 * Catch's runtime overhead has been significantly decreased (#937, #939)
 * Added `--list-extra-info` cli option (#934).
   * It lists all tests together with extra information, ie filename, line number and description.
 
 
 
-# 1.9.5
+#### 1.9.5
 
-### Fixes
+##### Fixes
 * Truthy expressions are now reconstructed properly, not as booleans (#914)
 * Various warnings are no longer erroneously suppressed in test files (files that include `catch.hpp`, but do not define `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`) (#871)
 * Catch no longer fails to link when main is compiled as C++, but linked against Objective-C (#855)
@@ -93,35 +728,35 @@
   * Previously any GCC with minor version less than 3 would be incorrectly classified as not supporting `__COUNTER__`.
 * Suppressed C4996 warning caused by upcoming updated to MSVC 2017, marking `std::uncaught_exception` as deprecated. (#927)
 
-### Improvements
+##### Improvements
 * CMake integration script now incorporates debug messages and registers tests in an improved way (#911)
 * Various documentation improvements
 
 
 
-# 1.9.4
+#### 1.9.4
 
-### Fixes
+##### Fixes
 * `CATCH_FAIL` macro no longer causes compilation error without variadic macro support
 * `INFO` messages are no longer cleared after being reported once
 
-### Improvements and minor changes
+##### Improvements and minor changes
 * Catch now uses `wmain` when compiled under Windows and `UNICODE` is defined.
   * Note that Catch still officially supports only ASCII
 
-# 1.9.3
+#### 1.9.3
 
-### Fixes
+##### Fixes
 * Completed the fix for (lack of) uint64_t in earlier Visual Studios
 
-# 1.9.2
+#### 1.9.2
 
-### Improvements and minor changes
+##### Improvements and minor changes
 * All of `Approx`'s member functions now accept strong typedefs in C++11 mode (#888)
   * Previously `Approx::scale`, `Approx::epsilon`, `Approx::margin` and `Approx::operator()` didn't.
 
 
-### Fixes
+##### Fixes
 * POSIX signals are now disabled by default under QNX (#889)
   * QNX does not support current enough (2001) POSIX specification
 * JUnit no longer counts exceptions as failures if given test case is marked as ok to fail.
@@ -129,22 +764,22 @@
 * Catch no longer attempts to define `uint64_t` on windows (#862)
   * This was causing trouble when compiled under Cygwin
 
-### Other
+##### Other
 * Catch is now compiled under MSVC 2017 using `std:c++latest` (C++17 mode) in CI
 * We now provide cmake script that autoregisters Catch tests into ctest.
   * See `contrib` folder.
 
 
-# 1.9.1
+#### 1.9.1
 
-### Fixes
+##### Fixes
 * Unexpected exceptions are no longer ignored by default (#885, #887)
 
 
-# 1.9.0
+#### 1.9.0
 
 
-### Improvements and minor changes
+##### Improvements and minor changes
 * Catch no longer attempts to ensure the exception type passed by user in `REQUIRE_THROWS_AS` is a constant reference.
   * It was causing trouble when `REQUIRE_THROWS_AS` was used inside templated functions
   * This actually reverts changes made in v1.7.2
@@ -158,7 +793,7 @@
 * When Catch is compiled using C++11, `Approx` is now constructible with anything that can be explicitly converted to `double`.
 * Captured messages are now printed on unexpected exceptions
 
-### Fixes:
+##### Fixes:
 * Clang's `-Wexit-time-destructors` should be suppressed for Catch's internals
 * GCC's `-Wparentheses` is now suppressed for all TU's that include `catch.hpp`.
   * This is functionally a revert of changes made in 1.8.0, where we tried using `_Pragma` based suppression. This should have kept the suppression local to Catch's assertions, but bugs in GCC's handling of `_Pragma`s in C++ mode meant that it did not always work.
@@ -167,16 +802,18 @@
   * [Details can be found in documentation](configuration.md#catch_config_cpp11_stream_insertable_check)
 
 
-### Other notes:
+##### Other notes:
 * We have added VS 2017 to our CI
 * Work on Catch 2 should start soon
 
 
 
-# 1.8.2
+### 1.8.x
 
+#### 1.8.2
 
-### Improvements and minor changes
+
+##### Improvements and minor changes
 * TAP reporter now behaves as if `-s` was always set
   * This should be more consistent with the protocol desired behaviour.
 * Compact reporter now obeys `-d yes` argument (#780)
@@ -186,11 +823,11 @@
   * This means it reports `INFO` messages on success, if output on success (`-s`) is enabled.
   * Previously it only reported `INFO` messages on failure.
 * `CAPTURE(expr)` now stringifies `expr` in the same way assertion macros do (#639)
-* Listeners are now finally [documented](event-listeners.md).
+* Listeners are now finally [documented](event-listeners.md#top).
   * Listeners provide a way to hook into events generated by running your tests, including start and end of run, every test case, every section and every assertion.
 
 
-### Fixes:
+##### Fixes:
 * Catch no longer attempts to reconstruct expression that led to a fatal error  (#810)
   * This fixes possible signal/SEH loop when processing expressions, where the signal was triggered by expression decomposition.
 * Fixed (C4265) missing virtual destructor warning in Matchers (#844)
@@ -207,25 +844,25 @@
 * Regression in Objective-C bindings (Matchers) fixed (#854)
 
 
-### Other notes:
+##### Other notes:
 * We have added VS 2013 and 2015 to our CI
 * Catch Classic (1.x.x) now contains its own, forked, version of Clara (the argument parser).
 
 
 
-# 1.8.1
+#### 1.8.1
 
-### Fixes
+##### Fixes
 
 Cygwin issue with `gettimeofday` - `#define` was not early enough
 
-# 1.8.0
+#### 1.8.0
 
-### New features/ minor changes
+##### New features/ minor changes
 
 * Matchers have new, simpler (and documented) interface.
   * Catch provides string and vector matchers.
-  * For details see [Matchers documentation](matchers.md).
+  * For details see [Matchers documentation](matchers.md#top).
 * Changed console reporter test duration reporting format (#322)
   * Old format: `Some simple comparisons between doubles completed in 0.000123s`
   * New format: `xxx.123s: Some simple comparisons between doubles` _(There will always be exactly 3 decimal places)_
@@ -236,36 +873,38 @@ Cygwin issue with `gettimeofday` - `#define` was not early enough
   * _More changes are coming_
 * Added [TAP (Test Anything Protocol)](https://testanything.org/) and [Automake](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) reporters.
   * These are not present in the default single-include header and need to be downloaded from GitHub separately.
-  * For details see [documentation about integrating with build systems](build-systems.md).
+  * For details see [documentation about integrating with build systems](build-systems.md#top).
 *  XML reporter now reports filename as part of the `Section` and `TestCase` tags.
 * `Approx` now supports an optional margin of absolute error
-  * It has also received [new documentation](assertions.md).
+  * It has also received [new documentation](assertions.md#top).
 
-### Fixes
+##### Fixes
 * Silenced C4312 ("conversion from int to 'ClassName *") warnings in the evaluate layer.
 * Fixed C4512 ("assignment operator could not be generated") warnings under VS2013.
 * Cygwin compatibility fixes
   * Signal handling is no longer compiled by default.
   * Usage of `gettimeofday` inside Catch should no longer cause compilation errors.
-* Improved `-Wparentheses` supression for gcc (#674)
-  * When compiled with gcc 4.8 or newer, the supression is localized to assertions only
-  * Otherwise it is supressed for the whole TU
+* Improved `-Wparentheses` suppression for gcc (#674)
+  * When compiled with gcc 4.8 or newer, the suppression is localized to assertions only
+  * Otherwise it is suppressed for the whole TU
 * Fixed test spec parser issue (with escapes in multiple names)
 
-### Other
+##### Other
 * Various documentation fixes and improvements
 
 
-# 1.7.2
+### 1.7.x
 
-### Fixes and minor improvements
+#### 1.7.2
+
+##### Fixes and minor improvements
 Xml:
 
 (technically the first two are breaking changes but are also fixes and arguably break few if any people)
 * C-escape control characters instead of XML encoding them (which requires XML 1.1)
 * Revert XML output to XML 1.0
 * Can provide stylesheet references by extending the XML reporter
-* Added description and tags attribites to XML Reporter
+* Added description and tags attributes to XML Reporter
 * Tags are closed and the stream flushed more eagerly to avoid stdout interpolation
 
 
@@ -277,26 +916,26 @@ Other:
 * Silenced a few more warnings in different circumstances
 * Travis improvements
 
-# 1.7.1
+#### 1.7.1
 
-### Fixes:
+##### Fixes:
 * Fixed inconsistency in defining `NOMINMAX` and `WIN32_LEAN_AND_MEAN` inside `catch.hpp`.
 * Fixed SEH-related compilation error under older MinGW compilers, by making Windows SEH handling opt-in for compilers other than MSVC.
-  * For specifics, look into the [documentation](configuration.md).
+  * For specifics, look into the [documentation](configuration.md#top).
 * Fixed compilation error under MinGW caused by improper compiler detection.
 * Fixed XML reporter sometimes leaving an empty output file when a test ends with signal/structured exception.
 * Fixed XML reporter not reporting captured stdout/stderr.
 * Fixed possible infinite recursion in Windows SEH.
 * Fixed possible compilation error caused by Catch's operator overloads being ambiguous in regards to user-defined templated operators.
 
-## 1.7.0
+#### 1.7.0
 
-### Features/ Changes:
+##### Features/ Changes:
 * Catch now runs significantly faster for passing tests
   * Microbenchmark focused on Catch's overhead went from ~3.4s to ~0.7s.
   * Real world test using [JSON for Modern C++](https://github.com/nlohmann/json)'s test suite went from ~6m 25s to ~4m 14s.
 * Catch can now run specific sections within test cases.
-  * For now the support is only basic (no wildcards or tags), for details see the [documentation](command-line.md).
+  * For now the support is only basic (no wildcards or tags), for details see the [documentation](command-line.md#top).
 * Catch now supports SEH on Windows as well as signals on Linux.
   * After receiving a signal, Catch reports failing assertion and then passes the signal onto the previous handler.
 * Approx can be used to compare values against strong typedefs (available in C++11 mode only).
@@ -305,61 +944,63 @@ Other:
 * Certain characters (space, tab, etc) are now pretty printed.
   * This means that a `char c = ' '; REQUIRE(c == '\t');` would be printed as `' ' == '\t'`, instead of ` == 9`.
 
-### Fixes:
+##### Fixes:
 * Text formatting no longer attempts to access out-of-bounds characters under certain conditions.
 * THROW family of assertions no longer trigger `-Wunused-value` on expressions containing explicit cast.
 * Breaking into debugger under OS X works again and no longer required `DEBUG` to be defined.
 * Compilation no longer breaks under certain compiler if a lambda is used inside assertion macro.
 
-### Other:
+##### Other:
 * Catch's CMakeLists now defines install command.
 * Catch's CMakeLists now generates projects with warnings enabled.
 
 
-## 1.6.1
+### 1.6.x
+
+#### 1.6.1
 
-### Features/ Changes:
+##### Features/ Changes:
 * Catch now supports breaking into debugger on Linux
 
-### Fixes:
+##### Fixes:
 * Generators no longer leak memory (generators are still unsupported in general)
 * JUnit reporter now reports UTC timestamps, instead of "tbd"
 * `CHECK_THAT` macro is now properly defined as `CATCH_CHECK_THAT` when using `CATCH_` prefixed macros
 
-### Other:
+##### Other:
 * Types with overloaded `&&` operator are no longer evaluated twice when used in an assertion macro.
-* The use of `__COUNTER__` is supressed when Catch is parsed by CLion
+* The use of `__COUNTER__` is suppressed when Catch is parsed by CLion
   * This change is not active when compiling a binary
 * Approval tests can now be run on Windows
 * CMake will now warn if a file is present in the `include` folder but not is not enumerated as part of the project
 * Catch now defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including `windows.h`
-  * This can be disabled if needed, see [documentation](configuration.md) for details.
+  * This can be disabled if needed, see [documentation](configuration.md#top) for details.
 
 
-## 1.6.0
+#### 1.6.0
 
-### Cmake/ projects:
+##### Cmake/ projects:
 * Moved CMakeLists.txt to root, made it friendlier for CLion and generating XCode and VS projects, and removed the manually maintained XCode and VS projects.
 
-### Features/ Changes:
+##### Features/ Changes:
 * Approx now supports `>=` and `<=`
 * Can now use `\` to escape chars in test names on command line
 * Standardize C++11 feature toggles
 
-### Fixes:
+##### Fixes:
 * Blue shell colour
 * Missing argument to `CATCH_CHECK_THROWS`
 * Don't encode extended ASCII in XML
 * use `std::shuffle` on more compilers (fixes deprecation warning/error)
 * Use `__COUNTER__` more consistently (where available)
 
-### Other:
+##### Other:
 * Tweaks and changes to scripts - particularly for Approval test - to make them more portable
 
 
-# Older versions
+## Even Older versions
 Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 37 - 28
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/release-process.md

@@ -1,63 +1,72 @@
+<a id="top"></a>
 # How to release
 
-When enough changes have accumulated, it is time to release new version of Catch. This document describes the proces in doing so, that no steps are forgotten. Note that all referenced scripts can be found in the `scripts/` directory.
+When enough changes have accumulated, it is time to release new version of Catch. This document describes the process in doing so, that no steps are forgotten. Note that all referenced scripts can be found in the `scripts/` directory.
 
-## Neccessary steps
+## Necessary steps
 
-These steps are neccessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places.
+These steps are necessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places.
 
 
-### Approval testing
+### Testing
 
-Catch's releases are primarily validated against output from previous release, stored in `projects/SelfTest/Baselines`. To validate current sources, build the SelfTest binary and pass it to the `approvalTests.py` script: `approvalTests.py <path/to/SelfTest>`.
-
-There should be no differences, as Approval tests should be updated when changes to Catch are made, but if there are, then they need to be manually reviewed and either approved (using `approve.py`) or Catch requires other fixes.
+All of the tests are currently run in our CI setup based on TravisCI and
+AppVeyor. As long as the last commit tested green, the release can
+proceed.
 
 
 ### Incrementing version number
 
-Catch uses a variant of [semantic versioning](http://semver.org/), with breaking API changes (and thus major version increments) being very rare. Thus, the release will usually increment the patch version, when it only contains couple of bugfixes, or minor version, when it contains new functionality, or larger changes in implementation of current functionality. 
+Catch uses a variant of [semantic versioning](http://semver.org/), with breaking API changes (and thus major version increments) being very rare. Thus, the release will usually increment the patch version, when it only contains couple of bugfixes, or minor version, when it contains new functionality, or larger changes in implementation of current functionality.
 
 After deciding which part of version number should be incremented, you can use one of the `*Release.py` scripts to perform the required changes to Catch.
 
-
-### Generate updated single-include header
-
-After updating version number, regenerate single-include header using `generateSingleHeader.py`.
+This will take care of generating the single include header, updating
+version numbers everywhere and pushing the new version to Wandbox.
 
 
 ### Release notes
 
-Once a release is ready, release notes need to be written. They should summarize changes done since last release. For rough idea of expected notes see previous releases. Once written, release notes should be placed in `docs/release-notes.md`.
+Once a release is ready, release notes need to be written. They should summarize changes done since last release. For rough idea of expected notes see previous releases. Once written, release notes should be added to `docs/release-notes.md`.
 
 
 ### Commit and push update to GitHub
 
-After version number is incremented, single-include header is regenerated and release notes are updated, changes should be commited and pushed to GitHub. 
+After version number is incremented, single-include header is regenerated and release notes are updated, changes should be committed and pushed to GitHub.
 
 
 ### Release on GitHub
 
-After pushing changes to GitHub, GitHub release *needs* to be created. Tag version and release title should be same as the new version, description should contain the release notes for the current release. Single header version of `catch.hpp` *needs* to be attached as a binary, as that is where the official download link links to. Preferably it should use linux line endings.
+After pushing changes to GitHub, GitHub release *needs* to be created.
+Tag version and release title should be same as the new version,
+description should contain the release notes for the current release.
+Single header version of `catch.hpp` *needs* to be attached as a binary,
+as that is where the official download link links to. Preferably
+it should use linux line endings. All non-bundled reporters (Automake,
+TAP, TeamCity) should also be attached as binaries, as they might be
+dependent on a specific version of the single-include header.
+
+Since 2.5.0, the release tag and the "binaries" (headers) should be PGP
+signed.
 
-## Optional steps
+#### Signing a tag
 
-The following steps are optional, and do not have to be performed when releasing new version of Catch. However, they are *should* happen, but they can happen the next day without losing anything significant.
+To create a signed tag, use `git tag -s <VERSION>`, where `<VERSION>`
+is the version being released, e.g. `git tag -s v2.6.0`.
 
+Use the version name as the short message and the release notes as
+the body (long) message.
 
-### vcpkg update
+#### Signing the headers
 
-Catch is maintaining its own port in Microsoft's package manager [vcpkg](https://github.com/Microsoft/vcpkg). This means that when new version of Catch is released, it should be posted there as well. `updateVcpkgPackage.py` can do a lot of neccessary work for you, it creates a branch and commits neccessary changes. You should review these changes, push and open a PR against vcpkg's upstream.
+This will create ASCII-armored signatures for the headers that are
+uploaded to the GitHub release:
 
-Note that the script assumes you have your fork of vcpkg checked out in a directory next to the directory where you have checked out Catch, like so:
 ```
-GitHub
-    Catch
-    vcpkg
+$ gpg2 --armor --output catch.hpp.asc --detach-sig catch.hpp
+$ gpg2 --armor --output catch_reporter_automake.hpp.asc --detach-sig catch_reporter_automake.hpp
+$ gpg2 --armor --output catch_reporter_teamcity.hpp.asc --detach-sig catch_reporter_teamcity.hpp
+$ gpg2 --armor --output catch_reporter_tap.hpp.asc --detach-sig catch_reporter_tap.hpp
 ```
 
-
-### Wandbox update
-
-Recently we also included a link to wandbox with preloaded Catch on the main page. Strictly speaking it is unneccessary to update this after every release, Catch usually does not change that much between versions, but it should be kept up to date anyway.
-
+_GPG does not support signing multiple files in single invocation._

+ 6 - 5
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/reporters.md

@@ -1,3 +1,4 @@
+<a id="top"></a>
 # Reporters
 
 Catch has a modular reporting system and comes bundled with a handful of useful reporters built in.
@@ -17,15 +18,15 @@ There are four reporters built in to the single include:
 
 * `console` writes as lines of text, formatted to a typical terminal width, with colours if a capable terminal is detected.
 * `compact` similar to `console` but optimised for minimal output - each entry on one line
-* `junit` writes xml that corresponds to Ant's [junitreport](http://help.catchsoftware.com/display/ET/JUnit+Format) target. Useful for build systems that understand Junit. If you are using Jenkins with Catch 1.x, you can improve quality of output by applying changes in [#923](https://github.com/philsquared/Catch/pull/923).
+* `junit` writes xml that corresponds to Ant's [junitreport](http://help.catchsoftware.com/display/ET/JUnit+Format) target. Useful for build systems that understand Junit.
 Because of the way the junit format is structured the run must complete before anything is written. 
 * `xml` writes an xml format tailored to Catch. Unlike `junit` this is a streaming format so results are delivered progressively.
 
 There are a few additional reporters, for specific build systems, in the Catch repository (in `include\reporters`) which you can `#include` in your project if you would like to make use of them.
-Do this in one source file - typically the same one you have `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`.
+Do this in one source file - the same one you have `CATCH_CONFIG_MAIN` or `CATCH_CONFIG_RUNNER`.
 
-* `teamcity` writes the native, streaming, format that [TeamCity](https://www.jetbrains.com/teamcity/) understands.
-Use this when building as part of a TeamCity build to see results as they happen.
+* `teamcity` writes the native, streaming, format that [TeamCity](https://www.jetbrains.com/teamcity/) understands. 
+Use this when building as part of a TeamCity build to see results as they happen ([code example](../examples/207-Rpt-TeamCityReporter.cpp)).
 * `tap` writes in the TAP ([Test Anything Protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol)) format.
 * `automake` writes in a format that correspond to [automake  .trs](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html) files
 
@@ -42,4 +43,4 @@ but do keep in mind upcoming changes (these will be minor, simplifying, changes
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 12 - 4
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/slow-compiles.md

@@ -1,5 +1,12 @@
+<a id="top"></a>
 # Why do my tests take so long to compile?
 
+**Contents**<br>
+[Short answer](#short-answer)<br>
+[Long answer](#long-answer)<br>
+[Practical example](#practical-example)<br>
+[Other possible solutions](#other-possible-solutions)<br>
+
 Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that?
 
 Catch is implemented entirely in headers. There is a little overhead due to this - but not as much as you might think - and you can minimise it simply by organising your test code as follows:
@@ -18,7 +25,7 @@ Because Catch is implemented *entirely* in headers you might think that the whol
 As a result the main source file *does* compile the whole of Catch every time! So it makes sense to dedicate this file to *only* ```#define```-ing the identifier and ```#include```-ing Catch (and implementing the runner code, if you're doing that). Keep all your test cases in other files. This way you won't pay the recompilation cost for the whole of Catch 
 
 ## Practical example
-Assume you have the `Factorial` function from the [tutorial](tutorial.md) in `factorial.cpp` (with forward declaration in `factorial.h`) and want to test it and keep the compile times down when adding new tests. Then you should have 2 files, `tests-main.cpp` and `tests-factorial.cpp`:
+Assume you have the `Factorial` function from the [tutorial](tutorial.md#top) in `factorial.cpp` (with forward declaration in `factorial.h`) and want to test it and keep the compile times down when adding new tests. Then you should have 2 files, `tests-main.cpp` and `tests-factorial.cpp`:
 
 ```cpp
 // tests-main.cpp
@@ -44,14 +51,15 @@ After compiling `tests-main.cpp` once, it is enough to link it with separately c
 
 ```
 $ g++ tests-main.cpp -c
-$ g++ tests-main.o tests-factorial.cpp -o tests && ./tests -r compact
+$ g++ factorial.cpp -c
+$ g++ tests-main.o factorial.o tests-factorial.cpp -o tests && ./tests -r compact
 Passed 1 test case with 4 assertions.
 ```
 
 Now, the next time we change the file `tests-factorial.cpp` (say we add `REQUIRE( Factorial(0) == 1)`), it is enough to recompile the tests instead of recompiling main as well:
 
 ```
-$ g++ tests-main.o tests-factorial.cpp -o tests && ./tests -r compact
+$ g++ tests-main.o factorial.o tests-factorial.cpp -o tests && ./tests -r compact
 tests-factorial.cpp:11: failed: Factorial(0) == 1 for: 0 == 1
 Failed 1 test case, failed 1 assertion.
 ```
@@ -61,4 +69,4 @@ You can also opt to sacrifice some features in order to speed-up Catch's compila
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 198 - 11
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/test-cases-and-sections.md

@@ -1,5 +1,13 @@
+<a id="top"></a>
 # Test cases and sections
 
+**Contents**<br>
+[Tags](#tags)<br>
+[Tag aliases](#tag-aliases)<br>
+[BDD-style test cases](#bdd-style-test-cases)<br>
+[Type parametrised test cases](#type-parametrised-test-cases)<br>
+[Signature based parametrised test cases](#signature-based-parametrised-test-cases)<br>
+
 While Catch fully supports the traditional, xUnit, style of class-based fixtures containing test case methods this is not the preferred style.
 
 Instead Catch provides a powerful mechanism for nesting test case sections within a test case. For a more detailed discussion see the [tutorial](tutorial.md#test-cases-and-sections).
@@ -11,7 +19,7 @@ Test cases and sections are very easy to use in practice:
 
 _test name_ and _section name_ are free form, quoted, strings. The optional _tags_ argument is a quoted string containing one or more tags enclosed in square brackets. Tags are discussed below. Test names must be unique within the Catch executable.
 
-For examples see the [Tutorial](tutorial.md)
+For examples see the [Tutorial](tutorial.md#top)
 
 ## Tags
 
@@ -19,10 +27,10 @@ Tags allow an arbitrary number of additional strings to be associated with a tes
 
 As an example - given the following test cases:
 
-	TEST_CASE( "A", "[widget]" ) { /* ... */ }
-	TEST_CASE( "B", "[widget]" ) { /* ... */ }
-	TEST_CASE( "C", "[gadget]" ) { /* ... */ }
-	TEST_CASE( "D", "[widget][gadget]" ) { /* ... */ }
+    TEST_CASE( "A", "[widget]" ) { /* ... */ }
+    TEST_CASE( "B", "[widget]" ) { /* ... */ }
+    TEST_CASE( "C", "[gadget]" ) { /* ... */ }
+    TEST_CASE( "D", "[widget][gadget]" ) { /* ... */ }
 
 The tag expression, ```"[widget]"``` selects A, B & D. ```"[gadget]"``` selects C & D. ```"[widget][gadget]"``` selects just D and ```"[widget],[gadget]"``` selects all four test cases.
 
@@ -34,9 +42,9 @@ Tag names are not case sensitive and can contain any ASCII characters. This mean
 
 All tag names beginning with non-alphanumeric characters are reserved by Catch. Catch defines a number of "special" tags, which have meaning to the test runner itself. These special tags all begin with a symbol character. Following is a list of currently defined special tags and their meanings.
 
-* `[!hide]` or `[.]` (or, for legacy reasons, `[hide]`)	- causes test cases to be skipped from the default list (i.e. when no test cases have been explicitly selected through tag expressions or name wildcards). The hide tag is often combined with another, user, tag (for example `[.][integration]` - so all integration tests are excluded from the default run but can be run by passing `[integration]` on the command line). As a short-cut you can combine these by simply prefixing your user tag with a `.` - e.g. `[.integration]`. Because the hide tag has evolved to have several forms, all forms are added as tags if you use one of them.
+* `[!hide]` or `[.]` - causes test cases to be skipped from the default list (i.e. when no test cases have been explicitly selected through tag expressions or name wildcards). The hide tag is often combined with another, user, tag (for example `[.][integration]` - so all integration tests are excluded from the default run but can be run by passing `[integration]` on the command line). As a short-cut you can combine these by simply prefixing your user tag with a `.` - e.g. `[.integration]`. Because the hide tag has evolved to have several forms, all forms are added as tags if you use one of them.
 
-* `[!throws]`	- lets Catch know that this test is likely to throw an exception even if successful. This causes the test to be excluded when running with `-e` or `--nothrow`.
+* `[!throws]` - lets Catch know that this test is likely to throw an exception even if successful. This causes the test to be excluded when running with `-e` or `--nothrow`.
 
 * `[!mayfail]` - doesn't fail the test if any given assertion fails (but still reports it). This can be useful to flag a work-in-progress, or a known issue that you don't want to immediately fix but still want to track in your tests.
 
@@ -48,15 +56,17 @@ All tag names beginning with non-alphanumeric characters are reserved by Catch.
 
 * `[@<alias>]` - tag aliases all begin with `@` (see below).
 
+* `[!benchmark]` - this test case is actually a benchmark. This is an experimental feature, and currently has no documentation. If you want to try it out, look at `projects/SelfTest/Benchmark.tests.cpp` for details.
+
 ## Tag aliases
 
 Between tag expressions and wildcarded test names (as well as combinations of the two) quite complex patterns can be constructed to direct which test cases are run. If a complex pattern is used often it is convenient to be able to create an alias for the expression. This can be done, in code, using the following form:
 
-	CATCH_REGISTER_TAG_ALIAS( <alias string>, <tag expression> )
+    CATCH_REGISTER_TAG_ALIAS( <alias string>, <tag expression> )
 
 Aliases must begin with the `@` character. An example of a tag alias is:
 
-	CATCH_REGISTER_TAG_ALIAS( "[@nhf]", "[failing]~[.]" )
+    CATCH_REGISTER_TAG_ALIAS( "[@nhf]", "[failing]~[.]" )
 
 Now when `[@nhf]` is used on the command line this matches all tests that are tagged `[failing]`, but which are not also hidden.
 
@@ -74,15 +84,192 @@ This macro maps onto ```TEST_CASE``` and works in the same way, except that the
 
 These macros map onto ```SECTION```s except that the section names are the _something_s prefixed by "given: ", "when: " or "then: " respectively.
 
+* **AND_GIVEN(** _something_ **)**
 * **AND_WHEN(** _something_ **)**
 * **AND_THEN(** _something_ **)**
 
-Similar to ```WHEN``` and ```THEN``` except that the prefixes start with "and ". These are used to chain ```WHEN```s and ```THEN```s together.
+Similar to ```GIVEN```, ```WHEN``` and ```THEN``` except that the prefixes start with "and ". These are used to chain ```GIVEN```s, ```WHEN```s and ```THEN```s together.
+
+> `AND_GIVEN` was [introduced](https://github.com/catchorg/Catch2/issues/1360) in Catch 2.4.0.
 
 When any of these macros are used the console reporter recognises them and formats the test case header such that the Givens, Whens and Thens are aligned to aid readability.
 
 Other than the additional prefixes and the formatting in the console reporter these macros behave exactly as ```TEST_CASE```s and ```SECTION```s. As such there is nothing enforcing the correct sequencing of these macros - that's up to the programmer!
 
+## Type parametrised test cases
+
+In addition to `TEST_CASE`s, Catch2 also supports test cases parametrised
+by types, in the form of `TEMPLATE_TEST_CASE`,
+`TEMPLATE_PRODUCT_TEST_CASE` and `TEMPLATE_LIST_TEST_CASE`.
+
+* **TEMPLATE_TEST_CASE(** _test name_ , _tags_,  _type1_, _type2_, ..., _typen_ **)**
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1437) in Catch 2.5.0.
+
+_test name_ and _tag_ are exactly the same as they are in `TEST_CASE`,
+with the difference that the tag string must be provided (however, it
+can be empty). _type1_ through _typen_ is the list of types for which
+this test case should run, and, inside the test code, the current type
+is available as the `TestType` type.
+
+Because of limitations of the C++ preprocessor, if you want to specify
+a type with multiple template parameters, you need to enclose it in
+parentheses, e.g. `std::map<int, std::string>` needs to be passed as
+`(std::map<int, std::string>)`.
+
+Example:
+```cpp
+TEMPLATE_TEST_CASE( "vectors can be sized and resized", "[vector][template]", int, std::string, (std::tuple<int,float>) ) {
+
+    std::vector<TestType> v( 5 );
+
+    REQUIRE( v.size() == 5 );
+    REQUIRE( v.capacity() >= 5 );
+
+    SECTION( "resizing bigger changes size and capacity" ) {
+        v.resize( 10 );
+
+        REQUIRE( v.size() == 10 );
+        REQUIRE( v.capacity() >= 10 );
+    }
+    SECTION( "resizing smaller changes size but not capacity" ) {
+        v.resize( 0 );
+
+        REQUIRE( v.size() == 0 );
+        REQUIRE( v.capacity() >= 5 );
+
+        SECTION( "We can use the 'swap trick' to reset the capacity" ) {
+            std::vector<TestType> empty;
+            empty.swap( v );
+
+            REQUIRE( v.capacity() == 0 );
+        }
+    }
+    SECTION( "reserving smaller does not change size or capacity" ) {
+        v.reserve( 0 );
+
+        REQUIRE( v.size() == 5 );
+        REQUIRE( v.capacity() >= 5 );
+    }
+}
+```
+
+* **TEMPLATE_PRODUCT_TEST_CASE(** _test name_ , _tags_, (_template-type1_, _template-type2_, ..., _template-typen_), (_template-arg1_, _template-arg2_, ..., _template-argm_) **)**
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1468) in Catch 2.6.0.
+
+_template-type1_ through _template-typen_ is list of template template
+types which should be combined with each of _template-arg1_ through
+ _template-argm_, resulting in _n * m_ test cases. Inside the test case,
+the resulting type is available under the name of `TestType`.
+
+To specify more than 1 type as a single _template-type_ or _template-arg_,
+you must enclose the types in an additional set of parentheses, e.g.
+`((int, float), (char, double))` specifies 2 template-args, each
+consisting of 2 concrete types (`int`, `float` and `char`, `double`
+respectively). You can also omit the outer set of parentheses if you
+specify only one type as the full set of either the _template-types_,
+or the _template-args_.
+
+
+Example:
+```cpp
+template< typename T>
+struct Foo {
+    size_t size() {
+        return 0;
+    }
+};
+
+TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) {
+    TestType x;
+    REQUIRE(x.size() == 0);
+}
+```
+
+You can also have different arities in the _template-arg_ packs:
+```cpp
+TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
+    TestType x;
+    REQUIRE(std::tuple_size<TestType>::value >= 1);
+}
+```
+
+_While there is an upper limit on the number of types you can specify
+in single `TEMPLATE_TEST_CASE` or `TEMPLATE_PRODUCT_TEST_CASE`, the limit
+is very high and should not be encountered in practice._
+
+* **TEMPLATE_LIST_TEST_CASE(** _test name_, _tags_, _type list_ **)**
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1627) in Catch 2.9.0.
+
+_type list_ is a generic list of types on which test case should be instantiated.
+List can be `std::tuple`, `boost::mpl::list`, `boost::mp11::mp_list` or anything with
+`template <typename...>` signature.
+
+This allows you to reuse the _type list_ in multiple test cases.
+
+Example:
+```cpp
+using MyTypes = std::tuple<int, char, float>;
+TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
+{
+    REQUIRE(sizeof(TestType) > 0);
+}
+```
+
+
+## Signature based parametrised test cases
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch 2.8.0.
+
+In addition to [type parametrised test cases](#type-parametrised-test-cases) Catch2 also supports
+signature base parametrised test cases, in form of `TEMPLATE_TEST_CASE_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_SIG`.
+These test cases have similar syntax like [type parametrised test cases](#type-parametrised-test-cases), with one
+additional positional argument which specifies the signature.
+
+### Signature
+Signature has some strict rules for these tests cases to work properly:
+* signature with multiple template parameters e.g. `typename T, size_t S` must have this format in test case declaration
+  `((typename T, size_t S), T, S)`
+* signature with variadic template arguments e.g. `typename T, size_t S, typename...Ts` must have this format in test case declaration
+  `((typename T, size_t S, typename...Ts), T, S, Ts...)`
+* signature with single non type template parameter e.g. `int V` must have this format in test case declaration `((int V), V)`
+* signature with single type template parameter e.g. `typename T` should not be used as it is in fact `TEMPLATE_TEST_CASE`
+
+Currently Catch2 support up to 11 template parameters in signature
+
+### Examples
+
+* **TEMPLATE_TEST_CASE_SIG(** _test name_ , _tags_,  _signature_, _type1_, _type2_, ..., _typen_ **)**
+
+Inside `TEMPLATE_TEST_CASE_SIG` test case you can use the names of template parameters as defined in _signature_. 
+
+```cpp
+TEMPLATE_TEST_CASE_SIG("TemplateTestSig: arrays can be created from NTTP arguments", "[vector][template][nttp]",
+  ((typename T, int V), T, V), (int,5), (float,4), (std::string,15), ((std::tuple<int, float>), 6)) {
+
+    std::array<T, V> v;
+    REQUIRE(v.size() > 1);
+}
+```
+
+* **TEMPLATE_PRODUCT_TEST_CASE_SIG(** _test name_ , _tags_, _signature_, (_template-type1_, _template-type2_, ..., _template-typen_), (_template-arg1_, _template-arg2_, ..., _template-argm_) **)**
+
+```cpp
+
+template<typename T, size_t S>
+struct Bar {
+    size_t size() { return S; }
+};
+
+TEMPLATE_PRODUCT_TEST_CASE_SIG("A Template product test case with array signature", "[template][product][nttp]", ((typename T, size_t S), T, S), (std::array, Bar), ((int, 9), (float, 42))) {
+    TestType x;
+    REQUIRE(x.size() > 0);
+}
+```
+
+
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 112 - 1
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/test-fixtures.md

@@ -1,3 +1,8 @@
+<a id="top"></a>
+# Test fixtures
+
+## Defining test fixtures
+
 Although Catch allows you to group tests together as sections within a test case, it can still be convenient, sometimes, to group them using a more traditional test fixture. Catch fully supports this too. You define the test fixture as a simple structure:
 
 ```c++
@@ -27,6 +32,112 @@ class UniqueTestsFixture {
 
 The two test cases here will create uniquely-named derived classes of UniqueTestsFixture and thus can access the `getID()` protected method and `conn` member variables. This ensures that both the test cases are able to create a DBConnection using the same method (DRY principle) and that any ID's created are unique such that the order that tests are executed does not matter.
 
+
+Catch2 also provides `TEMPLATE_TEST_CASE_METHOD` and
+`TEMPLATE_PRODUCT_TEST_CASE_METHOD` that can be used together
+with templated fixtures and templated template fixtures to perform
+tests for multiple different types. Unlike `TEST_CASE_METHOD`,
+`TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD` do
+require the tag specification to be non-empty, as it is followed by
+further macro arguments.
+
+Also note that, because of limitations of the C++ preprocessor, if you
+want to specify a type with multiple template parameters, you need to
+enclose it in parentheses, e.g. `std::map<int, std::string>` needs to be
+passed as `(std::map<int, std::string>)`.
+In the case of `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, if a member of the
+type list should consist of more than single type, it needs to be enclosed
+in another pair of parentheses, e.g. `(std::map, std::pair)` and
+`((int, float), (char, double))`.
+
+Example:
+```cpp
+template< typename T >
+struct Template_Fixture {
+    Template_Fixture(): m_a(1) {}
+
+    T m_a;
+};
+
+TEMPLATE_TEST_CASE_METHOD(Template_Fixture,"A TEMPLATE_TEST_CASE_METHOD based test run that succeeds", "[class][template]", int, float, double) {
+    REQUIRE( Template_Fixture<TestType>::m_a == 1 );
+}
+
+template<typename T>
+struct Template_Template_Fixture {
+    Template_Template_Fixture() {}
+
+    T m_a;
+};
+
+template<typename T>
+struct Foo_class {
+    size_t size() {
+        return 0;
+    }
+};
+
+TEMPLATE_PRODUCT_TEST_CASE_METHOD(Template_Template_Fixture, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test succeeds", "[class][template]", (Foo_class, std::vector), int) {
+    REQUIRE( Template_Template_Fixture<TestType>::m_a.size() == 0 );
+}
+```
+
+_While there is an upper limit on the number of types you can specify
+in single `TEMPLATE_TEST_CASE_METHOD` or `TEMPLATE_PRODUCT_TEST_CASE_METHOD`,
+the limit is very high and should not be encountered in practice._
+
+## Signature-based parametrised test fixtures
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch 2.8.0.
+
+Catch2 also provides `TEMPLATE_TEST_CASE_METHOD_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG` to support
+fixtures using non-type template parameters. These test cases work similar to `TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD`,
+with additional positional argument for [signature](test-cases-and-sections.md#signature-based-parametrised-test-cases).
+
+Example:
+```cpp
+template <int V>
+struct Nttp_Fixture{
+    int value = V;
+};
+
+TEMPLATE_TEST_CASE_METHOD_SIG(Nttp_Fixture, "A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds", "[class][template][nttp]",((int V), V), 1, 3, 6) {
+    REQUIRE(Nttp_Fixture<V>::value > 0);
+}
+
+template<typename T>
+struct Template_Fixture_2 {
+    Template_Fixture_2() {}
+
+    T m_a;
+};
+
+template< typename T, size_t V>
+struct Template_Foo_2 {
+    size_t size() { return V; }
+};
+
+TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(Template_Fixture_2, "A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds", "[class][template][product][nttp]", ((typename T, size_t S), T, S),(std::array, Template_Foo_2), ((int,2), (float,6)))
+{
+    REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() >= 2);
+}
+```
+
+## Template fixtures with types specified in template type lists
+
+Catch2 also provides `TEMPLATE_LIST_TEST_CASE_METHOD` to support template fixtures with types specified in
+template type lists like `std::tuple`, `boost::mpl::list` or `boost::mp11::mp_list`. This test case works the same as `TEMPLATE_TEST_CASE_METHOD`,
+only difference is the source of types. This allows you to reuse the template type list in multiple test cases.
+
+Example:
+```cpp
+using MyTypes = std::tuple<int, char, double>;
+TEMPLATE_LIST_TEST_CASE_METHOD(Template_Fixture, "Template test case method with test types specified inside std::tuple", "[class][template][list]", MyTypes)
+{
+    REQUIRE( Template_Fixture<TestType>::m_a == 1 );
+}
+```
+
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 97 - 27
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/tostring.md

@@ -1,62 +1,132 @@
+<a id="top"></a>
 # String conversions
 
+**Contents**<br>
+[operator << overload for std::ostream](#operator--overload-for-stdostream)<br>
+[Catch::StringMaker specialisation](#catchstringmaker-specialisation)<br>
+[Catch::is_range specialisation](#catchis_range-specialisation)<br>
+[Exceptions](#exceptions)<br>
+[Enums](#enums)<br>
+[Floating point precision](#floating-point-precision)<br>
+
+
 Catch needs to be able to convert types you use in assertions and logging expressions into strings (for logging and reporting purposes).
-Most built-in or std types are supported out of the box but there are three ways that you can tell Catch how to convert your own types (or other, third-party types) into strings.
+Most built-in or std types are supported out of the box but there are two ways that you can tell Catch how to convert your own types (or other, third-party types) into strings.
 
 ## operator << overload for std::ostream
 
 This is the standard way of providing string conversions in C++ - and the chances are you may already provide this for your own purposes. If you're not familiar with this idiom it involves writing a free function of the form:
 
-```
+```cpp
 std::ostream& operator << ( std::ostream& os, T const& value ) {
-	os << convertMyTypeToString( value );
-	return os;
+    os << convertMyTypeToString( value );
+    return os;
 }
 ```
 
 (where ```T``` is your type and ```convertMyTypeToString``` is where you'll write whatever code is necessary to make your type printable - it doesn't have to be in another function).
 
-You should put this function in the same namespace as your type and it has to be declared before including Catch's header.
-
-## Catch::toString overload
+You should put this function in the same namespace as your type, or the global namespace, and have it declared before including Catch's header.
 
-If you don't want to provide an ```operator <<``` overload, or you want to convert your type differently for testing purposes, you can provide an overload for ```Catch::toString()``` for your type.
+## Catch::StringMaker specialisation
+If you don't want to provide an ```operator <<``` overload, or you want to convert your type differently for testing purposes, you can provide a specialization for `Catch::StringMaker<T>`:
 
-```
+```cpp
 namespace Catch {
-	std::string toString( T const& value ) {
-		return convertMyTypeToString( value );
-	}
+    template<>
+    struct StringMaker<T> {
+        static std::string convert( T const& value ) {
+            return convertMyTypeToString( value );
+        }
+    };
 }
 ```
 
-Again ```T``` is your type and ```convertMyTypeToString``` is where you'll write whatever code is necessary to make your type printable. Note that the function must be in the Catch namespace, which itself must be in the global namespace and must be declared _before_ Catch's header is included.
-
-**Please note that overloading `Catch::toString` is currently considered legacy and will not be supported in the next major version of Catch.**
+## Catch::is_range specialisation
+As a fallback, Catch attempts to detect if the type can be iterated
+(`begin(T)` and `end(T)` are valid) and if it can be, it is stringified
+as a range. For certain types this can lead to infinite recursion, so
+it can be disabled by specializing `Catch::is_range` like so:
 
-## Catch::StringMaker<T> specialisation
-Another way of telling Catch how to convert a type to string is specialising `Catch::StringMaker` template. This allows you to have separate way of stringifying types for Catch, than you have for writing it to a stream and also doesn't require you to declare it before including Catch's header.
-
-```
+```cpp
 namespace Catch {
-	template<> struct StringMaker<T> {
-    	static std::string convert( T const& value ) {
-        	return convertMyTypeToString( value ); 
-        } 
-    }; 
+    template<>
+    struct is_range<T> {
+        static const bool value = false;
+    };
 }
+
 ```
 
+
 ## Exceptions
 
 By default all exceptions deriving from `std::exception` will be translated to strings by calling the `what()` method. For exception types that do not derive from `std::exception` - or if `what()` does not return a suitable string - use `CATCH_TRANSLATE_EXCEPTION`. This defines a function that takes your exception type, by reference, and returns a string. It can appear anywhere in the code - it doesn't have to be in the same translation unit. For example:
 
-```
+```cpp
 CATCH_TRANSLATE_EXCEPTION( MyType& ex ) {
-	return ex.message();
+    return ex.message();
+}
+```
+
+## Enums
+
+> Introduced in Catch 2.8.0.
+
+Enums that already have a `<<` overload for `std::ostream` will convert to strings as expected.
+If you only need to convert enums to strings for test reporting purposes you can provide a `StringMaker` specialisations as any other type.
+However, as a convenience, Catch provides the `REGISTER_ENUM` helper macro that will generate the `StringMaker` specialiation for you with minimal code.
+Simply provide it the (qualified) enum name, followed by all the enum values, and you're done!
+
+E.g.
+
+```cpp
+enum class Fruits { Banana, Apple, Mango };
+
+CATCH_REGISTER_ENUM( Fruits, Fruits::Banana, Fruits::Apple, Fruits::Mango )
+
+TEST_CASE() {
+    REQUIRE( Fruits::Mango == Fruits::Apple );
+}
+```
+
+... or if the enum is in a namespace:
+```cpp
+namespace Bikeshed {
+    enum class Colours { Red, Green, Blue };
+}
+
+// Important!: This macro must appear at top level scope - not inside a namespace
+// You can fully qualify the names, or use a using if you prefer
+CATCH_REGISTER_ENUM( Bikeshed::Colours,
+    Bikeshed::Colours::Red,
+    Bikeshed::Colours::Green,
+    Bikeshed::Colours::Blue )
+
+TEST_CASE() {
+    REQUIRE( Bikeshed::Colours::Red == Bikeshed::Colours::Blue );
 }
 ```
 
+## Floating point precision
+
+> [Introduced](https://github.com/catchorg/Catch2/issues/1614) in Catch 2.8.0.
+
+Catch provides a built-in `StringMaker` specialization for both `float`
+and `double`. By default, it uses what we think is a reasonable precision,
+but you can customize it by modifying the `precision` static variable
+inside the `StringMaker` specialization, like so:
+
+```cpp
+        Catch::StringMaker<float>::precision = 15;
+        const float testFloat1 = 1.12345678901234567899f;
+        const float testFloat2 = 1.12345678991234567899f;
+        REQUIRE(testFloat1 == testFloat2);
+```
+
+This assertion will fail and print out the `testFloat1` and `testFloat2`
+to 15 decimal places.
+
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 66 - 36
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/tutorial.md

@@ -1,19 +1,38 @@
-# Getting Catch
+<a id="top"></a>
+# Tutorial
 
-The simplest way to get Catch is to download the latest [single header version](https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp). The single header is generated by merging a set of individual headers but it is still just normal source code in a header file.
+**Contents**<br>
+[Getting Catch2](#getting-catch2)<br>
+[Where to put it?](#where-to-put-it)<br>
+[Writing tests](#writing-tests)<br>
+[Test cases and sections](#test-cases-and-sections)<br>
+[BDD-Style](#bdd-style)<br>
+[Scaling up](#scaling-up)<br>
+[Type parametrised test cases](#type-parametrised-test-cases)<br>
+[Next steps](#next-steps)<br>
 
-The full source for Catch, including test projects, documentation, and other things, is hosted on GitHub. [http://catch-lib.net](http://catch-lib.net) will redirect you there.
+## Getting Catch2
+
+The simplest way to get Catch2 is to download the latest [single header version](https://raw.githubusercontent.com/catchorg/Catch2/master/single_include/catch2/catch.hpp). The single header is generated by merging a set of individual headers but it is still just normal source code in a header file.
+
+Alternative ways of getting Catch2 include using your system package
+manager, or installing it using [its CMake package](cmake-integration.md#installing-catch2-from-git-repository).
+
+The full source for Catch2, including test projects, documentation, and other things, is hosted on GitHub. [http://catch-lib.net](http://catch-lib.net) will redirect you there.
 
 
 ## Where to put it?
 
-Catch is header only. All you need to do is drop the file(s) somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi.html). 
+Catch2 is header only. All you need to do is drop the file somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use Catch for their test suite. See [this blog entry for more on that](https://levelofindirection.com/blog/unit-testing-in-cpp-and-objective-c-just-got-ridiculously-easier-still.html).
 
-The rest of this tutorial will assume that the Catch single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary.
+The rest of this tutorial will assume that the Catch2 single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary.
 
-# Writing tests
+_If you have installed Catch2 from system package manager, or CMake
+package, you need to include the header as `#include <catch2/catch.hpp>`_
 
-Let's start with a really simple example. Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). 
+## Writing tests
+
+Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now).
 
 ```c++
 unsigned int Factorial( unsigned int number ) {
@@ -21,7 +40,7 @@ unsigned int Factorial( unsigned int number ) {
 }
 ```
 
-To keep things simple we'll put everything in a single file (<a href="#scaling-up">see later for more on how to structure your test files</a>)
+To keep things simple we'll put everything in a single file (<a href="#scaling-up">see later for more on how to structure your test files</a>).
 
 ```c++
 #define CATCH_CONFIG_MAIN  // This tells Catch to provide a main() - only do this in one cpp file
@@ -39,7 +58,7 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) {
 }
 ```
 
-This will compile to a complete executable which responds to [command line arguments](command-line.md). If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work").
+This will compile to a complete executable which responds to [command line arguments](command-line.md#top). If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work").
 
 If you run this as written it will pass. Everything is good. Right?
 Well, there is still a bug here. In fact the first version of this tutorial I posted here genuinely had the bug in! So it's not completely contrived (thanks to Daryle Walker (```@CTMacUser```) for pointing this out).
@@ -82,12 +101,12 @@ Now all the tests pass.
 
 Of course there are still more issues to deal with. For example we'll hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. You might want to add tests for such cases and decide how to handle them. We'll stop short of doing that here.
 
-## What did we do here?
+### What did we do here?
 
-Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take moment to consider those before we move on.
+Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take a moment to consider those before we move on.
 
-1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md)).
-2. We introduce test cases with the ```TEST_CASE``` macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#test-cases-and-sections">Test cases and Sections</a>, ). The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md) for more information on running tests.
+1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md#top). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md#top)).
+2. We introduce test cases with the ```TEST_CASE``` macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#test-cases-and-sections">Test cases and Sections</a>, ). The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md#top) for more information on running tests.
 3. The name and tags arguments are just strings. We haven't had to declare a function or method - or explicitly register the test case anywhere. Behind the scenes a function with a generated name is defined for you, and automatically registered using static registry classes. By abstracting the function name away we can name our tests without the constraints of identifier names.
 4. We write our individual test assertions using the ```REQUIRE``` macro. Rather than a separate macro for each type of condition we express the condition naturally using C/C++ syntax. Behind the scenes a simple set of expression templates captures the left-hand-side and right-hand-side of the expression so we can display the values in our test report. As we'll see later there _are_ other assertion macros - but because of this technique the number of them is drastically reduced.
 
@@ -98,37 +117,37 @@ Most test frameworks have a class-based fixture mechanism. That is, test cases m
 
 While Catch fully supports this way of working there are a few problems with the approach. In particular the way your code must be split up, and the blunt granularity of it, may cause problems. You can only have one setup/ teardown pair across a set of methods, but sometimes you want slightly different setup in each method, or you may even want several levels of setup (a concept which we will clarify later on in this tutorial). It was <a href="http://jamesnewkirk.typepad.com/posts/2007/09/why-you-should-.html">problems like these</a> that led James Newkirk, who led the team that built NUnit, to start again from scratch and <a href="http://jamesnewkirk.typepad.com/posts/2007/09/announcing-xuni.html">build xUnit</a>).
 
-Catch takes a different approach (to both NUnit and xUnit) that is a more natural fit for C++ and the C family of languages. This is best explained through an example:
+Catch takes a different approach (to both NUnit and xUnit) that is a more natural fit for C++ and the C family of languages. This is best explained through an example ([code](../examples/100-Fix-Section.cpp)):
 
 ```c++
 TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
 
     std::vector<int> v( 5 );
-    
+
     REQUIRE( v.size() == 5 );
     REQUIRE( v.capacity() >= 5 );
-    
+
     SECTION( "resizing bigger changes size and capacity" ) {
         v.resize( 10 );
-        
+
         REQUIRE( v.size() == 10 );
         REQUIRE( v.capacity() >= 10 );
     }
     SECTION( "resizing smaller changes size but not capacity" ) {
         v.resize( 0 );
-        
+
         REQUIRE( v.size() == 0 );
         REQUIRE( v.capacity() >= 5 );
     }
     SECTION( "reserving bigger changes capacity but not size" ) {
         v.reserve( 10 );
-        
+
         REQUIRE( v.size() == 5 );
         REQUIRE( v.capacity() >= 10 );
     }
     SECTION( "reserving smaller does not change size or capacity" ) {
         v.reserve( 0 );
-        
+
         REQUIRE( v.size() == 5 );
         REQUIRE( v.capacity() >= 5 );
     }
@@ -140,18 +159,18 @@ This works because the ```SECTION``` macro contains an if statement that calls b
 
 So far so good - this is already an improvement on the setup/teardown approach because now we see our setup code inline and use the stack.
 
-The power of sections really shows, however, when we need to execute a sequence of, checked, operations. Continuing the vector example, we might want to verify that attempting to reserve a capacity smaller than the current capacity of the vector changes nothing. We can do that, naturally, like so:
+The power of sections really shows, however, when we need to execute a sequence of checked operations. Continuing the vector example, we might want to verify that attempting to reserve a capacity smaller than the current capacity of the vector changes nothing. We can do that, naturally, like so:
 
 ```c++
     SECTION( "reserving bigger changes capacity but not size" ) {
         v.reserve( 10 );
-        
+
         REQUIRE( v.size() == 5 );
         REQUIRE( v.capacity() >= 10 );
-    
+
         SECTION( "reserving smaller again does not change capacity" ) {
             v.reserve( 7 );
-            
+
             REQUIRE( v.capacity() >= 10 );
         }
     }
@@ -161,22 +180,22 @@ Sections can be nested to an arbitrary depth (limited only by your stack size).
 
 ## BDD-Style
 
-If you name your test cases and sections appropriately you can achieve a BDD-style specification structure. This became such a useful way of working that first class support has been added to Catch. Scenarios can be specified using ```SCENARIO```, ```GIVEN```, ```WHEN``` and ```THEN``` macros, which map on to ```TEST_CASE```s and ```SECTION```s, respectively. For more details see [Test cases and sections](test-cases-and-sections.md).
+If you name your test cases and sections appropriately you can achieve a BDD-style specification structure. This became such a useful way of working that first class support has been added to Catch. Scenarios can be specified using ```SCENARIO```, ```GIVEN```, ```WHEN``` and ```THEN``` macros, which map on to ```TEST_CASE```s and ```SECTION```s, respectively. For more details see [Test cases and sections](test-cases-and-sections.md#top).
 
-The vector example can be adjusted to use these macros like so:
+The vector example can be adjusted to use these macros like so ([example code](../examples/120-Bdd-ScenarioGivenWhenThen.cpp)):
 
 ```c++
 SCENARIO( "vectors can be sized and resized", "[vector]" ) {
 
     GIVEN( "A vector with some items" ) {
         std::vector<int> v( 5 );
-        
+
         REQUIRE( v.size() == 5 );
         REQUIRE( v.capacity() >= 5 );
-        
+
         WHEN( "the size is increased" ) {
             v.resize( 10 );
-            
+
             THEN( "the size and capacity change" ) {
                 REQUIRE( v.size() == 10 );
                 REQUIRE( v.capacity() >= 10 );
@@ -184,7 +203,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) {
         }
         WHEN( "the size is reduced" ) {
             v.resize( 0 );
-            
+
             THEN( "the size changes but not capacity" ) {
                 REQUIRE( v.size() == 0 );
                 REQUIRE( v.capacity() >= 5 );
@@ -192,7 +211,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) {
         }
         WHEN( "more capacity is reserved" ) {
             v.reserve( 10 );
-            
+
             THEN( "the capacity changes but not the size" ) {
                 REQUIRE( v.size() == 5 );
                 REQUIRE( v.capacity() >= 10 );
@@ -200,7 +219,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) {
         }
         WHEN( "less capacity is reserved" ) {
             v.reserve( 0 );
-            
+
             THEN( "neither size nor capacity are changed" ) {
                 REQUIRE( v.size() == 5 );
                 REQUIRE( v.capacity() >= 5 );
@@ -224,7 +243,7 @@ Scenario: vectors can be sized and resized
 
 To keep the tutorial simple we put all our code in a single file. This is fine to get started - and makes jumping into Catch even quicker and easier. As you write more real-world tests, though, this is not really the best approach.
 
-The requirement is that the following block of code ([or equivalent](own-main.md)):
+The requirement is that the following block of code ([or equivalent](own-main.md#top)):
 
 ```c++
 #define CATCH_CONFIG_MAIN
@@ -233,17 +252,28 @@ The requirement is that the following block of code ([or equivalent](own-main.md
 
 appears in _exactly one_ source file. Use as many additional cpp files (or whatever you call your implementation files) as you need for your tests, partitioned however makes most sense for your way of working. Each additional file need only ```#include "catch.hpp"``` - do not repeat the ```#define```!
 
-In fact it is usually a good idea to put the block with the ```#define``` [in its own source file](slow-compiles.md).
+In fact it is usually a good idea to put the block with the ```#define``` [in its own source file](slow-compiles.md#top) (code example [main](../examples/020-TestCase-1.cpp), [tests](../examples/020-TestCase-2.cpp)).
 
 Do not write your tests in header files!
 
 
+## Type parametrised test cases
+
+Test cases in Catch2 can be also parametrised by type, via the
+`TEMPLATE_TEST_CASE` and `TEMPLATE_PRODUCT_TEST_CASE` macros,
+which behave in the same way the `TEST_CASE` macro, but are run for
+every type or type combination.
+
+For more details, see our documentation on [test cases and
+sections](test-cases-and-sections.md#type-parametrised-test-cases).
+
+
 ## Next steps
 
 This has been a brief introduction to get you up and running with Catch, and to point out some of the key differences between Catch and other frameworks you may already be familiar with. This will get you going quite far already and you are now in a position to dive in and write some tests.
 
-Of course there is more to learn - most of which you should be able to page-fault in as you go. Please see the ever-growing [Reference section](Readme.md) for what's available.
+Of course there is more to learn - most of which you should be able to page-fault in as you go. Please see the ever-growing [Reference section](Readme.md#top) for what's available.
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 18 - 18
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/docs/why-catch.md

@@ -1,46 +1,46 @@
+<a id="top"></a>
 # Why do we need yet another C++ test framework?
 
-Good question. For C++ there are quite a number of established frameworks, including (but not limited to), [CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page), [Google Test](http://code.google.com/p/googletest/), [Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html), [Aeryn](https://launchpad.net/aeryn), [Cute](http://r2.ifs.hsr.ch/cute), [Fructose](http://fructose.sourceforge.net/) and [many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B). Even for Objective-C there are a few, including OCUnit - which now comes bundled with XCode.
+Good question. For C++ there are quite a number of established frameworks,
+including (but not limited to),
+[Google Test](http://code.google.com/p/googletest/),
+[Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html),
+[CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page),
+[Cute](http://www.cute-test.com),
+[many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B).
 
 So what does Catch bring to the party that differentiates it from these? Apart from a Catchy name, of course.
 
 ## Key Features
 
-* Really easy to get started. Just download catch.hpp, #include it and you're away. 
-* No external dependencies. As long as you can compile C++98 and have a C++ standard library available.
-* Write test cases as, self-registering, functions or methods.
-* Divide test cases into sections, each of which is run in isolation (eliminates the need for fixtures!)
+* Quick and Really easy to get started. Just download catch.hpp, `#include` it and you're away.
+* No external dependencies. As long as you can compile C++11 and have a C++ standard library available.
+* Write test cases as, self-registering, functions (or methods, if you prefer).
+* Divide test cases into sections, each of which is run in isolation (eliminates the need for fixtures).
 * Use BDD-style Given-When-Then sections as well as traditional unit test cases.
 * Only one core assertion macro for comparisons. Standard C/C++ operators are used for the comparison - yet the full expression is decomposed and lhs and rhs values are logged.
+* Tests are named using free-form strings - no more couching names in legal identifiers.
 
 ## Other core features
 
-* Tests are named using free-form strings - no more couching names in legal identifiers.
 * Tests can be tagged for easily running ad-hoc groups of tests.
 * Failures can (optionally) break into the debugger on Windows and Mac.
 * Output is through modular reporter objects. Basic textual and XML reporters are included. Custom reporters can easily be added.
 * JUnit xml output is supported for integration with third-party tools, such as CI servers.
-* A default main() function is provided (in a header), but you can supply your own for complete control (e.g. integration into your own test runner GUI).
+* A default main() function is provided, but you can supply your own for complete control (e.g. integration into your own test runner GUI).
 * A command line parser is provided and can still be used if you choose to provided your own main() function.
 * Catch can test itself.
 * Alternative assertion macro(s) report failures but don't abort the test case
 * Floating point tolerance comparisons are built in using an expressive Approx() syntax.
 * Internal and friendly macros are isolated so name clashes can be managed
-* Support for Matchers (early stages)
-
-## Objective-C-specific features
-
-* Automatically detects if you are using it from an Objective-C project
-* Works with and without ARC with no additional configuration
-* Implement test fixtures using Obj-C classes too (like OCUnit)
-* Additional built in matchers that work with Obj-C types (e.g. string matchers)
+* Matchers
 
 ## Who else is using Catch?
 
-See the list of [open source projects using Catch](opensource-users.md).
+See the list of [open source projects using Catch](opensource-users.md#top).
 
-See the [tutorial](tutorial.md) to get more of a taste of using CATCH in practice 
+See the [tutorial](tutorial.md#top) to get more of a taste of using Catch in practice 
 
 ---
 
-[Home](Readme.md)
+[Home](Readme.md#top)

+ 371 - 139
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/catch.hpp

@@ -9,6 +9,10 @@
 #ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_HPP_INCLUDED
 
+#define CATCH_VERSION_MAJOR 2
+#define CATCH_VERSION_MINOR 10
+#define CATCH_VERSION_PATCH 0
+
 #ifdef __clang__
 #    pragma clang system_header
 #elif defined __GNUC__
@@ -19,8 +23,24 @@
 
 #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
 #  define CATCH_IMPL
+#  define CATCH_CONFIG_ALL_PARTS
+#endif
+
+// In the impl file, we want to have access to all parts of the headers
+// Can also be used to sanely support PCHs
+#if defined(CATCH_CONFIG_ALL_PARTS)
+#  define CATCH_CONFIG_EXTERNAL_INTERFACES
+#  if defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#    undef CATCH_CONFIG_DISABLE_MATCHERS
+#  endif
+#  if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
+#    define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
+#  endif
 #endif
 
+#if !defined(CATCH_CONFIG_IMPL_ONLY)
+#include "internal/catch_platform.h"
+
 #ifdef CATCH_IMPL
 #  ifndef CLARA_CONFIG_MAIN
 #    define CLARA_CONFIG_MAIN_NOT_DEFINED
@@ -28,18 +48,22 @@
 #  endif
 #endif
 
-#include "internal/catch_notimplemented_exception.h"
-#include "internal/catch_context.h"
-#include "internal/catch_test_registry.hpp"
+#include "internal/catch_user_interfaces.h"
+#include "internal/catch_tag_alias_autoregistrar.h"
+#include "internal/catch_test_registry.h"
 #include "internal/catch_capture.hpp"
 #include "internal/catch_section.h"
-#include "internal/catch_generators.hpp"
 #include "internal/catch_interfaces_exception.h"
-#include "internal/catch_approx.hpp"
-#include "internal/catch_matchers_string.h"
-#include "internal/catch_matchers_vector.h"
+#include "internal/catch_approx.h"
 #include "internal/catch_compiler_capabilities.h"
-#include "internal/catch_interfaces_tag_alias_registry.h"
+#include "internal/catch_string_manip.h"
+
+#ifndef CATCH_CONFIG_DISABLE_MATCHERS
+#include "internal/catch_capture_matchers.h"
+#endif
+#include "internal/catch_generators.hpp"
+#include "internal/catch_generators_generic.hpp"
+#include "internal/catch_generators_specific.hpp"
 
 // These files are included here so the single_include script doesn't put them
 // in the conditionally compiled sections
@@ -50,30 +74,18 @@
 #include "internal/catch_objc.hpp"
 #endif
 
-#ifdef CATCH_IMPL
+// Benchmarking needs the externally-facing parts of reporters to work
+#if defined(CATCH_CONFIG_EXTERNAL_INTERFACES) || defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
+#include "internal/catch_external_interfaces.h"
+#endif
 
-// !TBD: Move the leak detector code into a separate header
-#ifdef CATCH_CONFIG_WINDOWS_CRTDBG
-#include <crtdbg.h>
-class LeakDetector {
-public:
-    LeakDetector() {
-        int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
-        flag |= _CRTDBG_LEAK_CHECK_DF;
-        flag |= _CRTDBG_ALLOC_MEM_DF;
-        _CrtSetDbgFlag(flag);
-        _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
-        _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
-        // Change this to leaking allocation's number to break there
-        _CrtSetBreakAlloc(-1);
-    }
-};
-#else
-class LeakDetector {};
+#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
+#include "internal/benchmark/catch_benchmark.hpp"
 #endif
 
-LeakDetector leakDetector;
+#endif // ! CATCH_CONFIG_IMPL_ONLY
 
+#ifdef CATCH_IMPL
 #include "internal/catch_impl.hpp"
 #endif
 
@@ -82,183 +94,403 @@ LeakDetector leakDetector;
 #endif
 
 
+#if !defined(CATCH_CONFIG_IMPL_ONLY)
+
 #ifdef CLARA_CONFIG_MAIN_NOT_DEFINED
 #  undef CLARA_CONFIG_MAIN
 #endif
 
+#if !defined(CATCH_CONFIG_DISABLE)
 //////
-
 // If this config identifier is defined then all CATCH macros are prefixed with CATCH_
 #ifdef CATCH_CONFIG_PREFIX_ALL
 
-#if defined(CATCH_CONFIG_FAST_COMPILE)
-#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, expr )
-#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr )
-#else
-#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, expr )
-#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr  )
-#endif
+#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
 
-#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", expr )
+#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
 #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, expr )
-
-#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, expr )
-#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, expr )
-
-#define CATCH_CHECK_THROWS( expr )  INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", expr )
+#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
+#endif// CATCH_CONFIG_DISABLE_MATCHERS
+#define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+
+#define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
+#define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+
+#define CATCH_CHECK_THROWS( ... )  INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
 #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, expr )
+#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+#define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
 
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
 #define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
 
-#if defined(CATCH_CONFIG_FAST_COMPILE)
-#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT_NO_TRY( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#else
 #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif
-
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
 
 #define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
+#define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
 #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
-#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CATCH_CAPTURE", #msg " := " << Catch::toString(msg) )
-#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CATCH_CAPTURE", #msg " := " << Catch::toString(msg) )
-
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
-    #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-    #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-    #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-    #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-    #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-    #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-    #define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-    #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE",__VA_ARGS__ )
+
+#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
+#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
+#define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
+#define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
+#define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
+#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
+#define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+
+#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
+#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
 #else
-    #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
-    #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
-    #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
-    #define CATCH_REGISTER_TEST_CASE( function, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( function, name, description )
-    #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
-    #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, msg )
-    #define CATCH_FAIL_CHECK( msg ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, msg )
-    #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, msg )
+#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
 #endif
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )
 
-#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
-#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
 
-#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
+#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
+#define CATCH_STATIC_REQUIRE( ... )       static_assert(   __VA_ARGS__ ,      #__VA_ARGS__ );     CATCH_SUCCEED( #__VA_ARGS__ )
+#define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
+#else
+#define CATCH_STATIC_REQUIRE( ... )       CATCH_REQUIRE( __VA_ARGS__ )
+#define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ )
+#endif
+
 
 // "BDD-style" convenience wrappers
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
 #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
 #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-#else
-#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags )
-#define CATCH_SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags )
-#endif
-#define CATCH_GIVEN( desc )    CATCH_SECTION( std::string( "Given: ") + desc, "" )
-#define CATCH_WHEN( desc )     CATCH_SECTION( std::string( " When: ") + desc, "" )
-#define CATCH_AND_WHEN( desc ) CATCH_SECTION( std::string( "  And: ") + desc, "" )
-#define CATCH_THEN( desc )     CATCH_SECTION( std::string( " Then: ") + desc, "" )
-#define CATCH_AND_THEN( desc ) CATCH_SECTION( std::string( "  And: ") + desc, "" )
+#define CATCH_GIVEN( desc )     INTERNAL_CATCH_DYNAMIC_SECTION( "    Given: " << desc )
+#define CATCH_AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
+#define CATCH_WHEN( desc )      INTERNAL_CATCH_DYNAMIC_SECTION( "     When: " << desc )
+#define CATCH_AND_WHEN( desc )  INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
+#define CATCH_THEN( desc )      INTERNAL_CATCH_DYNAMIC_SECTION( "     Then: " << desc )
+#define CATCH_AND_THEN( desc )  INTERNAL_CATCH_DYNAMIC_SECTION( "      And: " << desc )
+
+#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
+#define CATCH_BENCHMARK(...) \
+    INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
+#define CATCH_BENCHMARK_ADVANCED(name) \
+    INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
+#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
 
 // If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
 #else
 
-#if defined(CATCH_CONFIG_FAST_COMPILE)
-#define REQUIRE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "REQUIRE", Catch::ResultDisposition::Normal, expr )
-#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr )
-
-#else
-#define REQUIRE( expr ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, expr  )
-#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr )
-#endif
+#define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__  )
+#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
 
-#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", expr )
+#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
 #define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, expr )
-
-#define CHECK( expr ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, expr )
-#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, expr )
-
-#define CHECK_THROWS( expr )  INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", expr )
+#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+
+#define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
+#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+
+#define CHECK_THROWS( ... )  INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
 #define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, expr )
+#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+
 
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
 #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
 
-#if defined(CATCH_CONFIG_FAST_COMPILE)
-#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT_NO_TRY( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#else
 #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif
-
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
 
 #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
+#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
 #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
-#define CAPTURE( msg ) INTERNAL_CATCH_INFO( "CAPTURE", #msg " := " << Catch::toString(msg) )
-#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CAPTURE", #msg " := " << Catch::toString(msg) )
+#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE",__VA_ARGS__ )
 
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
 #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
 #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
 #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
 #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
 #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
+#define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
 #define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
 #define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
 #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
+#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
+#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
 #else
-#define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
-    #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
-    #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
-    #define REGISTER_TEST_CASE( method, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( method, name, description )
-    #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
-    #define FAIL( msg ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, msg )
-    #define FAIL_CHECK( msg ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, msg )
-    #define SUCCEED( msg ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, msg )
+#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
+#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
+#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
+#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
+#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
 #endif
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )
 
-#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
-#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
 
-#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
+#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
+#define STATIC_REQUIRE( ... )       static_assert(   __VA_ARGS__,  #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
+#define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
+#else
+#define STATIC_REQUIRE( ... )       REQUIRE( __VA_ARGS__ )
+#define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ )
+#endif
 
 #endif
 
 #define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
 
 // "BDD-style" convenience wrappers
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
 #define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
 #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
+
+#define GIVEN( desc )     INTERNAL_CATCH_DYNAMIC_SECTION( "    Given: " << desc )
+#define AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
+#define WHEN( desc )      INTERNAL_CATCH_DYNAMIC_SECTION( "     When: " << desc )
+#define AND_WHEN( desc )  INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
+#define THEN( desc )      INTERNAL_CATCH_DYNAMIC_SECTION( "     Then: " << desc )
+#define AND_THEN( desc )  INTERNAL_CATCH_DYNAMIC_SECTION( "      And: " << desc )
+
+#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
+#define BENCHMARK(...) \
+    INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
+#define BENCHMARK_ADVANCED(name) \
+    INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
+#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
+
+using Catch::Detail::Approx;
+
+#else // CATCH_CONFIG_DISABLE
+
+//////
+// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
+#ifdef CATCH_CONFIG_PREFIX_ALL
+
+#define CATCH_REQUIRE( ... )        (void)(0)
+#define CATCH_REQUIRE_FALSE( ... )  (void)(0)
+
+#define CATCH_REQUIRE_THROWS( ... ) (void)(0)
+#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
+#define CATCH_REQUIRE_THROWS_WITH( expr, matcher )     (void)(0)
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+#endif// CATCH_CONFIG_DISABLE_MATCHERS
+#define CATCH_REQUIRE_NOTHROW( ... ) (void)(0)
+
+#define CATCH_CHECK( ... )         (void)(0)
+#define CATCH_CHECK_FALSE( ... )   (void)(0)
+#define CATCH_CHECKED_IF( ... )    if (__VA_ARGS__)
+#define CATCH_CHECKED_ELSE( ... )  if (!(__VA_ARGS__))
+#define CATCH_CHECK_NOFAIL( ... )  (void)(0)
+
+#define CATCH_CHECK_THROWS( ... )  (void)(0)
+#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
+#define CATCH_CHECK_THROWS_WITH( expr, matcher )     (void)(0)
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+#define CATCH_CHECK_NOTHROW( ... ) (void)(0)
+
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CATCH_CHECK_THAT( arg, matcher )   (void)(0)
+
+#define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+
+#define CATCH_INFO( msg )          (void)(0)
+#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
+#define CATCH_WARN( msg )          (void)(0)
+#define CATCH_CAPTURE( msg )       (void)(0)
+
+#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+#define CATCH_METHOD_AS_TEST_CASE( method, ... )
+#define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0)
+#define CATCH_SECTION( ... )
+#define CATCH_DYNAMIC_SECTION( ... )
+#define CATCH_FAIL( ... ) (void)(0)
+#define CATCH_FAIL_CHECK( ... ) (void)(0)
+#define CATCH_SUCCEED( ... ) (void)(0)
+
+#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
+#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
+#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
+#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#else
+#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
+#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
+#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#endif
+
+// "BDD-style" convenience wrappers
+#define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
+#define CATCH_GIVEN( desc )
+#define CATCH_AND_GIVEN( desc )
+#define CATCH_WHEN( desc )
+#define CATCH_AND_WHEN( desc )
+#define CATCH_THEN( desc )
+#define CATCH_AND_THEN( desc )
+
+#define CATCH_STATIC_REQUIRE( ... )       (void)(0)
+#define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0)
+
+// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
 #else
-#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
-#define SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags )
+
+#define REQUIRE( ... )       (void)(0)
+#define REQUIRE_FALSE( ... ) (void)(0)
+
+#define REQUIRE_THROWS( ... ) (void)(0)
+#define REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
+#define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+#define REQUIRE_NOTHROW( ... ) (void)(0)
+
+#define CHECK( ... ) (void)(0)
+#define CHECK_FALSE( ... ) (void)(0)
+#define CHECKED_IF( ... ) if (__VA_ARGS__)
+#define CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
+#define CHECK_NOFAIL( ... ) (void)(0)
+
+#define CHECK_THROWS( ... )  (void)(0)
+#define CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
+#define CHECK_THROWS_WITH( expr, matcher ) (void)(0)
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+#define CHECK_NOTHROW( ... ) (void)(0)
+
+
+#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
+#define CHECK_THAT( arg, matcher ) (void)(0)
+
+#define REQUIRE_THAT( arg, matcher ) (void)(0)
+#endif // CATCH_CONFIG_DISABLE_MATCHERS
+
+#define INFO( msg ) (void)(0)
+#define UNSCOPED_INFO( msg ) (void)(0)
+#define WARN( msg ) (void)(0)
+#define CAPTURE( msg ) (void)(0)
+
+#define TEST_CASE( ... )  INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+#define METHOD_AS_TEST_CASE( method, ... )
+#define REGISTER_TEST_CASE( Function, ... ) (void)(0)
+#define SECTION( ... )
+#define DYNAMIC_SECTION( ... )
+#define FAIL( ... ) (void)(0)
+#define FAIL_CHECK( ... ) (void)(0)
+#define SUCCEED( ... ) (void)(0)
+#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
+#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
+#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
+#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#else
+#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
+#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
+#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
+#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
+#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+#endif
+
+#define STATIC_REQUIRE( ... )       (void)(0)
+#define STATIC_REQUIRE_FALSE( ... ) (void)(0)
+
 #endif
-#define GIVEN( desc )    SECTION( std::string("   Given: ") + desc, "" )
-#define WHEN( desc )     SECTION( std::string("    When: ") + desc, "" )
-#define AND_WHEN( desc ) SECTION( std::string("And when: ") + desc, "" )
-#define THEN( desc )     SECTION( std::string("    Then: ") + desc, "" )
-#define AND_THEN( desc ) SECTION( std::string("     And: ") + desc, "" )
+
+#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
+
+// "BDD-style" convenience wrappers
+#define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) )
+#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
+
+#define GIVEN( desc )
+#define AND_GIVEN( desc )
+#define WHEN( desc )
+#define AND_WHEN( desc )
+#define THEN( desc )
+#define AND_THEN( desc )
 
 using Catch::Detail::Approx;
 
+
+#endif
+
+#endif // ! CATCH_CONFIG_IMPL_ONLY
+
 #include "internal/catch_reenable_warnings.h"
 
 #endif // TWOBLUECUBES_CATCH_HPP_INCLUDED

+ 0 - 272
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/catch_session.hpp

@@ -1,272 +0,0 @@
-/*
- *  Created by Phil on 31/10/2010.
- *  Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-
-#include "internal/catch_commandline.hpp"
-#include "internal/catch_list.hpp"
-#include "internal/catch_run_context.hpp"
-#include "internal/catch_test_spec.hpp"
-#include "internal/catch_version.h"
-#include "internal/catch_text.h"
-
-#include <fstream>
-#include <stdlib.h>
-#include <limits>
-
-namespace Catch {
-
-    Ptr<IStreamingReporter> createReporter( std::string const& reporterName, Ptr<Config> const& config ) {
-        Ptr<IStreamingReporter> reporter = getRegistryHub().getReporterRegistry().create( reporterName, config.get() );
-        if( !reporter ) {
-            std::ostringstream oss;
-            oss << "No reporter registered with name: '" << reporterName << "'";
-            throw std::domain_error( oss.str() );
-        }
-        return reporter;
-    }
-
-#if !defined(CATCH_CONFIG_DEFAULT_REPORTER)
-#define CATCH_CONFIG_DEFAULT_REPORTER "console"
-#endif
-
-    Ptr<IStreamingReporter> makeReporter( Ptr<Config> const& config ) {
-        std::vector<std::string> reporters = config->getReporterNames();
-        if( reporters.empty() )
-            reporters.push_back( CATCH_CONFIG_DEFAULT_REPORTER );
-
-        Ptr<IStreamingReporter> reporter;
-        for( std::vector<std::string>::const_iterator it = reporters.begin(), itEnd = reporters.end();
-                it != itEnd;
-                ++it )
-            reporter = addReporter( reporter, createReporter( *it, config ) );
-        return reporter;
-    }
-    Ptr<IStreamingReporter> addListeners( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> reporters ) {
-        IReporterRegistry::Listeners listeners = getRegistryHub().getReporterRegistry().getListeners();
-        for( IReporterRegistry::Listeners::const_iterator it = listeners.begin(), itEnd = listeners.end();
-                it != itEnd;
-                ++it )
-            reporters = addReporter(reporters, (*it)->create( ReporterConfig( config ) ) );
-        return reporters;
-    }
-
-
-    Totals runTests( Ptr<Config> const& config ) {
-
-        Ptr<IConfig const> iconfig = config.get();
-
-        Ptr<IStreamingReporter> reporter = makeReporter( config );
-        reporter = addListeners( iconfig, reporter );
-
-        RunContext context( iconfig, reporter );
-
-        Totals totals;
-
-        context.testGroupStarting( config->name(), 1, 1 );
-
-        TestSpec testSpec = config->testSpec();
-        if( !testSpec.hasFilters() )
-            testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "~[.]" ).testSpec(); // All not hidden tests
-
-        std::vector<TestCase> const& allTestCases = getAllTestCasesSorted( *iconfig );
-        for( std::vector<TestCase>::const_iterator it = allTestCases.begin(), itEnd = allTestCases.end();
-                it != itEnd;
-                ++it ) {
-            if( !context.aborting() && matchTest( *it, testSpec, *iconfig ) )
-                totals += context.runTest( *it );
-            else
-                reporter->skipTest( *it );
-        }
-
-        context.testGroupEnded( iconfig->name(), totals, 1, 1 );
-        return totals;
-    }
-
-    void applyFilenamesAsTags( IConfig const& config ) {
-        std::vector<TestCase> const& tests = getAllTestCasesSorted( config );
-        for(std::size_t i = 0; i < tests.size(); ++i ) {
-            TestCase& test = const_cast<TestCase&>( tests[i] );
-            std::set<std::string> tags = test.tags;
-
-            std::string filename = test.lineInfo.file;
-            std::string::size_type lastSlash = filename.find_last_of( "\\/" );
-            if( lastSlash != std::string::npos )
-                filename = filename.substr( lastSlash+1 );
-
-            std::string::size_type lastDot = filename.find_last_of( '.' );
-            if( lastDot != std::string::npos )
-                filename = filename.substr( 0, lastDot );
-
-            tags.insert( '#' + filename );
-            setTags( test, tags );
-        }
-    }
-
-    class Session : NonCopyable {
-        static bool alreadyInstantiated;
-
-    public:
-
-        struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; };
-
-        Session()
-        : m_cli( makeCommandLineParser() ) {
-            if( alreadyInstantiated ) {
-                std::string msg = "Only one instance of Catch::Session can ever be used";
-                Catch::cerr() << msg << std::endl;
-                throw std::logic_error( msg );
-            }
-            alreadyInstantiated = true;
-        }
-        ~Session() {
-            Catch::cleanUp();
-        }
-
-        void showHelp( std::string const& processName ) {
-            Catch::cout() << "\nCatch v" << libraryVersion() << "\n";
-
-            m_cli.usage( Catch::cout(), processName );
-            Catch::cout() << "For more detail usage please see the project docs\n" << std::endl;
-        }
-        void libIdentify() {
-            Catch::cout()
-                    << std::left << std::setw(16) << "description: " << "A Catch test executable\n"
-                    << std::left << std::setw(16) << "category: " << "testframework\n"
-                    << std::left << std::setw(16) << "framework: " << "Catch Test\n"
-                    << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
-        }
-
-        int applyCommandLine( int argc, char const* const* const argv, OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) {
-            try {
-                m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail );
-                m_unusedTokens = m_cli.parseInto( Clara::argsToVector( argc, argv ), m_configData );
-                if( m_configData.showHelp )
-                    showHelp( m_configData.processName );
-                if( m_configData.libIdentify )
-                    libIdentify();
-                m_config.reset();
-            }
-            catch( std::exception& ex ) {
-                {
-                    Colour colourGuard( Colour::Red );
-                    Catch::cerr()
-                        << "\nError(s) in input:\n"
-                        << Text( ex.what(), TextAttributes().setIndent(2) )
-                        << "\n\n";
-                }
-                m_cli.usage( Catch::cout(), m_configData.processName );
-                return (std::numeric_limits<int>::max)();
-            }
-            return 0;
-        }
-
-        void useConfigData( ConfigData const& _configData ) {
-            m_configData = _configData;
-            m_config.reset();
-        }
-
-        int run( int argc, char const* const* const argv ) {
-
-            int returnCode = applyCommandLine( argc, argv );
-            if( returnCode == 0 )
-                returnCode = run();
-            return returnCode;
-        }
-
-    #if defined(WIN32) && defined(UNICODE)
-        int run( int argc, wchar_t const* const* const argv ) {
-
-            char **utf8Argv = new char *[ argc ];
-
-            for ( int i = 0; i < argc; ++i ) {
-                int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, NULL, 0, NULL, NULL );
-
-                utf8Argv[ i ] = new char[ bufSize ];
-
-                WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL );
-            }
-
-            int returnCode = applyCommandLine( argc, utf8Argv );
-            if( returnCode == 0 )
-                returnCode = run();
-
-            for ( int i = 0; i < argc; ++i )
-                delete [] utf8Argv[ i ];
-
-            delete [] utf8Argv;
-
-            return returnCode;
-        }
-    #endif
-
-        int run() {
-            if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
-                Catch::cout() << "...waiting for enter/ return before starting" << std::endl;
-                static_cast<void>(std::getchar());
-            }
-            int exitCode = runInternal();
-            if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
-                Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl;
-                static_cast<void>(std::getchar());
-            }
-            return exitCode;
-        }
-
-        Clara::CommandLine<ConfigData> const& cli() const {
-            return m_cli;
-        }
-        std::vector<Clara::Parser::Token> const& unusedTokens() const {
-            return m_unusedTokens;
-        }
-        ConfigData& configData() {
-            return m_configData;
-        }
-        Config& config() {
-            if( !m_config )
-                m_config = new Config( m_configData );
-            return *m_config;
-        }
-    private:
-
-        int runInternal() {
-            if( m_configData.showHelp || m_configData.libIdentify )
-                return 0;
-
-            try
-            {
-                config(); // Force config to be constructed
-
-                seedRng( *m_config );
-
-                if( m_configData.filenamesAsTags )
-                    applyFilenamesAsTags( *m_config );
-
-                // Handle list request
-                if( Option<std::size_t> listed = list( config() ) )
-                    return static_cast<int>( *listed );
-
-                return static_cast<int>( runTests( m_config ).assertions.failed );
-            }
-            catch( std::exception& ex ) {
-                Catch::cerr() << ex.what() << std::endl;
-                return (std::numeric_limits<int>::max)();
-            }
-        }
-
-        Clara::CommandLine<ConfigData> m_cli;
-        std::vector<Clara::Parser::Token> m_unusedTokens;
-        ConfigData m_configData;
-        Ptr<Config> m_config;
-    };
-
-    bool Session::alreadyInstantiated = false;
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED

+ 0 - 1054
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/external/clara.h

@@ -1,1054 +0,0 @@
-/*
- *  Created by Phil on 25/05/2013.
- *  Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-
-// Version 0.0.2.4
-
-// Only use header guard if we are not using an outer namespace
-#if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE)
-
-#ifndef STITCH_CLARA_OPEN_NAMESPACE
-#define TWOBLUECUBES_CLARA_H_INCLUDED
-#define STITCH_CLARA_OPEN_NAMESPACE
-#define STITCH_CLARA_CLOSE_NAMESPACE
-#else
-#define STITCH_CLARA_CLOSE_NAMESPACE }
-#endif
-
-
-#define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE
-
-// ----------- #included from tbc_text_format.h -----------
-
-/*
- *  Created by Phil on 18/4/2013.
- *  Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-// Only use header guard if we are not using an outer namespace
-#if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE)
-#ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-#define TBC_TEXT_FORMAT_H_INCLUDED
-#endif
-
-#include <string>
-#include <vector>
-#include <sstream>
-#include <algorithm>
-#include <cctype>
-
-// Use optional outer namespace
-#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
-#endif
-
-namespace Tbc {
-
-#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
-    const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
-#else
-    const unsigned int consoleWidth = 80;
-#endif
-
-    struct TextAttributes {
-        TextAttributes()
-        :   initialIndent( std::string::npos ),
-            indent( 0 ),
-            width( consoleWidth-1 ),
-            tabChar( '\t' )
-        {}
-
-        TextAttributes& setInitialIndent( std::size_t _value )  { initialIndent = _value; return *this; }
-        TextAttributes& setIndent( std::size_t _value )         { indent = _value; return *this; }
-        TextAttributes& setWidth( std::size_t _value )          { width = _value; return *this; }
-        TextAttributes& setTabChar( char _value )               { tabChar = _value; return *this; }
-
-        std::size_t initialIndent;  // indent of first line, or npos
-        std::size_t indent;         // indent of subsequent lines, or all if initialIndent is npos
-        std::size_t width;          // maximum width of text, including indent. Longer text will wrap
-        char tabChar;               // If this char is seen the indent is changed to current pos
-    };
-
-    class Text {
-    public:
-        Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
-        : attr( _attr )
-        {
-            std::string wrappableChars = " [({.,/|\\-";
-            std::size_t indent = _attr.initialIndent != std::string::npos
-                ? _attr.initialIndent
-                : _attr.indent;
-            std::string remainder = _str;
-
-            while( !remainder.empty() ) {
-                if( lines.size() >= 1000 ) {
-                    lines.push_back( "... message truncated due to excessive size" );
-                    return;
-                }
-                std::size_t tabPos = std::string::npos;
-                std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
-                std::size_t pos = remainder.find_first_of( '\n' );
-                if( pos <= width ) {
-                    width = pos;
-                }
-                pos = remainder.find_last_of( _attr.tabChar, width );
-                if( pos != std::string::npos ) {
-                    tabPos = pos;
-                    if( remainder[width] == '\n' )
-                        width--;
-                    remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 );
-                }
-
-                if( width == remainder.size() ) {
-                    spliceLine( indent, remainder, width );
-                }
-                else if( remainder[width] == '\n' ) {
-                    spliceLine( indent, remainder, width );
-                    if( width <= 1 || remainder.size() != 1 )
-                        remainder = remainder.substr( 1 );
-                    indent = _attr.indent;
-                }
-                else {
-                    pos = remainder.find_last_of( wrappableChars, width );
-                    if( pos != std::string::npos && pos > 0 ) {
-                        spliceLine( indent, remainder, pos );
-                        if( remainder[0] == ' ' )
-                            remainder = remainder.substr( 1 );
-                    }
-                    else {
-                        spliceLine( indent, remainder, width-1 );
-                        lines.back() += "-";
-                    }
-                    if( lines.size() == 1 )
-                        indent = _attr.indent;
-                    if( tabPos != std::string::npos )
-                        indent += tabPos;
-                }
-            }
-        }
-
-        void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) {
-            lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) );
-            _remainder = _remainder.substr( _pos );
-        }
-
-        typedef std::vector<std::string>::const_iterator const_iterator;
-
-        const_iterator begin() const { return lines.begin(); }
-        const_iterator end() const { return lines.end(); }
-        std::string const& last() const { return lines.back(); }
-        std::size_t size() const { return lines.size(); }
-        std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
-        std::string toString() const {
-            std::ostringstream oss;
-            oss << *this;
-            return oss.str();
-        }
-
-        friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
-            for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
-                it != itEnd; ++it ) {
-                if( it != _text.begin() )
-                    _stream << "\n";
-                _stream << *it;
-            }
-            return _stream;
-        }
-
-    private:
-        std::string str;
-        TextAttributes attr;
-        std::vector<std::string> lines;
-    };
-
-} // end namespace Tbc
-
-#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-} // end outer namespace
-#endif
-
-#endif // TBC_TEXT_FORMAT_H_INCLUDED
-
-// ----------- end of #include from tbc_text_format.h -----------
-// ........... back in clara.h
-
-#undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE
-
-
-// ----------- #included from clara_compilers.h -----------
-
-/*
- *  Created by Phil on 10/02/2016.
- *  Copyright 2016 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED
-#define TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED
-
-// Detect a number of compiler features - mostly C++11/14 conformance - by compiler
-// The following features are defined:
-//
-// CLARA_CONFIG_CPP11_NULLPTR : is nullptr supported?
-// CLARA_CONFIG_CPP11_NOEXCEPT : is noexcept supported?
-// CLARA_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods
-// CLARA_CONFIG_CPP11_OVERRIDE : is override supported?
-// CLARA_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr)
-
-// CLARA_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
-
-// CLARA_CONFIG_VARIADIC_MACROS : are variadic macros supported?
-
-// In general each macro has a _NO_<feature name> form
-// (e.g. CLARA_CONFIG_CPP11_NO_NULLPTR) which disables the feature.
-// Many features, at point of detection, define an _INTERNAL_ macro, so they
-// can be combined, en-mass, with the _NO_ forms later.
-
-// All the C++11 features can be disabled with CLARA_CONFIG_NO_CPP11
-
-#ifdef __clang__
-
-#if __has_feature(cxx_nullptr)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#endif
-
-#if __has_feature(cxx_noexcept)
-#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#endif
-
-#endif // __clang__
-
-////////////////////////////////////////////////////////////////////////////////
-// GCC
-#ifdef __GNUC__
-
-#if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#endif
-
-// - otherwise more recent versions define __cplusplus >= 201103L
-// and will get picked up below
-
-#endif // __GNUC__
-
-////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#ifdef _MSC_VER
-
-#if (_MSC_VER >= 1600)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
-#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#endif
-
-#endif // _MSC_VER
-
-
-////////////////////////////////////////////////////////////////////////////////
-// C++ language feature support
-
-// catch all support for C++11
-#if defined(__cplusplus) && __cplusplus >= 201103L
-
-#define CLARA_CPP11_OR_GREATER
-
-#if !defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#endif
-
-#ifndef CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#endif
-
-#ifndef CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#endif
-
-#if !defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE)
-#define CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE
-#endif
-#if !defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR)
-#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-
-#endif // __cplusplus >= 201103L
-
-// Now set the actual defines based on the above + anything the user has configured
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NO_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_NULLPTR
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_NOEXCEPT
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_GENERATED_METHODS
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_OVERRIDE) && !defined(CLARA_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_OVERRIDE
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_UNIQUE_PTR) && !defined(CLARA_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-
-// noexcept support:
-#if defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_NOEXCEPT)
-#define CLARA_NOEXCEPT noexcept
-#  define CLARA_NOEXCEPT_IS(x) noexcept(x)
-#else
-#define CLARA_NOEXCEPT throw()
-#  define CLARA_NOEXCEPT_IS(x)
-#endif
-
-// nullptr support
-#ifdef CLARA_CONFIG_CPP11_NULLPTR
-#define CLARA_NULL nullptr
-#else
-#define CLARA_NULL NULL
-#endif
-
-// override support
-#ifdef CLARA_CONFIG_CPP11_OVERRIDE
-#define CLARA_OVERRIDE override
-#else
-#define CLARA_OVERRIDE
-#endif
-
-// unique_ptr support
-#ifdef CLARA_CONFIG_CPP11_UNIQUE_PTR
-#   define CLARA_AUTO_PTR( T ) std::unique_ptr<T>
-#else
-#   define CLARA_AUTO_PTR( T ) std::auto_ptr<T>
-#endif
-
-#endif // TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED
-
-
-// ----------- end of #include from clara_compilers.h -----------
-// ........... back in clara.h
-
-
-#include <map>
-#include <stdexcept>
-#include <memory>
-
-#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
-#define CLARA_PLATFORM_WINDOWS
-#endif
-
-
-// Use optional outer namespace
-#ifdef STITCH_CLARA_OPEN_NAMESPACE
-STITCH_CLARA_OPEN_NAMESPACE
-#endif
-
-namespace Clara {
-
-    struct UnpositionalTag {};
-
-    extern UnpositionalTag _;
-
-#ifdef CLARA_CONFIG_MAIN
-    UnpositionalTag _;
-#endif
-
-    namespace Detail {
-
-#ifdef CLARA_CONSOLE_WIDTH
-    const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH;
-#else
-    const unsigned int consoleWidth = 80;
-#endif
-
-        using namespace Tbc;
-
-        inline bool startsWith( std::string const& str, std::string const& prefix ) {
-            return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix;
-        }
-
-        template<typename T> struct RemoveConstRef{ typedef T type; };
-        template<typename T> struct RemoveConstRef<T&>{ typedef T type; };
-        template<typename T> struct RemoveConstRef<T const&>{ typedef T type; };
-        template<typename T> struct RemoveConstRef<T const>{ typedef T type; };
-
-        template<typename T>    struct IsBool       { static const bool value = false; };
-        template<>              struct IsBool<bool> { static const bool value = true; };
-
-        template<typename T>
-        void convertInto( std::string const& _source, T& _dest ) {
-            std::stringstream ss;
-            ss << _source;
-            ss >> _dest;
-            if( ss.fail() )
-                throw std::runtime_error( "Unable to convert " + _source + " to destination type" );
-        }
-        inline void convertInto( std::string const& _source, std::string& _dest ) {
-            _dest = _source;
-        }
-        char toLowerCh(char c) {
-            return static_cast<char>( std::tolower( c ) );
-        }
-        inline void convertInto( std::string const& _source, bool& _dest ) {
-            std::string sourceLC = _source;
-            std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), toLowerCh );
-            if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" )
-                _dest = true;
-            else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )
-                _dest = false;
-            else
-                throw std::runtime_error( "Expected a boolean value but did not recognise:\n  '" + _source + "'" );
-        }
-
-
-        template<typename ConfigT>
-        struct IArgFunction {
-            virtual ~IArgFunction() {}
-#ifdef CLARA_CONFIG_CPP11_GENERATED_METHODS
-            IArgFunction()                      = default;
-            IArgFunction( IArgFunction const& ) = default;
-#endif
-            virtual void set( ConfigT& config, std::string const& value ) const = 0;
-            virtual bool takesArg() const = 0;
-            virtual IArgFunction* clone() const = 0;
-        };
-
-        template<typename ConfigT>
-        class BoundArgFunction {
-        public:
-            BoundArgFunction() : functionObj( CLARA_NULL ) {}
-            BoundArgFunction( IArgFunction<ConfigT>* _functionObj ) : functionObj( _functionObj ) {}
-            BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : CLARA_NULL ) {}
-            BoundArgFunction& operator = ( BoundArgFunction const& other ) {
-                IArgFunction<ConfigT>* newFunctionObj = other.functionObj ? other.functionObj->clone() : CLARA_NULL;
-                delete functionObj;
-                functionObj = newFunctionObj;
-                return *this;
-            }
-            ~BoundArgFunction() { delete functionObj; }
-
-            void set( ConfigT& config, std::string const& value ) const {
-                functionObj->set( config, value );
-            }
-            bool takesArg() const { return functionObj->takesArg(); }
-
-            bool isSet() const {
-                return functionObj != CLARA_NULL;
-            }
-        private:
-            IArgFunction<ConfigT>* functionObj;
-        };
-
-
-        template<typename C>
-        struct NullBinder : IArgFunction<C>{
-            virtual void set( C&, std::string const& ) const {}
-            virtual bool takesArg() const { return true; }
-            virtual IArgFunction<C>* clone() const { return new NullBinder( *this ); }
-        };
-
-        template<typename C, typename M>
-        struct BoundDataMember : IArgFunction<C>{
-            BoundDataMember( M C::* _member ) : member( _member ) {}
-            virtual void set( C& p, std::string const& stringValue ) const {
-                convertInto( stringValue, p.*member );
-            }
-            virtual bool takesArg() const { return !IsBool<M>::value; }
-            virtual IArgFunction<C>* clone() const { return new BoundDataMember( *this ); }
-            M C::* member;
-        };
-        template<typename C, typename M>
-        struct BoundUnaryMethod : IArgFunction<C>{
-            BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {}
-            virtual void set( C& p, std::string const& stringValue ) const {
-                typename RemoveConstRef<M>::type value;
-                convertInto( stringValue, value );
-                (p.*member)( value );
-            }
-            virtual bool takesArg() const { return !IsBool<M>::value; }
-            virtual IArgFunction<C>* clone() const { return new BoundUnaryMethod( *this ); }
-            void (C::*member)( M );
-        };
-        template<typename C>
-        struct BoundNullaryMethod : IArgFunction<C>{
-            BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {}
-            virtual void set( C& p, std::string const& stringValue ) const {
-                bool value;
-                convertInto( stringValue, value );
-                if( value )
-                    (p.*member)();
-            }
-            virtual bool takesArg() const { return false; }
-            virtual IArgFunction<C>* clone() const { return new BoundNullaryMethod( *this ); }
-            void (C::*member)();
-        };
-
-        template<typename C>
-        struct BoundUnaryFunction : IArgFunction<C>{
-            BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {}
-            virtual void set( C& obj, std::string const& stringValue ) const {
-                bool value;
-                convertInto( stringValue, value );
-                if( value )
-                    function( obj );
-            }
-            virtual bool takesArg() const { return false; }
-            virtual IArgFunction<C>* clone() const { return new BoundUnaryFunction( *this ); }
-            void (*function)( C& );
-        };
-
-        template<typename C, typename T>
-        struct BoundBinaryFunction : IArgFunction<C>{
-            BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {}
-            virtual void set( C& obj, std::string const& stringValue ) const {
-                typename RemoveConstRef<T>::type value;
-                convertInto( stringValue, value );
-                function( obj, value );
-            }
-            virtual bool takesArg() const { return !IsBool<T>::value; }
-            virtual IArgFunction<C>* clone() const { return new BoundBinaryFunction( *this ); }
-            void (*function)( C&, T );
-        };
-
-    } // namespace Detail
-
-    inline std::vector<std::string> argsToVector( int argc, char const* const* const argv ) {
-        std::vector<std::string> args( static_cast<std::size_t>( argc ) );
-        for( std::size_t i = 0; i < static_cast<std::size_t>( argc ); ++i )
-            args[i] = argv[i];
-
-        return args;
-    }
-
-    class Parser {
-        enum Mode { None, MaybeShortOpt, SlashOpt, ShortOpt, LongOpt, Positional };
-        Mode mode;
-        std::size_t from;
-        bool inQuotes;
-    public:
-
-        struct Token {
-            enum Type { Positional, ShortOpt, LongOpt };
-            Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {}
-            Type type;
-            std::string data;
-        };
-
-        Parser() : mode( None ), from( 0 ), inQuotes( false ){}
-
-        void parseIntoTokens( std::vector<std::string> const& args, std::vector<Token>& tokens ) {
-            const std::string doubleDash = "--";
-            for( std::size_t i = 1; i < args.size() && args[i] != doubleDash; ++i )
-                parseIntoTokens( args[i], tokens);
-        }
-
-        void parseIntoTokens( std::string const& arg, std::vector<Token>& tokens ) {
-            for( std::size_t i = 0; i < arg.size(); ++i ) {
-                char c = arg[i];
-                if( c == '"' )
-                    inQuotes = !inQuotes;
-                mode = handleMode( i, c, arg, tokens );
-            }
-            mode = handleMode( arg.size(), '\0', arg, tokens );
-        }
-        Mode handleMode( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) {
-            switch( mode ) {
-                case None: return handleNone( i, c );
-                case MaybeShortOpt: return handleMaybeShortOpt( i, c );
-                case ShortOpt:
-                case LongOpt:
-                case SlashOpt: return handleOpt( i, c, arg, tokens );
-                case Positional: return handlePositional( i, c, arg, tokens );
-                default: throw std::logic_error( "Unknown mode" );
-            }
-        }
-
-        Mode handleNone( std::size_t i, char c ) {
-            if( inQuotes ) {
-                from = i;
-                return Positional;
-            }
-            switch( c ) {
-                case '-': return MaybeShortOpt;
-#ifdef CLARA_PLATFORM_WINDOWS
-                case '/': from = i+1; return SlashOpt;
-#endif
-                default: from = i; return Positional;
-            }
-        }
-        Mode handleMaybeShortOpt( std::size_t i, char c ) {
-            switch( c ) {
-                case '-': from = i+1; return LongOpt;
-                default: from = i; return ShortOpt;
-            }
-        }
-
-        Mode handleOpt( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) {
-            if( std::string( ":=\0", 3 ).find( c ) == std::string::npos )
-                return mode;
-
-            std::string optName = arg.substr( from, i-from );
-            if( mode == ShortOpt )
-                for( std::size_t j = 0; j < optName.size(); ++j )
-                    tokens.push_back( Token( Token::ShortOpt, optName.substr( j, 1 ) ) );
-            else if( mode == SlashOpt && optName.size() == 1 )
-                tokens.push_back( Token( Token::ShortOpt, optName ) );
-            else
-                tokens.push_back( Token( Token::LongOpt, optName ) );
-            return None;
-        }
-        Mode handlePositional( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) {
-            if( inQuotes || std::string( "\0", 1 ).find( c ) == std::string::npos )
-                return mode;
-
-            std::string data = arg.substr( from, i-from );
-            tokens.push_back( Token( Token::Positional, data ) );
-            return None;
-        }
-    };
-
-    template<typename ConfigT>
-    struct CommonArgProperties {
-        CommonArgProperties() {}
-        CommonArgProperties( Detail::BoundArgFunction<ConfigT> const& _boundField ) : boundField( _boundField ) {}
-
-        Detail::BoundArgFunction<ConfigT> boundField;
-        std::string description;
-        std::string detail;
-        std::string placeholder; // Only value if boundField takes an arg
-
-        bool takesArg() const {
-            return !placeholder.empty();
-        }
-        void validate() const {
-            if( !boundField.isSet() )
-                throw std::logic_error( "option not bound" );
-        }
-    };
-    struct OptionArgProperties {
-        std::vector<std::string> shortNames;
-        std::string longName;
-
-        bool hasShortName( std::string const& shortName ) const {
-            return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end();
-        }
-        bool hasLongName( std::string const& _longName ) const {
-            return _longName == longName;
-        }
-    };
-    struct PositionalArgProperties {
-        PositionalArgProperties() : position( -1 ) {}
-        int position; // -1 means non-positional (floating)
-
-        bool isFixedPositional() const {
-            return position != -1;
-        }
-    };
-
-    template<typename ConfigT>
-    class CommandLine {
-
-        struct Arg : CommonArgProperties<ConfigT>, OptionArgProperties, PositionalArgProperties {
-            Arg() {}
-            Arg( Detail::BoundArgFunction<ConfigT> const& _boundField ) : CommonArgProperties<ConfigT>( _boundField ) {}
-
-            using CommonArgProperties<ConfigT>::placeholder; // !TBD
-
-            std::string dbgName() const {
-                if( !longName.empty() )
-                    return "--" + longName;
-                if( !shortNames.empty() )
-                    return "-" + shortNames[0];
-                return "positional args";
-            }
-            std::string commands() const {
-                std::ostringstream oss;
-                bool first = true;
-                std::vector<std::string>::const_iterator it = shortNames.begin(), itEnd = shortNames.end();
-                for(; it != itEnd; ++it ) {
-                    if( first )
-                        first = false;
-                    else
-                        oss << ", ";
-                    oss << "-" << *it;
-                }
-                if( !longName.empty() ) {
-                    if( !first )
-                        oss << ", ";
-                    oss << "--" << longName;
-                }
-                if( !placeholder.empty() )
-                    oss << " <" << placeholder << ">";
-                return oss.str();
-            }
-        };
-
-        typedef CLARA_AUTO_PTR( Arg ) ArgAutoPtr;
-
-        friend void addOptName( Arg& arg, std::string const& optName )
-        {
-            if( optName.empty() )
-                return;
-            if( Detail::startsWith( optName, "--" ) ) {
-                if( !arg.longName.empty() )
-                    throw std::logic_error( "Only one long opt may be specified. '"
-                        + arg.longName
-                        + "' already specified, now attempting to add '"
-                        + optName + "'" );
-                arg.longName = optName.substr( 2 );
-            }
-            else if( Detail::startsWith( optName, "-" ) )
-                arg.shortNames.push_back( optName.substr( 1 ) );
-            else
-                throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" );
-        }
-        friend void setPositionalArg( Arg& arg, int position )
-        {
-            arg.position = position;
-        }
-
-
-        class ArgBuilder {
-        public:
-            ArgBuilder( Arg* arg ) : m_arg( arg ) {}
-
-            // Bind a non-boolean data member (requires placeholder string)
-            template<typename C, typename M>
-            void bind( M C::* field, std::string const& placeholder ) {
-                m_arg->boundField = new Detail::BoundDataMember<C,M>( field );
-                m_arg->placeholder = placeholder;
-            }
-            // Bind a boolean data member (no placeholder required)
-            template<typename C>
-            void bind( bool C::* field ) {
-                m_arg->boundField = new Detail::BoundDataMember<C,bool>( field );
-            }
-
-            // Bind a method taking a single, non-boolean argument (requires a placeholder string)
-            template<typename C, typename M>
-            void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) {
-                m_arg->boundField = new Detail::BoundUnaryMethod<C,M>( unaryMethod );
-                m_arg->placeholder = placeholder;
-            }
-
-            // Bind a method taking a single, boolean argument (no placeholder string required)
-            template<typename C>
-            void bind( void (C::* unaryMethod)( bool ) ) {
-                m_arg->boundField = new Detail::BoundUnaryMethod<C,bool>( unaryMethod );
-            }
-
-            // Bind a method that takes no arguments (will be called if opt is present)
-            template<typename C>
-            void bind( void (C::* nullaryMethod)() ) {
-                m_arg->boundField = new Detail::BoundNullaryMethod<C>( nullaryMethod );
-            }
-
-            // Bind a free function taking a single argument - the object to operate on (no placeholder string required)
-            template<typename C>
-            void bind( void (* unaryFunction)( C& ) ) {
-                m_arg->boundField = new Detail::BoundUnaryFunction<C>( unaryFunction );
-            }
-
-            // Bind a free function taking a single argument - the object to operate on (requires a placeholder string)
-            template<typename C, typename T>
-            void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) {
-                m_arg->boundField = new Detail::BoundBinaryFunction<C, T>( binaryFunction );
-                m_arg->placeholder = placeholder;
-            }
-
-            ArgBuilder& describe( std::string const& description ) {
-                m_arg->description = description;
-                return *this;
-            }
-            ArgBuilder& detail( std::string const& detail ) {
-                m_arg->detail = detail;
-                return *this;
-            }
-
-        protected:
-            Arg* m_arg;
-        };
-
-        class OptBuilder : public ArgBuilder {
-        public:
-            OptBuilder( Arg* arg ) : ArgBuilder( arg ) {}
-            OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {}
-
-            OptBuilder& operator[]( std::string const& optName ) {
-                addOptName( *ArgBuilder::m_arg, optName );
-                return *this;
-            }
-        };
-
-    public:
-
-        CommandLine()
-        :   m_boundProcessName( new Detail::NullBinder<ConfigT>() ),
-            m_highestSpecifiedArgPosition( 0 ),
-            m_throwOnUnrecognisedTokens( false )
-        {}
-        CommandLine( CommandLine const& other )
-        :   m_boundProcessName( other.m_boundProcessName ),
-            m_options ( other.m_options ),
-            m_positionalArgs( other.m_positionalArgs ),
-            m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ),
-            m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
-        {
-            if( other.m_floatingArg.get() )
-                m_floatingArg.reset( new Arg( *other.m_floatingArg ) );
-        }
-
-        CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
-            m_throwOnUnrecognisedTokens = shouldThrow;
-            return *this;
-        }
-
-
-        OptBuilder operator[]( std::string const& optName ) {
-            m_options.push_back( Arg() );
-            addOptName( m_options.back(), optName );
-            OptBuilder builder( &m_options.back() );
-            return builder;
-        }
-
-        ArgBuilder operator[]( int position ) {
-            m_positionalArgs.insert( std::make_pair( position, Arg() ) );
-            if( position > m_highestSpecifiedArgPosition )
-                m_highestSpecifiedArgPosition = position;
-            setPositionalArg( m_positionalArgs[position], position );
-            ArgBuilder builder( &m_positionalArgs[position] );
-            return builder;
-        }
-
-        // Invoke this with the _ instance
-        ArgBuilder operator[]( UnpositionalTag ) {
-            if( m_floatingArg.get() )
-                throw std::logic_error( "Only one unpositional argument can be added" );
-            m_floatingArg.reset( new Arg() );
-            ArgBuilder builder( m_floatingArg.get() );
-            return builder;
-        }
-
-        template<typename C, typename M>
-        void bindProcessName( M C::* field ) {
-            m_boundProcessName = new Detail::BoundDataMember<C,M>( field );
-        }
-        template<typename C, typename M>
-        void bindProcessName( void (C::*_unaryMethod)( M ) ) {
-            m_boundProcessName = new Detail::BoundUnaryMethod<C,M>( _unaryMethod );
-        }
-
-        void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const {
-            typename std::vector<Arg>::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it;
-            std::size_t maxWidth = 0;
-            for( it = itBegin; it != itEnd; ++it )
-                maxWidth = (std::max)( maxWidth, it->commands().size() );
-
-            for( it = itBegin; it != itEnd; ++it ) {
-                Detail::Text usage( it->commands(), Detail::TextAttributes()
-                                                        .setWidth( maxWidth+indent )
-                                                        .setIndent( indent ) );
-                Detail::Text desc( it->description, Detail::TextAttributes()
-                                                        .setWidth( width - maxWidth - 3 ) );
-
-                for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) {
-                    std::string usageCol = i < usage.size() ? usage[i] : "";
-                    os << usageCol;
-
-                    if( i < desc.size() && !desc[i].empty() )
-                        os  << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' )
-                            << desc[i];
-                    os << "\n";
-                }
-            }
-        }
-        std::string optUsage() const {
-            std::ostringstream oss;
-            optUsage( oss );
-            return oss.str();
-        }
-
-        void argSynopsis( std::ostream& os ) const {
-            for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) {
-                if( i > 1 )
-                    os << " ";
-                typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( i );
-                if( it != m_positionalArgs.end() )
-                    os << "<" << it->second.placeholder << ">";
-                else if( m_floatingArg.get() )
-                    os << "<" << m_floatingArg->placeholder << ">";
-                else
-                    throw std::logic_error( "non consecutive positional arguments with no floating args" );
-            }
-            // !TBD No indication of mandatory args
-            if( m_floatingArg.get() ) {
-                if( m_highestSpecifiedArgPosition > 1 )
-                    os << " ";
-                os << "[<" << m_floatingArg->placeholder << "> ...]";
-            }
-        }
-        std::string argSynopsis() const {
-            std::ostringstream oss;
-            argSynopsis( oss );
-            return oss.str();
-        }
-
-        void usage( std::ostream& os, std::string const& procName ) const {
-            validate();
-            os << "usage:\n  " << procName << " ";
-            argSynopsis( os );
-            if( !m_options.empty() ) {
-                os << " [options]\n\nwhere options are: \n";
-                optUsage( os, 2 );
-            }
-            os << "\n";
-        }
-        std::string usage( std::string const& procName ) const {
-            std::ostringstream oss;
-            usage( oss, procName );
-            return oss.str();
-        }
-
-        ConfigT parse( std::vector<std::string> const& args ) const {
-            ConfigT config;
-            parseInto( args, config );
-            return config;
-        }
-
-        std::vector<Parser::Token> parseInto( std::vector<std::string> const& args, ConfigT& config ) const {
-            std::string processName = args.empty() ? std::string() : args[0];
-            std::size_t lastSlash = processName.find_last_of( "/\\" );
-            if( lastSlash != std::string::npos )
-                processName = processName.substr( lastSlash+1 );
-            m_boundProcessName.set( config, processName );
-            std::vector<Parser::Token> tokens;
-            Parser parser;
-            parser.parseIntoTokens( args, tokens );
-            return populate( tokens, config );
-        }
-
-        std::vector<Parser::Token> populate( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
-            validate();
-            std::vector<Parser::Token> unusedTokens = populateOptions( tokens, config );
-            unusedTokens = populateFixedArgs( unusedTokens, config );
-            unusedTokens = populateFloatingArgs( unusedTokens, config );
-            return unusedTokens;
-        }
-
-        std::vector<Parser::Token> populateOptions( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
-            std::vector<Parser::Token> unusedTokens;
-            std::vector<std::string> errors;
-            for( std::size_t i = 0; i < tokens.size(); ++i ) {
-                Parser::Token const& token = tokens[i];
-                typename std::vector<Arg>::const_iterator it = m_options.begin(), itEnd = m_options.end();
-                for(; it != itEnd; ++it ) {
-                    Arg const& arg = *it;
-
-                    try {
-                        if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) ||
-                            ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) {
-                            if( arg.takesArg() ) {
-                                if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional )
-                                    errors.push_back( "Expected argument to option: " + token.data );
-                                else
-                                    arg.boundField.set( config, tokens[++i].data );
-                            }
-                            else {
-                                arg.boundField.set( config, "true" );
-                            }
-                            break;
-                        }
-                    }
-                    catch( std::exception& ex ) {
-                        errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" );
-                    }
-                }
-                if( it == itEnd ) {
-                    if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens )
-                        unusedTokens.push_back( token );
-                    else if( errors.empty() && m_throwOnUnrecognisedTokens )
-                        errors.push_back( "unrecognised option: " + token.data );
-                }
-            }
-            if( !errors.empty() ) {
-                std::ostringstream oss;
-                for( std::vector<std::string>::const_iterator it = errors.begin(), itEnd = errors.end();
-                        it != itEnd;
-                        ++it ) {
-                    if( it != errors.begin() )
-                        oss << "\n";
-                    oss << *it;
-                }
-                throw std::runtime_error( oss.str() );
-            }
-            return unusedTokens;
-        }
-        std::vector<Parser::Token> populateFixedArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
-            std::vector<Parser::Token> unusedTokens;
-            int position = 1;
-            for( std::size_t i = 0; i < tokens.size(); ++i ) {
-                Parser::Token const& token = tokens[i];
-                typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( position );
-                if( it != m_positionalArgs.end() )
-                    it->second.boundField.set( config, token.data );
-                else
-                    unusedTokens.push_back( token );
-                if( token.type == Parser::Token::Positional )
-                    position++;
-            }
-            return unusedTokens;
-        }
-        std::vector<Parser::Token> populateFloatingArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
-            if( !m_floatingArg.get() )
-                return tokens;
-            std::vector<Parser::Token> unusedTokens;
-            for( std::size_t i = 0; i < tokens.size(); ++i ) {
-                Parser::Token const& token = tokens[i];
-                if( token.type == Parser::Token::Positional )
-                    m_floatingArg->boundField.set( config, token.data );
-                else
-                    unusedTokens.push_back( token );
-            }
-            return unusedTokens;
-        }
-
-        void validate() const
-        {
-            if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() )
-                throw std::logic_error( "No options or arguments specified" );
-
-            for( typename std::vector<Arg>::const_iterator  it = m_options.begin(),
-                                                            itEnd = m_options.end();
-                    it != itEnd; ++it )
-                it->validate();
-        }
-
-    private:
-        Detail::BoundArgFunction<ConfigT> m_boundProcessName;
-        std::vector<Arg> m_options;
-        std::map<int, Arg> m_positionalArgs;
-        ArgAutoPtr m_floatingArg;
-        int m_highestSpecifiedArgPosition;
-        bool m_throwOnUnrecognisedTokens;
-    };
-
-} // end namespace Clara
-
-
-STITCH_CLARA_CLOSE_NAMESPACE
-#undef STITCH_CLARA_OPEN_NAMESPACE
-#undef STITCH_CLARA_CLOSE_NAMESPACE
-
-
-#endif // TWOBLUECUBES_CLARA_H_INCLUDED

+ 0 - 168
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/external/tbc_text_format.h

@@ -1,168 +0,0 @@
-/*
- *  Created by Phil on 18/4/2013.
- *  Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-// Only use header guard if we are not using an outer namespace
-#ifndef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-# ifdef TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED
-#  ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-#   define TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-#  endif
-# else
-#  define TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED
-# endif
-#endif
-#ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-#include <string>
-#include <vector>
-#include <sstream>
-
-// Use optional outer namespace
-#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-namespace CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
-#endif
-
-namespace Tbc {
-
-#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
-    const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
-#else
-    const unsigned int consoleWidth = 80;
-#endif
-
-    struct TextAttributes {
-        TextAttributes()
-        :   initialIndent( std::string::npos ),
-            indent( 0 ),
-            width( consoleWidth-1 )
-        {}
-
-        TextAttributes& setInitialIndent( std::size_t _value )  { initialIndent = _value; return *this; }
-        TextAttributes& setIndent( std::size_t _value )         { indent = _value; return *this; }
-        TextAttributes& setWidth( std::size_t _value )          { width = _value; return *this; }
-
-        std::size_t initialIndent;  // indent of first line, or npos
-        std::size_t indent;         // indent of subsequent lines, or all if initialIndent is npos
-        std::size_t width;          // maximum width of text, including indent. Longer text will wrap
-    };
-
-    class Text {
-    public:
-        Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
-        : attr( _attr )
-        {
-            const std::string wrappableBeforeChars = "[({<\t";
-            const std::string wrappableAfterChars = "])}>-,./|\\";
-            const std::string wrappableInsteadOfChars = " \n\r";
-            std::string indent = _attr.initialIndent != std::string::npos
-                ? std::string( _attr.initialIndent, ' ' )
-                : std::string( _attr.indent, ' ' );
-
-            typedef std::string::const_iterator iterator;
-            iterator it = _str.begin();
-            const iterator strEnd = _str.end();
-
-            while( it != strEnd ) {
-
-                if( lines.size() >= 1000 ) {
-                    lines.push_back( "... message truncated due to excessive size" );
-                    return;
-                }
-
-
-                std::string suffix;
-                std::size_t width = (std::min)( static_cast<size_t>( strEnd-it ), _attr.width-static_cast<size_t>( indent.size() ) );
-                iterator itEnd = it+width;
-                iterator itNext = _str.end();
-
-                iterator itNewLine = std::find( it, itEnd, '\n' );
-                if( itNewLine != itEnd )
-                    itEnd = itNewLine;
-
-                if( itEnd != strEnd  ) {
-                    bool foundWrapPoint = false;
-                    iterator findIt = itEnd;
-                    do {
-                        if( wrappableAfterChars.find( *findIt ) != std::string::npos && findIt != itEnd ) {
-                            itEnd = findIt+1;
-                            itNext = findIt+1;
-                            foundWrapPoint = true;
-                        }
-                        else if( findIt > it && wrappableBeforeChars.find( *findIt ) != std::string::npos ) {
-                            itEnd = findIt;
-                            itNext = findIt;
-                            foundWrapPoint = true;
-                        }
-                        else if( wrappableInsteadOfChars.find( *findIt ) != std::string::npos ) {
-                            itNext = findIt+1;
-                            itEnd = findIt;
-                            foundWrapPoint = true;
-                        }
-                        if( findIt == it )
-                            break;
-                        else
-                            --findIt;
-                    }
-                    while( !foundWrapPoint );
-
-                    if( !foundWrapPoint ) {
-                        // No good wrap char, so we'll break mid word and add a hyphen
-                        --itEnd;
-                        itNext = itEnd;
-                        suffix = "-";
-                    }
-                    else {
-                        while( itEnd > it && wrappableInsteadOfChars.find( *(itEnd-1) ) != std::string::npos )
-                            --itEnd;
-                    }
-                }
-                lines.push_back( indent + std::string( it, itEnd ) + suffix );
-
-                if( indent.size() != _attr.indent )
-                    indent = std::string( _attr.indent, ' ' );
-                it = itNext;
-            }
-        }
-
-
-
-        typedef std::vector<std::string>::const_iterator const_iterator;
-
-        const_iterator begin() const { return lines.begin(); }
-        const_iterator end() const { return lines.end(); }
-        std::string const& last() const { return lines.back(); }
-        std::size_t size() const { return lines.size(); }
-        std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
-        std::string toString() const {
-            std::ostringstream oss;
-            oss << *this;
-            return oss.str();
-        }
-
-        inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
-            for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
-                it != itEnd; ++it ) {
-                if( it != _text.begin() )
-                    _stream << "\n";
-                _stream << *it;
-            }
-            return _stream;
-        }
-
-
-    private:
-        std::string str;
-        TextAttributes attr;
-        std::vector<std::string> lines;
-    };
-
-} // end namespace Tbc
-
-#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-} // end outer namespace
-#endif
-
-#endif // TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED

+ 0 - 202
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_approx.hpp

@@ -1,202 +0,0 @@
-/*
- *  Created by Phil on 28/04/2011.
- *  Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
-
-#include "catch_tostring.h"
-
-#include <cmath>
-#include <limits>
-
-#if defined(CATCH_CONFIG_CPP11_TYPE_TRAITS)
-#include <type_traits>
-#endif
-
-namespace Catch {
-namespace Detail {
-
-    class Approx {
-    public:
-        explicit Approx ( double value )
-        :   m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
-            m_margin( 0.0 ),
-            m_scale( 1.0 ),
-            m_value( value )
-        {}
-
-        static Approx custom() {
-            return Approx( 0 );
-        }
-
-#if defined(CATCH_CONFIG_CPP11_TYPE_TRAITS)
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        Approx operator()( T value ) {
-            Approx approx( static_cast<double>(value) );
-            approx.epsilon( m_epsilon );
-            approx.margin( m_margin );
-            approx.scale( m_scale );
-            return approx;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        explicit Approx( T value ): Approx(static_cast<double>(value))
-        {}
-
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator == ( const T& lhs, Approx const& rhs ) {
-            // Thanks to Richard Harris for his help refining this formula
-            auto lhs_v = double(lhs);
-            bool relativeOK = std::fabs(lhs_v - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale + (std::max)(std::fabs(lhs_v), std::fabs(rhs.m_value)));
-            if (relativeOK) {
-                return true;
-            }
-
-            return std::fabs(lhs_v - rhs.m_value) <= rhs.m_margin;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator == ( Approx const& lhs, const T& rhs ) {
-            return operator==( rhs, lhs );
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator != ( T lhs, Approx const& rhs ) {
-            return !operator==( lhs, rhs );
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator != ( Approx const& lhs, T rhs ) {
-            return !operator==( rhs, lhs );
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator <= ( T lhs, Approx const& rhs ) {
-            return double(lhs) < rhs.m_value || lhs == rhs;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator <= ( Approx const& lhs, T rhs ) {
-            return lhs.m_value < double(rhs) || lhs == rhs;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator >= ( T lhs, Approx const& rhs ) {
-            return double(lhs) > rhs.m_value || lhs == rhs;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        friend bool operator >= ( Approx const& lhs, T rhs ) {
-            return lhs.m_value > double(rhs) || lhs == rhs;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        Approx& epsilon( T newEpsilon ) {
-            m_epsilon = double(newEpsilon);
-            return *this;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        Approx& margin( T newMargin ) {
-            m_margin = double(newMargin);
-            return *this;
-        }
-
-        template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
-        Approx& scale( T newScale ) {
-            m_scale = double(newScale);
-            return *this;
-        }
-
-#else
-
-        Approx operator()( double value ) {
-            Approx approx( value );
-            approx.epsilon( m_epsilon );
-            approx.margin( m_margin );
-            approx.scale( m_scale );
-            return approx;
-        }
-
-
-        friend bool operator == ( double lhs, Approx const& rhs ) {
-            // Thanks to Richard Harris for his help refining this formula
-            bool relativeOK = std::fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs(lhs), std::fabs(rhs.m_value) ) );
-            if (relativeOK) {
-                return true;
-            }
-            return std::fabs(lhs - rhs.m_value) <= rhs.m_margin;
-        }
-
-        friend bool operator == ( Approx const& lhs, double rhs ) {
-            return operator==( rhs, lhs );
-        }
-
-        friend bool operator != ( double lhs, Approx const& rhs ) {
-            return !operator==( lhs, rhs );
-        }
-
-        friend bool operator != ( Approx const& lhs, double rhs ) {
-            return !operator==( rhs, lhs );
-        }
-
-        friend bool operator <= ( double lhs, Approx const& rhs ) {
-            return lhs < rhs.m_value || lhs == rhs;
-        }
-
-        friend bool operator <= ( Approx const& lhs, double rhs ) {
-            return lhs.m_value < rhs || lhs == rhs;
-        }
-
-        friend bool operator >= ( double lhs, Approx const& rhs ) {
-            return lhs > rhs.m_value || lhs == rhs;
-        }
-
-        friend bool operator >= ( Approx const& lhs, double rhs ) {
-            return lhs.m_value > rhs || lhs == rhs;
-        }
-
-        Approx& epsilon( double newEpsilon ) {
-            m_epsilon = newEpsilon;
-            return *this;
-        }
-
-        Approx& margin( double newMargin ) {
-            m_margin = newMargin;
-            return *this;
-        }
-
-        Approx& scale( double newScale ) {
-            m_scale = newScale;
-            return *this;
-        }
-#endif
-
-        std::string toString() const {
-            std::ostringstream oss;
-            oss << "Approx( " << Catch::toString( m_value ) << " )";
-            return oss.str();
-        }
-
-    private:
-        double m_epsilon;
-        double m_margin;
-        double m_scale;
-        double m_value;
-    };
-}
-
-template<>
-inline std::string toString<Detail::Approx>( Detail::Approx const& value ) {
-    return value.toString();
-}
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED

+ 13 - 83
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_assertionresult.h

@@ -9,100 +9,32 @@
 #define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
 
 #include <string>
+#include "catch_assertioninfo.h"
 #include "catch_result_type.h"
+#include "catch_common.h"
+#include "catch_stringref.h"
+#include "catch_assertionhandler.h"
 
 namespace Catch {
 
-    struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
-
-    struct DecomposedExpression
-    {
-        virtual ~DecomposedExpression() {}
-        virtual bool isBinaryExpression() const {
-            return false;
-        }
-        virtual void reconstructExpression( std::string& dest ) const = 0;
-
-        // Only simple binary comparisons can be decomposed.
-        // If more complex check is required then wrap sub-expressions in parentheses.
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( T const& );
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( T const& );
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( T const& );
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( T const& );
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator % ( T const& );
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( T const& );
-        template<typename T> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( T const& );
-
-    private:
-        DecomposedExpression& operator = (DecomposedExpression const&);
-    };
-
-    struct AssertionInfo
-    {
-        AssertionInfo();
-        AssertionInfo(  char const * _macroName,
-                        SourceLineInfo const& _lineInfo,
-                        char const * _capturedExpression,
-                        ResultDisposition::Flags _resultDisposition,
-                        char const * _secondArg = "");
-
-        char const * macroName;
-        SourceLineInfo lineInfo;
-        char const * capturedExpression;
-        ResultDisposition::Flags resultDisposition;
-        char const * secondArg;
-    };
-
     struct AssertionResultData
     {
-        AssertionResultData() : decomposedExpression( CATCH_NULL )
-                              , resultType( ResultWas::Unknown )
-                              , negated( false )
-                              , parenthesized( false ) {}
-
-        void negate( bool parenthesize ) {
-            negated = !negated;
-            parenthesized = parenthesize;
-            if( resultType == ResultWas::Ok )
-                resultType = ResultWas::ExpressionFailed;
-            else if( resultType == ResultWas::ExpressionFailed )
-                resultType = ResultWas::Ok;
-        }
+        AssertionResultData() = delete;
 
-        std::string const& reconstructExpression() const {
-            if( decomposedExpression != CATCH_NULL ) {
-                decomposedExpression->reconstructExpression( reconstructedExpression );
-                if( parenthesized ) {
-                    reconstructedExpression.insert( 0, 1, '(' );
-                    reconstructedExpression.append( 1, ')' );
-                }
-                if( negated ) {
-                    reconstructedExpression.insert( 0, 1, '!' );
-                }
-                decomposedExpression = CATCH_NULL;
-            }
-            return reconstructedExpression;
-        }
+        AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression );
 
-        mutable DecomposedExpression const* decomposedExpression;
-        mutable std::string reconstructedExpression;
         std::string message;
+        mutable std::string reconstructedExpression;
+        LazyExpression lazyExpression;
         ResultWas::OfType resultType;
-        bool negated;
-        bool parenthesized;
+
+        std::string reconstructExpression() const;
     };
 
     class AssertionResult {
     public:
-        AssertionResult();
+        AssertionResult() = delete;
         AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
-        ~AssertionResult();
-#  ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
-         AssertionResult( AssertionResult const& )              = default;
-         AssertionResult( AssertionResult && )                  = default;
-         AssertionResult& operator = ( AssertionResult const& ) = default;
-         AssertionResult& operator = ( AssertionResult && )     = default;
-#  endif
 
         bool isOk() const;
         bool succeeded() const;
@@ -115,11 +47,9 @@ namespace Catch {
         std::string getExpandedExpression() const;
         std::string getMessage() const;
         SourceLineInfo getSourceInfo() const;
-        std::string getTestMacroName() const;
-        void discardDecomposedExpression() const;
-        void expandDecomposedExpression() const;
+        StringRef getTestMacroName() const;
 
-    protected:
+    //protected:
         AssertionInfo m_info;
         AssertionResultData m_resultData;
     };

+ 0 - 109
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_assertionresult.hpp

@@ -1,109 +0,0 @@
-/*
- *  Created by Phil on 8/8/12
- *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED
-
-#include "catch_assertionresult.h"
-
-namespace Catch {
-
-
-    AssertionInfo::AssertionInfo():macroName(""), capturedExpression(""), resultDisposition(ResultDisposition::Normal), secondArg(""){}
-
-    AssertionInfo::AssertionInfo(   char const * _macroName,
-                                    SourceLineInfo const& _lineInfo,
-                                    char const * _capturedExpression,
-                                    ResultDisposition::Flags _resultDisposition,
-                                    char const * _secondArg)
-    :   macroName( _macroName ),
-        lineInfo( _lineInfo ),
-        capturedExpression( _capturedExpression ),
-        resultDisposition( _resultDisposition ),
-        secondArg( _secondArg )
-    {}
-
-    AssertionResult::AssertionResult() {}
-
-    AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
-    :   m_info( info ),
-        m_resultData( data )
-    {}
-
-    AssertionResult::~AssertionResult() {}
-
-    // Result was a success
-    bool AssertionResult::succeeded() const {
-        return Catch::isOk( m_resultData.resultType );
-    }
-
-    // Result was a success, or failure is suppressed
-    bool AssertionResult::isOk() const {
-        return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
-    }
-
-    ResultWas::OfType AssertionResult::getResultType() const {
-        return m_resultData.resultType;
-    }
-
-    bool AssertionResult::hasExpression() const {
-        return m_info.capturedExpression[0] != 0;
-    }
-
-    bool AssertionResult::hasMessage() const {
-        return !m_resultData.message.empty();
-    }
-
-    std::string capturedExpressionWithSecondArgument( char const * capturedExpression, char const * secondArg ) {
-        return (secondArg[0] == 0 || secondArg[0] == '"' && secondArg[1] == '"')
-            ? capturedExpression
-            : std::string(capturedExpression) + ", " + secondArg;
-    }
-
-    std::string AssertionResult::getExpression() const {
-        if( isFalseTest( m_info.resultDisposition ) )
-            return "!(" + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg) + ")";
-        else
-            return capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg);
-    }
-    std::string AssertionResult::getExpressionInMacro() const {
-        if( m_info.macroName[0] == 0 )
-            return capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg);
-        else
-            return std::string(m_info.macroName) + "( " + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg) + " )";
-    }
-
-    bool AssertionResult::hasExpandedExpression() const {
-        return hasExpression() && getExpandedExpression() != getExpression();
-    }
-
-    std::string AssertionResult::getExpandedExpression() const {
-        return m_resultData.reconstructExpression();
-    }
-
-    std::string AssertionResult::getMessage() const {
-        return m_resultData.message;
-    }
-    SourceLineInfo AssertionResult::getSourceInfo() const {
-        return m_info.lineInfo;
-    }
-
-    std::string AssertionResult::getTestMacroName() const {
-        return m_info.macroName;
-    }
-
-    void AssertionResult::discardDecomposedExpression() const {
-        m_resultData.decomposedExpression = CATCH_NULL;
-    }
-
-    void AssertionResult::expandDecomposedExpression() const {
-        m_resultData.reconstructExpression();
-    }
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED

+ 84 - 113
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_capture.hpp

@@ -8,179 +8,150 @@
 #ifndef TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
 
-#include "catch_result_builder.h"
-#include "catch_message.h"
+#include "catch_assertionhandler.h"
 #include "catch_interfaces_capture.h"
-#include "catch_debugger.h"
-#include "catch_common.h"
-#include "catch_tostring.h"
-#include "catch_interfaces_runner.h"
-#include "catch_compiler_capabilities.h"
+#include "catch_message.h"
+#include "catch_stringref.h"
 
+#if !defined(CATCH_CONFIG_DISABLE)
 
 #if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
-# define CATCH_INTERNAL_STRINGIFY(expr) #expr
+  #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
 #else
-# define CATCH_INTERNAL_STRINGIFY(expr) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
+  #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
 #endif
 
-#if defined(CATCH_CONFIG_FAST_COMPILE)
-///////////////////////////////////////////////////////////////////////////////
-// We can speedup compilation significantly by breaking into debugger lower in
-// the callstack, because then we don't have to expand CATCH_BREAK_INTO_DEBUGGER
-// macro in each assertion
-#define INTERNAL_CATCH_REACT( resultBuilder ) \
-    resultBuilder.react();
+#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
 
 ///////////////////////////////////////////////////////////////////////////////
 // Another way to speed-up compilation is to omit local try-catch for REQUIRE*
 // macros.
-// This can potentially cause false negative, if the test code catches
-// the exception before it propagates back up to the runner.
-#define INTERNAL_CATCH_TEST_NO_TRY( macroName, resultDisposition, expr ) \
-    do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition ); \
-        __catchResult.setExceptionGuard(); \
-        CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
-        ( __catchResult <= expr ).endExpression(); \
-        CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
-        __catchResult.unsetExceptionGuard(); \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::isTrue( false && static_cast<bool>( !!(expr) ) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look
-// The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&.
-
-#define INTERNAL_CHECK_THAT_NO_TRY( macroName, matcher, resultDisposition, arg ) \
-    do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
-        __catchResult.setExceptionGuard(); \
-        __catchResult.captureMatch( arg, matcher, CATCH_INTERNAL_STRINGIFY(matcher) ); \
-        __catchResult.unsetExceptionGuard(); \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::alwaysFalse() )
+#define INTERNAL_CATCH_TRY
+#define INTERNAL_CATCH_CATCH( capturer )
+
+#else // CATCH_CONFIG_FAST_COMPILE
+
+#define INTERNAL_CATCH_TRY try
+#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); }
 
-#else
-///////////////////////////////////////////////////////////////////////////////
-// In the event of a failure works out if the debugger needs to be invoked
-// and/or an exception thrown and takes appropriate action.
-// This needs to be done as a macro so the debugger will stop in the user
-// source code rather than in Catch library code
-#define INTERNAL_CATCH_REACT( resultBuilder ) \
-    if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \
-    resultBuilder.react();
 #endif
 
+#define INTERNAL_CATCH_REACT( handler ) handler.complete();
 
 ///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TEST( macroName, resultDisposition, expr ) \
+#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
     do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition ); \
-        try { \
+        Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
+        INTERNAL_CATCH_TRY { \
             CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
-            ( __catchResult <= expr ).endExpression(); \
+            catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
             CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
-        } \
-        catch( ... ) { \
-            __catchResult.useActiveException( resultDisposition ); \
-        } \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::isTrue( false && static_cast<bool>( !!(expr) ) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look
+        } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
+        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+    } while( (void)0, (false) && static_cast<bool>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look
     // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&.
 
 ///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_IF( macroName, resultDisposition, expr ) \
-    INTERNAL_CATCH_TEST( macroName, resultDisposition, expr ); \
+#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
+    INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
     if( Catch::getResultCapture().lastAssertionPassed() )
 
 ///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, expr ) \
-    INTERNAL_CATCH_TEST( macroName, resultDisposition, expr ); \
+#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
+    INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
     if( !Catch::getResultCapture().lastAssertionPassed() )
 
 ///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, expr ) \
+#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
     do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition ); \
+        Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
         try { \
-            static_cast<void>(expr); \
-            __catchResult.captureResult( Catch::ResultWas::Ok ); \
+            static_cast<void>(__VA_ARGS__); \
+            catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
         } \
         catch( ... ) { \
-            __catchResult.useActiveException( resultDisposition ); \
+            catchAssertionHandler.handleUnexpectedInflightException(); \
         } \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::alwaysFalse() )
+        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+    } while( false )
 
 ///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, matcher, expr ) \
+#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
     do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition, CATCH_INTERNAL_STRINGIFY(matcher) ); \
-        if( __catchResult.allowThrows() ) \
+        Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
+        if( catchAssertionHandler.allowThrows() ) \
             try { \
-                static_cast<void>(expr); \
-                __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
+                static_cast<void>(__VA_ARGS__); \
+                catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
             } \
             catch( ... ) { \
-                __catchResult.captureExpectedException( matcher ); \
+                catchAssertionHandler.handleExceptionThrownAsExpected(); \
             } \
         else \
-            __catchResult.captureResult( Catch::ResultWas::Ok ); \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::alwaysFalse() )
+            catchAssertionHandler.handleThrowingCallSkipped(); \
+        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+    } while( false )
 
 ///////////////////////////////////////////////////////////////////////////////
 #define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
     do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
-        if( __catchResult.allowThrows() ) \
+        Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
+        if( catchAssertionHandler.allowThrows() ) \
             try { \
                 static_cast<void>(expr); \
-                __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
+                catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
             } \
-            catch( exceptionType ) { \
-                __catchResult.captureResult( Catch::ResultWas::Ok ); \
+            catch( exceptionType const& ) { \
+                catchAssertionHandler.handleExceptionThrownAsExpected(); \
             } \
             catch( ... ) { \
-                __catchResult.useActiveException( resultDisposition ); \
+                catchAssertionHandler.handleUnexpectedInflightException(); \
             } \
         else \
-            __catchResult.captureResult( Catch::ResultWas::Ok ); \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::alwaysFalse() )
+            catchAssertionHandler.handleThrowingCallSkipped(); \
+        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+    } while( false )
 
 
 ///////////////////////////////////////////////////////////////////////////////
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
-    #define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
-        do { \
-            Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
-            __catchResult << __VA_ARGS__ + ::Catch::StreamEndStop(); \
-            __catchResult.captureResult( messageType ); \
-            INTERNAL_CATCH_REACT( __catchResult ) \
-        } while( Catch::alwaysFalse() )
-#else
-    #define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, log ) \
-        do { \
-            Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
-            __catchResult << log + ::Catch::StreamEndStop(); \
-            __catchResult.captureResult( messageType ); \
-            INTERNAL_CATCH_REACT( __catchResult ) \
-        } while( Catch::alwaysFalse() )
-#endif
+#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
+    do { \
+        Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
+        catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
+        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+    } while( false )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
+    auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
+    varName.captureValues( 0, __VA_ARGS__ )
 
 ///////////////////////////////////////////////////////////////////////////////
 #define INTERNAL_CATCH_INFO( macroName, log ) \
-    Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) = Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log;
+    Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log );
 
 ///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \
+#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
+    Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
+
+///////////////////////////////////////////////////////////////////////////////
+// Although this is matcher-based, it can be used with just a string
+#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
     do { \
-        Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
-        try { \
-            __catchResult.captureMatch( arg, matcher, CATCH_INTERNAL_STRINGIFY(matcher) ); \
-        } catch( ... ) { \
-            __catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \
-        } \
-        INTERNAL_CATCH_REACT( __catchResult ) \
-    } while( Catch::alwaysFalse() )
+        Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
+        if( catchAssertionHandler.allowThrows() ) \
+            try { \
+                static_cast<void>(__VA_ARGS__); \
+                catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
+            } \
+            catch( ... ) { \
+                Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
+            } \
+        else \
+            catchAssertionHandler.handleThrowingCallSkipped(); \
+        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+    } while( false )
+
+#endif // CATCH_CONFIG_DISABLE
 
 #endif // TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED

+ 14 - 8
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_clara.h

@@ -11,21 +11,27 @@
 
 // Use Catch's value for console width (store Clara's off to the side, if present)
 #ifdef CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH
-#undef CLARA_CONFIG_CONSOLE_WIDTH
+#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
+#undef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
 #endif
-#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH
+#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wweak-vtables"
+#pragma clang diagnostic ignored "-Wexit-time-destructors"
+#pragma clang diagnostic ignored "-Wshadow"
+#endif
 
-// Declare Clara inside the Catch namespace
-#define STITCH_CLARA_OPEN_NAMESPACE namespace Catch {
-#include "../external/clara.h"
-#undef STITCH_CLARA_OPEN_NAMESPACE
+#include "../external/clara.hpp"
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 
 // Restore Clara's value for console width, if present
 #ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
+#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
 #undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
 #endif
 

+ 0 - 240
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_commandline.hpp

@@ -1,240 +0,0 @@
-/*
- *  Created by Phil on 02/11/2010.
- *  Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
-
-#include "catch_config.hpp"
-#include "catch_common.h"
-#include "catch_clara.h"
-
-#include <fstream>
-#include <ctime>
-
-namespace Catch {
-
-    inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; }
-    inline void abortAfterX( ConfigData& config, int x ) {
-        if( x < 1 )
-            throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" );
-        config.abortAfter = x;
-    }
-    inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); }
-    inline void addSectionToRun( ConfigData& config, std::string const& sectionName ) { config.sectionsToRun.push_back( sectionName ); }
-    inline void addReporterName( ConfigData& config, std::string const& _reporterName ) { config.reporterNames.push_back( _reporterName ); }
-
-    inline void addWarning( ConfigData& config, std::string const& _warning ) {
-        if( _warning == "NoAssertions" )
-            config.warnings = static_cast<WarnAbout::What>( config.warnings | WarnAbout::NoAssertions );
-        else
-            throw std::runtime_error( "Unrecognised warning: '" + _warning + '\'' );
-    }
-    inline void setOrder( ConfigData& config, std::string const& order ) {
-        if( startsWith( "declared", order ) )
-            config.runOrder = RunTests::InDeclarationOrder;
-        else if( startsWith( "lexical", order ) )
-            config.runOrder = RunTests::InLexicographicalOrder;
-        else if( startsWith( "random", order ) )
-            config.runOrder = RunTests::InRandomOrder;
-        else
-            throw std::runtime_error( "Unrecognised ordering: '" + order + '\'' );
-    }
-    inline void setRngSeed( ConfigData& config, std::string const& seed ) {
-        if( seed == "time" ) {
-            config.rngSeed = static_cast<unsigned int>( std::time(0) );
-        }
-        else {
-            std::stringstream ss;
-            ss << seed;
-            ss >> config.rngSeed;
-            if( ss.fail() )
-                throw std::runtime_error( "Argument to --rng-seed should be the word 'time' or a number" );
-        }
-    }
-    inline void setVerbosity( ConfigData& config, int level ) {
-        // !TBD: accept strings?
-        config.verbosity = static_cast<Verbosity::Level>( level );
-    }
-    inline void setShowDurations( ConfigData& config, bool _showDurations ) {
-        config.showDurations = _showDurations
-            ? ShowDurations::Always
-            : ShowDurations::Never;
-    }
-    inline void setUseColour( ConfigData& config, std::string const& value ) {
-        std::string mode = toLower( value );
-
-        if( mode == "yes" )
-            config.useColour = UseColour::Yes;
-        else if( mode == "no" )
-            config.useColour = UseColour::No;
-        else if( mode == "auto" )
-            config.useColour = UseColour::Auto;
-        else
-            throw std::runtime_error( "colour mode must be one of: auto, yes or no" );
-    }
-    inline void setWaitForKeypress( ConfigData& config, std::string const& keypress ) {
-        std::string keypressLc = toLower( keypress );
-        if( keypressLc == "start" )
-            config.waitForKeypress = WaitForKeypress::BeforeStart;
-        else if( keypressLc == "exit" )
-            config.waitForKeypress = WaitForKeypress::BeforeExit;
-        else if( keypressLc == "both" )
-            config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
-        else
-            throw std::runtime_error( "keypress argument must be one of: start, exit or both. '" + keypress + "' not recognised" );
-    };
-
-
-    inline void forceColour( ConfigData& config ) {
-        config.useColour = UseColour::Yes;
-    }
-    inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) {
-        std::ifstream f( _filename.c_str() );
-        if( !f.is_open() )
-            throw std::domain_error( "Unable to load input file: " + _filename );
-
-        std::string line;
-        while( std::getline( f, line ) ) {
-            line = trim(line);
-            if( !line.empty() && !startsWith( line, '#' ) ) {
-                if( !startsWith( line, '"' ) )
-                    line = '"' + line + '"';
-                addTestOrTags( config, line + ',' );
-            }
-        }
-    }
-
-    inline Clara::CommandLine<ConfigData> makeCommandLineParser() {
-
-        using namespace Clara;
-        CommandLine<ConfigData> cli;
-
-        cli.bindProcessName( &ConfigData::processName );
-
-        cli["-?"]["-h"]["--help"]
-            .describe( "display usage information" )
-            .bind( &ConfigData::showHelp );
-
-        cli["-l"]["--list-tests"]
-            .describe( "list all/matching test cases" )
-            .bind( &ConfigData::listTests );
-
-        cli["-t"]["--list-tags"]
-            .describe( "list all/matching tags" )
-            .bind( &ConfigData::listTags );
-
-        cli["-s"]["--success"]
-            .describe( "include successful tests in output" )
-            .bind( &ConfigData::showSuccessfulTests );
-
-        cli["-b"]["--break"]
-            .describe( "break into debugger on failure" )
-            .bind( &ConfigData::shouldDebugBreak );
-
-        cli["-e"]["--nothrow"]
-            .describe( "skip exception tests" )
-            .bind( &ConfigData::noThrow );
-
-        cli["-i"]["--invisibles"]
-            .describe( "show invisibles (tabs, newlines)" )
-            .bind( &ConfigData::showInvisibles );
-
-        cli["-o"]["--out"]
-            .describe( "output filename" )
-            .bind( &ConfigData::outputFilename, "filename" );
-
-        cli["-r"]["--reporter"]
-//            .placeholder( "name[:filename]" )
-            .describe( "reporter to use (defaults to console)" )
-            .bind( &addReporterName, "name" );
-
-        cli["-n"]["--name"]
-            .describe( "suite name" )
-            .bind( &ConfigData::name, "name" );
-
-        cli["-a"]["--abort"]
-            .describe( "abort at first failure" )
-            .bind( &abortAfterFirst );
-
-        cli["-x"]["--abortx"]
-            .describe( "abort after x failures" )
-            .bind( &abortAfterX, "no. failures" );
-
-        cli["-w"]["--warn"]
-            .describe( "enable warnings" )
-            .bind( &addWarning, "warning name" );
-
-// - needs updating if reinstated
-//        cli.into( &setVerbosity )
-//            .describe( "level of verbosity (0=no output)" )
-//            .shortOpt( "v")
-//            .longOpt( "verbosity" )
-//            .placeholder( "level" );
-
-        cli[_]
-            .describe( "which test or tests to use" )
-            .bind( &addTestOrTags, "test name, pattern or tags" );
-
-        cli["-d"]["--durations"]
-            .describe( "show test durations" )
-            .bind( &setShowDurations, "yes|no" );
-
-        cli["-f"]["--input-file"]
-            .describe( "load test names to run from a file" )
-            .bind( &loadTestNamesFromFile, "filename" );
-
-        cli["-#"]["--filenames-as-tags"]
-            .describe( "adds a tag for the filename" )
-            .bind( &ConfigData::filenamesAsTags );
-
-        cli["-c"]["--section"]
-                .describe( "specify section to run" )
-                .bind( &addSectionToRun, "section name" );
-
-        // Less common commands which don't have a short form
-        cli["--list-test-names-only"]
-            .describe( "list all/matching test cases names only" )
-            .bind( &ConfigData::listTestNamesOnly );
-
-        cli["--list-extra-info"]
-            .describe( "list all/matching test cases with more info" )
-            .bind( &ConfigData::listExtraInfo );
-
-        cli["--list-reporters"]
-            .describe( "list all reporters" )
-            .bind( &ConfigData::listReporters );
-
-        cli["--order"]
-            .describe( "test case order (defaults to decl)" )
-            .bind( &setOrder, "decl|lex|rand" );
-
-        cli["--rng-seed"]
-            .describe( "set a specific seed for random numbers" )
-            .bind( &setRngSeed, "'time'|number" );
-
-        cli["--force-colour"]
-            .describe( "force colourised output (deprecated)" )
-            .bind( &forceColour );
-
-        cli["--use-colour"]
-            .describe( "should output be colourised" )
-            .bind( &setUseColour, "yes|no" );
-
-        cli["--libidentify"]
-            .describe( "report name and version according to libidentify standard" )
-            .bind( &ConfigData::libIdentify );
-
-        cli["--wait-for-keypress"]
-                .describe( "waits for a keypress before exiting" )
-                .bind( &setWaitForKeypress, "start|exit|both" );
-
-        return cli;
-    }
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED

+ 27 - 81
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_common.h

@@ -18,95 +18,48 @@
 #  define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
 #endif
 
-#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr
-#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
+#include <iosfwd>
+#include <string>
+#include <cstdint>
 
-#include <sstream>
-#include <algorithm>
+// We need a dummy global operator<< so we can bring it into Catch namespace later
+struct Catch_global_namespace_dummy {};
+std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
 
 namespace Catch {
 
-    struct IConfig;
-
     struct CaseSensitive { enum Choice {
         Yes,
         No
     }; };
 
     class NonCopyable {
-#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
         NonCopyable( NonCopyable const& )              = delete;
         NonCopyable( NonCopyable && )                  = delete;
         NonCopyable& operator = ( NonCopyable const& ) = delete;
         NonCopyable& operator = ( NonCopyable && )     = delete;
-#else
-        NonCopyable( NonCopyable const& info );
-        NonCopyable& operator = ( NonCopyable const& );
-#endif
 
     protected:
-        NonCopyable() {}
+        NonCopyable();
         virtual ~NonCopyable();
     };
 
-    class SafeBool {
-    public:
-        typedef void (SafeBool::*type)() const;
-
-        static type makeSafe( bool value ) {
-            return value ? &SafeBool::trueValue : 0;
-        }
-    private:
-        void trueValue() const {}
-    };
-
-    template<typename ContainerT>
-    void deleteAll( ContainerT& container ) {
-        typename ContainerT::const_iterator it = container.begin();
-        typename ContainerT::const_iterator itEnd = container.end();
-        for(; it != itEnd; ++it )
-            delete *it;
-    }
-    template<typename AssociativeContainerT>
-    void deleteAllValues( AssociativeContainerT& container ) {
-        typename AssociativeContainerT::const_iterator it = container.begin();
-        typename AssociativeContainerT::const_iterator itEnd = container.end();
-        for(; it != itEnd; ++it )
-            delete it->second;
-    }
-
-    bool startsWith( std::string const& s, std::string const& prefix );
-    bool startsWith( std::string const& s, char prefix );
-    bool endsWith( std::string const& s, std::string const& suffix );
-    bool endsWith( std::string const& s, char suffix );
-    bool contains( std::string const& s, std::string const& infix );
-    void toLowerInPlace( std::string& s );
-    std::string toLower( std::string const& s );
-    std::string trim( std::string const& str );
-    bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
-
-    struct pluralise {
-        pluralise( std::size_t count, std::string const& label );
-
-        friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
+    struct SourceLineInfo {
 
-        std::size_t m_count;
-        std::string m_label;
-    };
+        SourceLineInfo() = delete;
+        SourceLineInfo( char const* _file, std::size_t _line ) noexcept
+        :   file( _file ),
+            line( _line )
+        {}
 
-    struct SourceLineInfo {
+        SourceLineInfo( SourceLineInfo const& other )            = default;
+        SourceLineInfo& operator = ( SourceLineInfo const& )     = default;
+        SourceLineInfo( SourceLineInfo&& )              noexcept = default;
+        SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
 
-        SourceLineInfo();
-        SourceLineInfo( char const* _file, std::size_t _line );
-#  ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
-        SourceLineInfo(SourceLineInfo const& other)          = default;
-        SourceLineInfo( SourceLineInfo && )                  = default;
-        SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
-        SourceLineInfo& operator = ( SourceLineInfo && )     = default;
-#  endif
-        bool empty() const;
-        bool operator == ( SourceLineInfo const& other ) const;
-        bool operator < ( SourceLineInfo const& other ) const;
+        bool empty() const noexcept { return file[0] == '\0'; }
+        bool operator == ( SourceLineInfo const& other ) const noexcept;
+        bool operator < ( SourceLineInfo const& other ) const noexcept;
 
         char const* file;
         std::size_t line;
@@ -114,24 +67,17 @@ namespace Catch {
 
     std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
 
-    // This is just here to avoid compiler warnings with macro constants and boolean literals
-    inline bool isTrue( bool value ){ return value; }
-    inline bool alwaysTrue() { return true; }
-    inline bool alwaysFalse() { return false; }
-
-    void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo );
-
-    void seedRng( IConfig const& config );
-    unsigned int rngSeed();
+    // Bring in operator<< from global namespace into Catch namespace
+    // This is necessary because the overload of operator<< above makes
+    // lookup stop at namespace Catch
+    using ::operator<<;
 
     // Use this in variadic streaming macros to allow
     //    >> +StreamEndStop
     // as well as
     //    >> stuff +StreamEndStop
     struct StreamEndStop {
-        std::string operator+() {
-            return std::string();
-        }
+        std::string operator+() const;
     };
     template<typename T>
     T const& operator + ( T const& value, StreamEndStop ) {
@@ -139,8 +85,8 @@ namespace Catch {
     }
 }
 
-#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
-#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
+#define CATCH_INTERNAL_LINEINFO \
+    ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
 
 #endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
 

+ 0 - 119
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_common.hpp

@@ -1,119 +0,0 @@
-/*
- *  Created by Phil on 27/11/2013.
- *  Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED
-
-#include "catch_common.h"
-
-#include <cstring>
-#include <cctype>
-
-namespace Catch {
-
-    bool startsWith( std::string const& s, std::string const& prefix ) {
-        return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
-    }
-    bool startsWith( std::string const& s, char prefix ) {
-        return !s.empty() && s[0] == prefix;
-    }
-    bool endsWith( std::string const& s, std::string const& suffix ) {
-        return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
-    }
-    bool endsWith( std::string const& s, char suffix ) {
-        return !s.empty() && s[s.size()-1] == suffix;
-    }
-    bool contains( std::string const& s, std::string const& infix ) {
-        return s.find( infix ) != std::string::npos;
-    }
-    char toLowerCh(char c) {
-        return static_cast<char>( std::tolower( c ) );
-    }
-    void toLowerInPlace( std::string& s ) {
-        std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
-    }
-    std::string toLower( std::string const& s ) {
-        std::string lc = s;
-        toLowerInPlace( lc );
-        return lc;
-    }
-    std::string trim( std::string const& str ) {
-        static char const* whitespaceChars = "\n\r\t ";
-        std::string::size_type start = str.find_first_not_of( whitespaceChars );
-        std::string::size_type end = str.find_last_not_of( whitespaceChars );
-
-        return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
-    }
-
-    bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
-        bool replaced = false;
-        std::size_t i = str.find( replaceThis );
-        while( i != std::string::npos ) {
-            replaced = true;
-            str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
-            if( i < str.size()-withThis.size() )
-                i = str.find( replaceThis, i+withThis.size() );
-            else
-                i = std::string::npos;
-        }
-        return replaced;
-    }
-
-    pluralise::pluralise( std::size_t count, std::string const& label )
-    :   m_count( count ),
-        m_label( label )
-    {}
-
-    std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
-        os << pluraliser.m_count << ' ' << pluraliser.m_label;
-        if( pluraliser.m_count != 1 )
-            os << 's';
-        return os;
-    }
-
-    SourceLineInfo::SourceLineInfo() : file(""), line( 0 ){}
-    SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line )
-    :   file( _file ),
-        line( _line )
-    {}
-    bool SourceLineInfo::empty() const {
-        return file[0] == '\0';
-    }
-    bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const {
-        return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0);
-    }
-    bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const {
-        return line < other.line || ( line == other.line && (std::strcmp(file, other.file) < 0));
-    }
-
-    void seedRng( IConfig const& config ) {
-        if( config.rngSeed() != 0 )
-            std::srand( config.rngSeed() );
-    }
-    unsigned int rngSeed() {
-        return getCurrentContext().getConfig()->rngSeed();
-    }
-
-    std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
-#ifndef __GNUG__
-        os << info.file << '(' << info.line << ')';
-#else
-        os << info.file << ':' << info.line;
-#endif
-        return os;
-    }
-
-    void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) {
-        std::ostringstream oss;
-        oss << locationInfo << ": Internal Catch error: '" << message << '\'';
-        if( alwaysTrue() )
-            throw std::logic_error( oss.str() );
-    }
-}
-
-#endif // TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED
-

+ 216 - 200
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_compiler_capabilities.h

@@ -8,65 +8,48 @@
 #ifndef TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
 
-// Detect a number of compiler features - mostly C++11/14 conformance - by compiler
+// Detect a number of compiler features - by compiler
 // The following features are defined:
 //
-// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported?
-// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported?
-// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods
-// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported?
-// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported
-// CATCH_CONFIG_CPP11_LONG_LONG : is long long supported?
-// CATCH_CONFIG_CPP11_OVERRIDE : is override supported?
-// CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr)
-// CATCH_CONFIG_CPP11_SHUFFLE : is std::shuffle supported?
-// CATCH_CONFIG_CPP11_TYPE_TRAITS : are type_traits and enable_if supported?
-
-// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
-
-// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
 // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
 // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
 // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
+// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
 // ****************
 // Note to maintainers: if new toggles are added please document them
 // in configuration.md, too
 // ****************
 
 // In general each macro has a _NO_<feature name> form
-// (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature.
+// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
 // Many features, at point of detection, define an _INTERNAL_ macro, so they
 // can be combined, en-mass, with the _NO_ forms later.
 
-// All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11
+#include "catch_platform.h"
 
 #ifdef __cplusplus
 
-#  if __cplusplus >= 201103L
-#    define CATCH_CPP11_OR_GREATER
+#  if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
+#    define CATCH_CPP14_OR_GREATER
 #  endif
 
-#  if __cplusplus >= 201402L
-#    define CATCH_CPP14_OR_GREATER
+#  if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#    define CATCH_CPP17_OR_GREATER
 #  endif
 
 #endif
 
-#ifdef __clang__
-
-#  if __has_feature(cxx_nullptr)
-#    define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-#  endif
+#if defined(CATCH_CPP17_OR_GREATER)
+#  define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
+#endif
 
-#  if __has_feature(cxx_noexcept)
-#    define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#  endif
+#ifdef __clang__
 
-#   if defined(CATCH_CPP11_OR_GREATER)
-#       define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \
+#       define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
             _Pragma( "clang diagnostic push" ) \
-            _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" )
-#       define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \
+            _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
+            _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
+#       define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \
             _Pragma( "clang diagnostic pop" )
 
 #       define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
@@ -74,19 +57,32 @@
             _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
 #       define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
             _Pragma( "clang diagnostic pop" )
-#   endif
+
+#       define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
+            _Pragma( "clang diagnostic push" ) \
+            _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
+#       define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS \
+            _Pragma( "clang diagnostic pop" )
+
+#       define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
+            _Pragma( "clang diagnostic push" ) \
+            _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
+#       define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS \
+            _Pragma( "clang diagnostic pop" )
 
 #endif // __clang__
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// We know some environments not to support full POSIX signals
-#if defined(__CYGWIN__) || defined(__QNX__)
-
-#   if !defined(CATCH_CONFIG_POSIX_SIGNALS)
-#       define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-#   endif
+// Assume that non-Windows platforms support posix signals by default
+#if !defined(CATCH_PLATFORM_WINDOWS)
+    #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
+#endif
 
+////////////////////////////////////////////////////////////////////////////////
+// We know some environments not to support full POSIX signals
+#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
+    #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
 #endif
 
 #ifdef __OS400__
@@ -94,6 +90,25 @@
 #       define CATCH_CONFIG_COLOUR_NONE
 #endif
 
+////////////////////////////////////////////////////////////////////////////////
+// Android somehow still does not support std::to_string
+#if defined(__ANDROID__)
+#    define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
+#    define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// Not all Windows environments support SEH properly
+#if defined(__MINGW32__)
+#    define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// PS4
+#if defined(__ORBIS__)
+#    define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
+#endif
+
 ////////////////////////////////////////////////////////////////////////////////
 // Cygwin
 #ifdef __CYGWIN__
@@ -101,222 +116,223 @@
 // Required for some versions of Cygwin to declare gettimeofday
 // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
 #   define _BSD_SOURCE
+// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
+// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
+# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
+           && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+
+#    define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
 
+# endif
 #endif // __CYGWIN__
 
 ////////////////////////////////////////////////////////////////////////////////
-// Borland
-#ifdef __BORLANDC__
+// Visual C++
+#ifdef _MSC_VER
 
 
-#endif // __BORLANDC__
+#  if _MSC_VER >= 1900 // Visual Studio 2015 or newer
+#    define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
+#  endif
 
-////////////////////////////////////////////////////////////////////////////////
-// EDG
-#ifdef __EDG_VERSION__
+// Universal Windows platform does not support SEH
+// Or console colours (or console at all...)
+#  if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+#    define CATCH_CONFIG_COLOUR_NONE
+#  else
+#    define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
+#  endif
 
+// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
+// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
+// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
+#  if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
+#    define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#  endif
+#endif // _MSC_VER
 
-#endif // __EDG_VERSION__
+#if defined(_REENTRANT) || defined(_MSC_VER)
+// Enable async processing, as -pthread is specified or no additional linking is required
+# define CATCH_INTERNAL_CONFIG_USE_ASYNC
+#endif // _MSC_VER
 
 ////////////////////////////////////////////////////////////////////////////////
-// Digital Mars
-#ifdef __DMC__
-
-
-#endif // __DMC__
+// Check if we are compiled with -fno-exceptions or equivalent
+#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
+#  define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
+#endif
 
 ////////////////////////////////////////////////////////////////////////////////
-// GCC
-#ifdef __GNUC__
-
-#   if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
-#       define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-#   endif
+// DJGPP
+#ifdef __DJGPP__
+#  define CATCH_INTERNAL_CONFIG_NO_WCHAR
+#endif // __DJGPP__
 
+////////////////////////////////////////////////////////////////////////////////
+// Embarcadero C++Build
+#if defined(__BORLANDC__)
+    #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
+#endif
 
-// - otherwise more recent versions define __cplusplus >= 201103L
-// and will get picked up below
+////////////////////////////////////////////////////////////////////////////////
 
+// Use of __COUNTER__ is suppressed during code analysis in
+// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
+// handled by it.
+// Otherwise all supported compilers support COUNTER macro,
+// but user still might want to turn it off
+#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
+    #define CATCH_INTERNAL_CONFIG_COUNTER
+#endif
 
-#endif // __GNUC__
 
 ////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#ifdef _MSC_VER
-
-#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
 
-#if (_MSC_VER >= 1600)
-#   define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-#   define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
+// RTX is a special version of Windows that is real time.
+// This means that it is detected as Windows, but does not provide
+// the same set of capabilities as real Windows does.
+#if defined(UNDER_RTSS) || defined(RTX64_BUILD)
+    #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
+    #define CATCH_INTERNAL_CONFIG_NO_ASYNC
+    #define CATCH_CONFIG_COLOUR_NONE
 #endif
 
-#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
-#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE
-#define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS
+#if defined(__UCLIBC__)
+#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
 #endif
 
-#endif // _MSC_VER
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Use variadic macros if the compiler supports them
-#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \
-    ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \
-    ( defined __GNUC__ && __GNUC__ >= 3 ) || \
-    ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L )
+// Various stdlib support checks that require __has_include
+#if defined(__has_include)
+  // Check if string_view is available and usable
+  #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
+  #    define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
+  #endif
+
+  // Check if optional is available and usable
+  #  if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
+  #    define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
+  #  endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
+
+  // Check if byte is available and usable
+  #  if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
+  #    define CATCH_INTERNAL_CONFIG_CPP17_BYTE
+  #  endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
+
+  // Check if variant is available and usable
+  #  if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
+  #    if defined(__clang__) && (__clang_major__ < 8)
+         // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
+         // fix should be in clang 8, workaround in libstdc++ 8.2
+  #      include <ciso646>
+  #      if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
+  #        define CATCH_CONFIG_NO_CPP17_VARIANT
+  #      else
+  #        define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
+  #      endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
+  #    else
+  #      define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
+  #    endif // defined(__clang__) && (__clang_major__ < 8)
+  #  endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
+#endif // defined(__has_include)
 
-#define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
 
+#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
+#   define CATCH_CONFIG_COUNTER
 #endif
-
-// Use __COUNTER__ if the compiler supports it
-#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \
-    ( defined __GNUC__  && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 )) ) || \
-    ( defined __clang__ && __clang_major__ >= 3 )
-
-// Use of __COUNTER__ is suppressed during code analysis in CLion/AppCode 2017.2.x and former,
-// because __COUNTER__ is not properly handled by it.
-// This does not affect compilation
-#if ( !defined __JETBRAINS_IDE__ || __JETBRAINS_IDE__ >= 20170300L )
-    #define CATCH_INTERNAL_CONFIG_COUNTER
+#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
+#   define CATCH_CONFIG_WINDOWS_SEH
 #endif
-
+// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
+#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
+#   define CATCH_CONFIG_POSIX_SIGNALS
+#endif
+// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
+#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
+#   define CATCH_CONFIG_WCHAR
 #endif
 
-////////////////////////////////////////////////////////////////////////////////
-// C++ language feature support
-
-// catch all support for C++11
-#if defined(CATCH_CPP11_OR_GREATER)
-
-#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR)
-#    define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-#  endif
-
-#  ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#    define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#  endif
-
-#  ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#    define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#  endif
+#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
+#    define CATCH_CONFIG_CPP11_TO_STRING
+#endif
 
-#  ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM
-#    define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM
-#  endif
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
+#  define CATCH_CONFIG_CPP17_OPTIONAL
+#endif
 
-#  ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE
-#    define CATCH_INTERNAL_CONFIG_CPP11_TUPLE
-#  endif
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
+#  define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
+#endif
 
-#  ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
-#    define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
-#  endif
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
+#  define CATCH_CONFIG_CPP17_STRING_VIEW
+#endif
 
-#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG)
-#    define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG
-#  endif
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
+#  define CATCH_CONFIG_CPP17_VARIANT
+#endif
 
-#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE)
-#    define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE
-#  endif
-#  if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR)
-#    define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-#  endif
-# if !defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE)
-#   define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE
-#  endif
-# if !defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS)
-#  define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS
-# endif
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
+#  define CATCH_CONFIG_CPP17_BYTE
+#endif
 
-#endif // __cplusplus >= 201103L
 
-// Now set the actual defines based on the above + anything the user has configured
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_NULLPTR
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_NOEXCEPT
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_GENERATED_METHODS
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_IS_ENUM
+#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
+#  define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
 #endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_TUPLE
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS)
-#   define CATCH_CONFIG_VARIADIC_MACROS
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_LONG_LONG
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_OVERRIDE
+
+#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE)
+#  define CATCH_CONFIG_NEW_CAPTURE
 #endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_UNIQUE_PTR
+
+#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+#  define CATCH_CONFIG_DISABLE_EXCEPTIONS
 #endif
-#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
-#   define CATCH_CONFIG_COUNTER
+
+#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
+#  define CATCH_CONFIG_POLYFILL_ISNAN
 #endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11)
-#   define CATCH_CONFIG_CPP11_SHUFFLE
+
+#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC)  && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
+#  define CATCH_CONFIG_USE_ASYNC
 #endif
-# if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11)
-#  define CATCH_CONFIG_CPP11_TYPE_TRAITS
-# endif
-#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH)
-#   define CATCH_CONFIG_WINDOWS_SEH
+
+#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE)
+#  define CATCH_CONFIG_ANDROID_LOGWRITE
 #endif
-// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
-#if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
-#   define CATCH_CONFIG_POSIX_SIGNALS
+
+#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
+#  define CATCH_CONFIG_GLOBAL_NEXTAFTER
 #endif
 
 #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
 #   define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
 #   define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS
 #endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS)
-#   define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS
-#   define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS
+#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
+#   define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
+#   define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS
 #endif
-
-// noexcept support:
-#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT)
-#  define CATCH_NOEXCEPT noexcept
-#  define CATCH_NOEXCEPT_IS(x) noexcept(x)
-#else
-#  define CATCH_NOEXCEPT throw()
-#  define CATCH_NOEXCEPT_IS(x)
+#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS)
+#   define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS
+#   define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS
 #endif
-
-// nullptr support
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-#   define CATCH_NULL nullptr
-#else
-#   define CATCH_NULL NULL
+#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
+#   define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
+#   define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS
 #endif
 
-// override support
-#ifdef CATCH_CONFIG_CPP11_OVERRIDE
-#   define CATCH_OVERRIDE override
+#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+#define CATCH_TRY if ((true))
+#define CATCH_CATCH_ALL if ((false))
+#define CATCH_CATCH_ANON(type) if ((false))
 #else
-#   define CATCH_OVERRIDE
+#define CATCH_TRY try
+#define CATCH_CATCH_ALL catch (...)
+#define CATCH_CATCH_ANON(type) catch (type)
 #endif
 
-// unique_ptr support
-#ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR
-#   define CATCH_AUTO_PTR( T ) std::unique_ptr<T>
-#else
-#   define CATCH_AUTO_PTR( T ) std::auto_ptr<T>
+#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
+#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
 #endif
 
 #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED

+ 74 - 110
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_config.hpp

@@ -8,15 +8,15 @@
 #ifndef TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
 
-#include "catch_test_spec_parser.hpp"
-#include "catch_context.h"
+#include "catch_test_spec_parser.h"
 #include "catch_interfaces_config.h"
+
+// Libstdc++ doesn't like incomplete classes for unique_ptr
 #include "catch_stream.h"
 
 #include <memory>
 #include <vector>
 #include <string>
-#include <stdexcept>
 
 #ifndef CATCH_CONFIG_CONSOLE_WIDTH
 #define CATCH_CONFIG_CONSOLE_WIDTH 80
@@ -24,140 +24,104 @@
 
 namespace Catch {
 
-    struct ConfigData {
+    struct IStream;
 
-        ConfigData()
-        :   listTests( false ),
-            listTags( false ),
-            listReporters( false ),
-            listTestNamesOnly( false ),
-            listExtraInfo( false ),
-            showSuccessfulTests( false ),
-            shouldDebugBreak( false ),
-            noThrow( false ),
-            showHelp( false ),
-            showInvisibles( false ),
-            filenamesAsTags( false ),
-            libIdentify( false ),
-            abortAfter( -1 ),
-            rngSeed( 0 ),
-            verbosity( Verbosity::Normal ),
-            warnings( WarnAbout::Nothing ),
-            showDurations( ShowDurations::DefaultForReporter ),
-            runOrder( RunTests::InDeclarationOrder ),
-            useColour( UseColour::Auto ),
-            waitForKeypress( WaitForKeypress::Never )
-        {}
-
-        bool listTests;
-        bool listTags;
-        bool listReporters;
-        bool listTestNamesOnly;
-        bool listExtraInfo;
-
-        bool showSuccessfulTests;
-        bool shouldDebugBreak;
-        bool noThrow;
-        bool showHelp;
-        bool showInvisibles;
-        bool filenamesAsTags;
-        bool libIdentify;
-
-        int abortAfter;
-        unsigned int rngSeed;
-
-        Verbosity::Level verbosity;
-        WarnAbout::What warnings;
-        ShowDurations::OrNot showDurations;
-        RunTests::InWhatOrder runOrder;
-        UseColour::YesOrNo useColour;
-        WaitForKeypress::When waitForKeypress;
+    struct ConfigData {
+        bool listTests = false;
+        bool listTags = false;
+        bool listReporters = false;
+        bool listTestNamesOnly = false;
+
+        bool showSuccessfulTests = false;
+        bool shouldDebugBreak = false;
+        bool noThrow = false;
+        bool showHelp = false;
+        bool showInvisibles = false;
+        bool filenamesAsTags = false;
+        bool libIdentify = false;
+
+        int abortAfter = -1;
+        unsigned int rngSeed = 0;
+
+        bool benchmarkNoAnalysis = false;
+        unsigned int benchmarkSamples = 100;
+        double benchmarkConfidenceInterval = 0.95;
+        unsigned int benchmarkResamples = 100000;
+
+        Verbosity verbosity = Verbosity::Normal;
+        WarnAbout::What warnings = WarnAbout::Nothing;
+        ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
+        RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
+        UseColour::YesOrNo useColour = UseColour::Auto;
+        WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
 
         std::string outputFilename;
         std::string name;
         std::string processName;
+#ifndef CATCH_CONFIG_DEFAULT_REPORTER
+#define CATCH_CONFIG_DEFAULT_REPORTER "console"
+#endif
+        std::string reporterName = CATCH_CONFIG_DEFAULT_REPORTER;
+#undef CATCH_CONFIG_DEFAULT_REPORTER
 
-        std::vector<std::string> reporterNames;
         std::vector<std::string> testsOrTags;
         std::vector<std::string> sectionsToRun;
     };
 
 
-    class Config : public SharedImpl<IConfig> {
-    private:
-        Config( Config const& other );
-        Config& operator = ( Config const& other );
-        virtual void dummy();
+    class Config : public IConfig {
     public:
 
-        Config()
-        {}
-
-        Config( ConfigData const& data )
-        :   m_data( data ),
-            m_stream( openStream() )
-        {
-            if( !data.testsOrTags.empty() ) {
-                TestSpecParser parser( ITagAliasRegistry::get() );
-                for( std::size_t i = 0; i < data.testsOrTags.size(); ++i )
-                    parser.parse( data.testsOrTags[i] );
-                m_testSpec = parser.testSpec();
-            }
-        }
-
-        virtual ~Config() {}
+        Config() = default;
+        Config( ConfigData const& data );
+        virtual ~Config() = default;
 
-        std::string const& getFilename() const {
-            return m_data.outputFilename ;
-        }
+        std::string const& getFilename() const;
 
-        bool listTests() const { return m_data.listTests; }
-        bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
-        bool listTags() const { return m_data.listTags; }
-        bool listReporters() const { return m_data.listReporters; }
-        bool listExtraInfo() const { return m_data.listExtraInfo; }
+        bool listTests() const;
+        bool listTestNamesOnly() const;
+        bool listTags() const;
+        bool listReporters() const;
 
-        std::string getProcessName() const { return m_data.processName; }
+        std::string getProcessName() const;
+        std::string const& getReporterName() const;
 
-        std::vector<std::string> const& getReporterNames() const { return m_data.reporterNames; }
-        std::vector<std::string> const& getSectionsToRun() const CATCH_OVERRIDE { return m_data.sectionsToRun; }
+        std::vector<std::string> const& getTestsOrTags() const override;
+        std::vector<std::string> const& getSectionsToRun() const override;
 
-        virtual TestSpec const& testSpec() const CATCH_OVERRIDE { return m_testSpec; }
+        TestSpec const& testSpec() const override;
+        bool hasTestFilters() const override;
 
-        bool showHelp() const { return m_data.showHelp; }
+        bool showHelp() const;
 
         // IConfig interface
-        virtual bool allowThrows() const CATCH_OVERRIDE                 { return !m_data.noThrow; }
-        virtual std::ostream& stream() const CATCH_OVERRIDE             { return m_stream->stream(); }
-        virtual std::string name() const CATCH_OVERRIDE                 { return m_data.name.empty() ? m_data.processName : m_data.name; }
-        virtual bool includeSuccessfulResults() const CATCH_OVERRIDE    { return m_data.showSuccessfulTests; }
-        virtual bool warnAboutMissingAssertions() const CATCH_OVERRIDE  { return m_data.warnings & WarnAbout::NoAssertions; }
-        virtual ShowDurations::OrNot showDurations() const CATCH_OVERRIDE { return m_data.showDurations; }
-        virtual RunTests::InWhatOrder runOrder() const CATCH_OVERRIDE   { return m_data.runOrder; }
-        virtual unsigned int rngSeed() const CATCH_OVERRIDE             { return m_data.rngSeed; }
-        virtual UseColour::YesOrNo useColour() const CATCH_OVERRIDE     { return m_data.useColour; }
-        virtual bool shouldDebugBreak() const CATCH_OVERRIDE { return m_data.shouldDebugBreak; }
-        virtual int abortAfter() const CATCH_OVERRIDE { return m_data.abortAfter; }
-        virtual bool showInvisibles() const CATCH_OVERRIDE { return m_data.showInvisibles; }
+        bool allowThrows() const override;
+        std::ostream& stream() const override;
+        std::string name() const override;
+        bool includeSuccessfulResults() const override;
+        bool warnAboutMissingAssertions() const override;
+        bool warnAboutNoTests() const override;
+        ShowDurations::OrNot showDurations() const override;
+        RunTests::InWhatOrder runOrder() const override;
+        unsigned int rngSeed() const override;
+        UseColour::YesOrNo useColour() const override;
+        bool shouldDebugBreak() const override;
+        int abortAfter() const override;
+        bool showInvisibles() const override;
+        Verbosity verbosity() const override;
+        bool benchmarkNoAnalysis() const override;
+        int benchmarkSamples() const override;
+        double benchmarkConfidenceInterval() const override;
+        unsigned int benchmarkResamples() const override;
 
     private:
 
-        IStream const* openStream() {
-            if( m_data.outputFilename.empty() )
-                return new CoutStream();
-            else if( m_data.outputFilename[0] == '%' ) {
-                if( m_data.outputFilename == "%debug" )
-                    return new DebugOutStream();
-                else
-                    throw std::domain_error( "Unrecognised stream: " + m_data.outputFilename );
-            }
-            else
-                return new FileStream( m_data.outputFilename );
-        }
+        IStream const* openStream();
         ConfigData m_data;
 
-        CATCH_AUTO_PTR( IStream const ) m_stream;
+        std::unique_ptr<IStream const> m_stream;
         TestSpec m_testSpec;
+        bool m_hasTestFilters = false;
     };
 
 } // end namespace Catch

+ 0 - 67
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_console_colour.hpp

@@ -1,67 +0,0 @@
-/*
- *  Created by Phil on 25/2/2012.
- *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
-
-#include "catch_common.h"
-
-namespace Catch {
-
-    struct Colour {
-        enum Code {
-            None = 0,
-
-            White,
-            Red,
-            Green,
-            Blue,
-            Cyan,
-            Yellow,
-            Grey,
-
-            Bright = 0x10,
-
-            BrightRed = Bright | Red,
-            BrightGreen = Bright | Green,
-            LightGrey = Bright | Grey,
-            BrightWhite = Bright | White,
-
-            // By intention
-            FileName = LightGrey,
-            Warning = Yellow,
-            ResultError = BrightRed,
-            ResultSuccess = BrightGreen,
-            ResultExpectedFailure = Warning,
-
-            Error = BrightRed,
-            Success = Green,
-
-            OriginalExpression = Cyan,
-            ReconstructedExpression = Yellow,
-
-            SecondaryText = LightGrey,
-            Headers = White
-        };
-
-        // Use constructed object for RAII guard
-        Colour( Code _colourCode );
-        Colour( Colour const& other );
-        ~Colour();
-
-        // Use static method for one-shot changes
-        static void use( Code _colourCode );
-
-    private:
-        bool m_moved;
-    };
-
-    inline std::ostream& operator << ( std::ostream& os, Colour const& ) { return os; }
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED

+ 0 - 192
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_console_colour_impl.hpp

@@ -1,192 +0,0 @@
-/*
- *  Created by Phil on 25/2/2012.
- *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
-
-#include "catch_console_colour.hpp"
-#include "catch_errno_guard.hpp"
-
-namespace Catch {
-    namespace {
-
-        struct IColourImpl {
-            virtual ~IColourImpl() {}
-            virtual void use( Colour::Code _colourCode ) = 0;
-        };
-
-        struct NoColourImpl : IColourImpl {
-            void use( Colour::Code ) {}
-
-            static IColourImpl* instance() {
-                static NoColourImpl s_instance;
-                return &s_instance;
-            }
-        };
-
-    } // anon namespace
-} // namespace Catch
-
-#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI )
-#   ifdef CATCH_PLATFORM_WINDOWS
-#       define CATCH_CONFIG_COLOUR_WINDOWS
-#   else
-#       define CATCH_CONFIG_COLOUR_ANSI
-#   endif
-#endif
-
-
-#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
-
-#include "catch_windows_h_proxy.h"
-
-namespace Catch {
-namespace {
-
-    class Win32ColourImpl : public IColourImpl {
-    public:
-        Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) )
-        {
-            CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
-            GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
-            originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
-            originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
-        }
-
-        virtual void use( Colour::Code _colourCode ) {
-            switch( _colourCode ) {
-                case Colour::None:      return setTextAttribute( originalForegroundAttributes );
-                case Colour::White:     return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
-                case Colour::Red:       return setTextAttribute( FOREGROUND_RED );
-                case Colour::Green:     return setTextAttribute( FOREGROUND_GREEN );
-                case Colour::Blue:      return setTextAttribute( FOREGROUND_BLUE );
-                case Colour::Cyan:      return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
-                case Colour::Yellow:    return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
-                case Colour::Grey:      return setTextAttribute( 0 );
-
-                case Colour::LightGrey:     return setTextAttribute( FOREGROUND_INTENSITY );
-                case Colour::BrightRed:     return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
-                case Colour::BrightGreen:   return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
-                case Colour::BrightWhite:   return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
-
-                case Colour::Bright: throw std::logic_error( "not a colour" );
-            }
-        }
-
-    private:
-        void setTextAttribute( WORD _textAttribute ) {
-            SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes );
-        }
-        HANDLE stdoutHandle;
-        WORD originalForegroundAttributes;
-        WORD originalBackgroundAttributes;
-    };
-
-    IColourImpl* platformColourInstance() {
-        static Win32ColourImpl s_instance;
-
-        Ptr<IConfig const> config = getCurrentContext().getConfig();
-        UseColour::YesOrNo colourMode = config
-            ? config->useColour()
-            : UseColour::Auto;
-        if( colourMode == UseColour::Auto )
-            colourMode = !isDebuggerActive()
-                ? UseColour::Yes
-                : UseColour::No;
-        return colourMode == UseColour::Yes
-            ? &s_instance
-            : NoColourImpl::instance();
-    }
-
-} // end anon namespace
-} // end namespace Catch
-
-#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
-
-#include <unistd.h>
-
-namespace Catch {
-namespace {
-
-    // use POSIX/ ANSI console terminal codes
-    // Thanks to Adam Strzelecki for original contribution
-    // (http://github.com/nanoant)
-    // https://github.com/philsquared/Catch/pull/131
-    class PosixColourImpl : public IColourImpl {
-    public:
-        virtual void use( Colour::Code _colourCode ) {
-            switch( _colourCode ) {
-                case Colour::None:
-                case Colour::White:     return setColour( "[0m" );
-                case Colour::Red:       return setColour( "[0;31m" );
-                case Colour::Green:     return setColour( "[0;32m" );
-                case Colour::Blue:      return setColour( "[0;34m" );
-                case Colour::Cyan:      return setColour( "[0;36m" );
-                case Colour::Yellow:    return setColour( "[0;33m" );
-                case Colour::Grey:      return setColour( "[1;30m" );
-
-                case Colour::LightGrey:     return setColour( "[0;37m" );
-                case Colour::BrightRed:     return setColour( "[1;31m" );
-                case Colour::BrightGreen:   return setColour( "[1;32m" );
-                case Colour::BrightWhite:   return setColour( "[1;37m" );
-
-                case Colour::Bright: throw std::logic_error( "not a colour" );
-            }
-        }
-        static IColourImpl* instance() {
-            static PosixColourImpl s_instance;
-            return &s_instance;
-        }
-
-    private:
-        void setColour( const char* _escapeCode ) {
-            Catch::cout() << '\033' << _escapeCode;
-        }
-    };
-
-    IColourImpl* platformColourInstance() {
-        ErrnoGuard guard;
-        Ptr<IConfig const> config = getCurrentContext().getConfig();
-        UseColour::YesOrNo colourMode = config
-            ? config->useColour()
-            : UseColour::Auto;
-        if( colourMode == UseColour::Auto )
-            colourMode = (!isDebuggerActive() && isatty(STDOUT_FILENO) )
-                ? UseColour::Yes
-                : UseColour::No;
-        return colourMode == UseColour::Yes
-            ? PosixColourImpl::instance()
-            : NoColourImpl::instance();
-    }
-
-} // end anon namespace
-} // end namespace Catch
-
-#else  // not Windows or ANSI ///////////////////////////////////////////////
-
-namespace Catch {
-
-    static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); }
-
-} // end namespace Catch
-
-#endif // Windows/ ANSI/ None
-
-namespace Catch {
-
-    Colour::Colour( Code _colourCode ) : m_moved( false ) { use( _colourCode ); }
-    Colour::Colour( Colour const& _other ) : m_moved( false ) { const_cast<Colour&>( _other ).m_moved = true; }
-    Colour::~Colour(){ if( !m_moved ) use( None ); }
-
-    void Colour::use( Code _colourCode ) {
-        static IColourImpl* impl = platformColourInstance();
-        impl->use( _colourCode );
-    }
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED

+ 26 - 13
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_context.h

@@ -8,18 +8,16 @@
 #ifndef TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
 #define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
 
-#include "catch_interfaces_generators.h"
-#include "catch_ptr.hpp"
-
+#include <memory>
 
 namespace Catch {
 
-    class TestCase;
-    class Stream;
     struct IResultCapture;
     struct IRunner;
-    struct IGeneratorsForTest;
     struct IConfig;
+    struct IMutableContext;
+
+    using IConfigPtr = std::shared_ptr<IConfig const>;
 
     struct IContext
     {
@@ -27,9 +25,7 @@ namespace Catch {
 
         virtual IResultCapture* getResultCapture() = 0;
         virtual IRunner* getRunner() = 0;
-        virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0;
-        virtual bool advanceGeneratorsForCurrentTest() = 0;
-        virtual Ptr<IConfig const> getConfig() const = 0;
+        virtual IConfigPtr const& getConfig() const = 0;
     };
 
     struct IMutableContext : IContext
@@ -37,14 +33,31 @@ namespace Catch {
         virtual ~IMutableContext();
         virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
         virtual void setRunner( IRunner* runner ) = 0;
-        virtual void setConfig( Ptr<IConfig const> const& config ) = 0;
+        virtual void setConfig( IConfigPtr const& config ) = 0;
+
+    private:
+        static IMutableContext *currentContext;
+        friend IMutableContext& getCurrentMutableContext();
+        friend void cleanUpContext();
+        static void createContext();
     };
 
-    IContext& getCurrentContext();
-    IMutableContext& getCurrentMutableContext();
+    inline IMutableContext& getCurrentMutableContext()
+    {
+        if( !IMutableContext::currentContext )
+            IMutableContext::createContext();
+        return *IMutableContext::currentContext;
+    }
+
+    inline IContext& getCurrentContext()
+    {
+        return getCurrentMutableContext();
+    }
+
     void cleanUpContext();
-    Stream createStream( std::string const& streamName );
 
+    class SimplePcg32;
+    SimplePcg32& rng();
 }
 
 #endif // TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED

+ 0 - 110
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_context_impl.hpp

@@ -1,110 +0,0 @@
-/*
- *  Created by Phil on 31/12/2010.
- *  Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
-
-#include "catch_run_context.hpp"
-
-#include "catch_context.h"
-#include "catch_stream.hpp"
-#include "catch_common.h"
-
-namespace Catch {
-
-    class Context : public IMutableContext {
-
-        Context() : m_config( CATCH_NULL ), m_runner( CATCH_NULL ), m_resultCapture( CATCH_NULL ) {}
-        Context( Context const& );
-        void operator=( Context const& );
-
-    public:
-        virtual ~Context() {
-            deleteAllValues( m_generatorsByTestName );
-        }
-
-    public: // IContext
-        virtual IResultCapture* getResultCapture() {
-            return m_resultCapture;
-        }
-        virtual IRunner* getRunner() {
-            return m_runner;
-        }
-        virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) {
-            return getGeneratorsForCurrentTest()
-            .getGeneratorInfo( fileInfo, totalSize )
-            .getCurrentIndex();
-        }
-        virtual bool advanceGeneratorsForCurrentTest() {
-            IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
-            return generators && generators->moveNext();
-        }
-
-        virtual Ptr<IConfig const> getConfig() const {
-            return m_config;
-        }
-
-    public: // IMutableContext
-        virtual void setResultCapture( IResultCapture* resultCapture ) {
-            m_resultCapture = resultCapture;
-        }
-        virtual void setRunner( IRunner* runner ) {
-            m_runner = runner;
-        }
-        virtual void setConfig( Ptr<IConfig const> const& config ) {
-            m_config = config;
-        }
-
-        friend IMutableContext& getCurrentMutableContext();
-
-    private:
-        IGeneratorsForTest* findGeneratorsForCurrentTest() {
-            std::string testName = getResultCapture()->getCurrentTestName();
-
-            std::map<std::string, IGeneratorsForTest*>::const_iterator it =
-                m_generatorsByTestName.find( testName );
-            return it != m_generatorsByTestName.end()
-                ? it->second
-                : CATCH_NULL;
-        }
-
-        IGeneratorsForTest& getGeneratorsForCurrentTest() {
-            IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
-            if( !generators ) {
-                std::string testName = getResultCapture()->getCurrentTestName();
-                generators = createGeneratorsForTest();
-                m_generatorsByTestName.insert( std::make_pair( testName, generators ) );
-            }
-            return *generators;
-        }
-
-    private:
-        Ptr<IConfig const> m_config;
-        IRunner* m_runner;
-        IResultCapture* m_resultCapture;
-        std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
-    };
-
-    namespace {
-        Context* currentContext = CATCH_NULL;
-    }
-    IMutableContext& getCurrentMutableContext() {
-        if( !currentContext )
-            currentContext = new Context();
-        return *currentContext;
-    }
-    IContext& getCurrentContext() {
-        return getCurrentMutableContext();
-    }
-
-    void cleanUpContext() {
-        delete currentContext;
-        currentContext = CATCH_NULL;
-    }
-}
-
-#endif // TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED

+ 4 - 16
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_debugger.h

@@ -11,25 +11,13 @@
 
 #include "catch_platform.h"
 
-#include <string>
-
-namespace Catch{
-
+namespace Catch {
     bool isDebuggerActive();
-    void writeToDebugConsole( std::string const& text );
 }
 
 #ifdef CATCH_PLATFORM_MAC
 
-    // The following code snippet based on:
-    // http://cocoawithlove.com/2008/03/break-into-debugger.html
-    #if defined(__ppc64__) || defined(__ppc__)
-        #define CATCH_TRAP() \
-                __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
-                : : : "memory","r0","r3","r4" ) /* NOLINT */
-    #else
-        #define CATCH_TRAP() __asm__("int $3\n" : : /* NOLINT */ )
-    #endif
+    #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
 
 #elif defined(CATCH_PLATFORM_LINUX)
     // If we can use inline assembler, do it because this allows us to break
@@ -50,9 +38,9 @@ namespace Catch{
 #endif
 
 #ifdef CATCH_TRAP
-    #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { CATCH_TRAP(); }
+    #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
 #else
-    #define CATCH_BREAK_INTO_DEBUGGER() Catch::alwaysTrue();
+    #define CATCH_BREAK_INTO_DEBUGGER() []{}()
 #endif
 
 #endif // TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED

+ 0 - 131
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_debugger.hpp

@@ -1,131 +0,0 @@
-/*
- *  Created by Phil on 27/12/2010.
- *  Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED
-
-#include "catch_debugger.h"
-#include "catch_errno_guard.hpp"
-
-#ifdef CATCH_PLATFORM_MAC
-
-    #include <assert.h>
-    #include <stdbool.h>
-    #include <sys/types.h>
-    #include <unistd.h>
-    #include <sys/sysctl.h>
-
-    namespace Catch{
-
-        // The following function is taken directly from the following technical note:
-        // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html
-
-        // Returns true if the current process is being debugged (either
-        // running under the debugger or has a debugger attached post facto).
-        bool isDebuggerActive(){
-
-            int                 mib[4];
-            struct kinfo_proc   info;
-            size_t              size;
-
-            // Initialize the flags so that, if sysctl fails for some bizarre
-            // reason, we get a predictable result.
-
-            info.kp_proc.p_flag = 0;
-
-            // Initialize mib, which tells sysctl the info we want, in this case
-            // we're looking for information about a specific process ID.
-
-            mib[0] = CTL_KERN;
-            mib[1] = KERN_PROC;
-            mib[2] = KERN_PROC_PID;
-            mib[3] = getpid();
-
-            // Call sysctl.
-
-            size = sizeof(info);
-            if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, CATCH_NULL, 0) != 0 ) {
-                Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
-                return false;
-            }
-
-            // We're being debugged if the P_TRACED flag is set.
-
-            return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
-        }
-    } // namespace Catch
-
-#elif defined(CATCH_PLATFORM_LINUX)
-    #include <fstream>
-    #include <string>
-
-    namespace Catch{
-        // The standard POSIX way of detecting a debugger is to attempt to
-        // ptrace() the process, but this needs to be done from a child and not
-        // this process itself to still allow attaching to this process later
-        // if wanted, so is rather heavy. Under Linux we have the PID of the
-        // "debugger" (which doesn't need to be gdb, of course, it could also
-        // be strace, for example) in /proc/$PID/status, so just get it from
-        // there instead.
-        bool isDebuggerActive(){
-            // Libstdc++ has a bug, where std::ifstream sets errno to 0
-            // This way our users can properly assert over errno values
-            ErrnoGuard guard;
-            std::ifstream in("/proc/self/status");
-            for( std::string line; std::getline(in, line); ) {
-                static const int PREFIX_LEN = 11;
-                if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) {
-                    // We're traced if the PID is not 0 and no other PID starts
-                    // with 0 digit, so it's enough to check for just a single
-                    // character.
-                    return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0';
-                }
-            }
-
-            return false;
-        }
-    } // namespace Catch
-#elif defined(_MSC_VER)
-    extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
-    namespace Catch {
-        bool isDebuggerActive() {
-            return IsDebuggerPresent() != 0;
-        }
-    }
-#elif defined(__MINGW32__)
-    extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
-    namespace Catch {
-        bool isDebuggerActive() {
-            return IsDebuggerPresent() != 0;
-        }
-    }
-#else
-    namespace Catch {
-       inline bool isDebuggerActive() { return false; }
-    }
-#endif // Platform
-
-#ifdef CATCH_PLATFORM_WINDOWS
-
-#include "catch_windows_h_proxy.h"
-
-    namespace Catch {
-        void writeToDebugConsole( std::string const& text ) {
-            ::OutputDebugStringA( text.c_str() );
-        }
-    }
-#else
-    namespace Catch {
-        void writeToDebugConsole( std::string const& text ) {
-            // !TBD: Need a version for Mac/ XCode and other IDEs
-            Catch::cout() << text;
-        }
-    }
-#endif // Platform
-
-#endif // TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED

+ 6 - 5
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_default_main.hpp

@@ -8,9 +8,11 @@
 #ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
 
+#include "catch_session.h"
+
 #ifndef __OBJC__
 
-#if defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
+#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
 // Standard C/C++ Win32 Unicode wmain entry point
 extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
 #else
@@ -18,8 +20,7 @@ extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
 int main (int argc, char * argv[]) {
 #endif
 
-    int result = Catch::Session().run( argc, argv );
-    return ( result < 0xff ? result : 0xff );
+    return Catch::Session().run( argc, argv );
 }
 
 #else // __OBJC__
@@ -31,13 +32,13 @@ int main (int argc, char * const argv[]) {
 #endif
 
     Catch::registerTestMethods();
-    int result = Catch::Session().run( argc, (char* const*)argv );
+    int result = Catch::Session().run( argc, (char**)argv );
 
 #if !CATCH_ARC_ENABLED
     [pool drain];
 #endif
 
-    return ( result < 0xff ? result : 0xff );
+    return result;
 }
 
 #endif // __OBJC__

+ 0 - 25
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_errno_guard.hpp

@@ -1,25 +0,0 @@
-/*
- *  Created by Martin on 06/03/2017.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED
-
-#include <cerrno>
-
-
-namespace Catch {
-
-    class ErrnoGuard {
-    public:
-        ErrnoGuard():m_oldErrno(errno){}
-        ~ErrnoGuard() { errno = m_oldErrno; }
-    private:
-        int m_oldErrno;
-    };
-
-}
-
-#endif // TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED

+ 0 - 220
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_evaluate.hpp

@@ -1,220 +0,0 @@
-/*
- *  Created by Phil on 04/03/2011.
- *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
-#pragma warning(disable:4018) // more "signed/unsigned mismatch"
-#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform)
-#endif
-
-#include <cstddef>
-
-namespace Catch {
-namespace Internal {
-
-    enum Operator {
-        IsEqualTo,
-        IsNotEqualTo,
-        IsLessThan,
-        IsGreaterThan,
-        IsLessThanOrEqualTo,
-        IsGreaterThanOrEqualTo
-    };
-
-    template<Operator Op> struct OperatorTraits             { static const char* getName(){ return "*error*"; } };
-    template<> struct OperatorTraits<IsEqualTo>             { static const char* getName(){ return "=="; } };
-    template<> struct OperatorTraits<IsNotEqualTo>          { static const char* getName(){ return "!="; } };
-    template<> struct OperatorTraits<IsLessThan>            { static const char* getName(){ return "<"; } };
-    template<> struct OperatorTraits<IsGreaterThan>         { static const char* getName(){ return ">"; } };
-    template<> struct OperatorTraits<IsLessThanOrEqualTo>   { static const char* getName(){ return "<="; } };
-    template<> struct OperatorTraits<IsGreaterThanOrEqualTo>{ static const char* getName(){ return ">="; } };
-
-    template<typename T>
-    T& opCast(T const& t) { return const_cast<T&>(t); }
-
-// nullptr_t support based on pull request #154 from Konstantin Baumann
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-    inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; }
-#endif // CATCH_CONFIG_CPP11_NULLPTR
-
-
-    // So the compare overloads can be operator agnostic we convey the operator as a template
-    // enum, which is used to specialise an Evaluator for doing the comparison.
-    template<typename T1, typename T2, Operator Op>
-    struct Evaluator{};
-
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsEqualTo> {
-        static bool evaluate( T1 const& lhs, T2 const& rhs) {
-            return bool( opCast( lhs ) ==  opCast( rhs ) );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsNotEqualTo> {
-        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
-            return bool( opCast( lhs ) != opCast( rhs ) );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsLessThan> {
-        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
-            return bool( opCast( lhs ) < opCast( rhs ) );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsGreaterThan> {
-        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
-            return bool( opCast( lhs ) > opCast( rhs ) );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> {
-        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
-            return bool( opCast( lhs ) >= opCast( rhs ) );
-        }
-    };
-    template<typename T1, typename T2>
-    struct Evaluator<T1, T2, IsLessThanOrEqualTo> {
-        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
-            return bool( opCast( lhs ) <= opCast( rhs ) );
-        }
-    };
-
-    template<Operator Op, typename T1, typename T2>
-    bool applyEvaluator( T1 const& lhs, T2 const& rhs ) {
-        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
-    }
-
-    // This level of indirection allows us to specialise for integer types
-    // to avoid signed/ unsigned warnings
-
-    // "base" overload
-    template<Operator Op, typename T1, typename T2>
-    bool compare( T1 const& lhs, T2 const& rhs ) {
-        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
-    }
-
-    // unsigned X to int
-    template<Operator Op> bool compare( unsigned int lhs, int rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned long lhs, int rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned char lhs, int rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
-    }
-
-    // unsigned X to long
-    template<Operator Op> bool compare( unsigned int lhs, long rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned long lhs, long rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
-    }
-    template<Operator Op> bool compare( unsigned char lhs, long rhs ) {
-        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
-    }
-
-    // int to unsigned X
-    template<Operator Op> bool compare( int lhs, unsigned int rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( int lhs, unsigned long rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( int lhs, unsigned char rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
-    }
-
-    // long to unsigned X
-    template<Operator Op> bool compare( long lhs, unsigned int rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long lhs, unsigned long rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long lhs, unsigned char rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-
-    // pointer to long (when comparing against NULL)
-    template<Operator Op, typename T> bool compare( long lhs, T* rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
-    }
-    template<Operator Op, typename T> bool compare( T* lhs, long rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
-    }
-
-    // pointer to int (when comparing against NULL)
-    template<Operator Op, typename T> bool compare( int lhs, T* rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
-    }
-    template<Operator Op, typename T> bool compare( T* lhs, int rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
-    }
-
-#ifdef CATCH_CONFIG_CPP11_LONG_LONG
-    // long long to unsigned X
-    template<Operator Op> bool compare( long long lhs, unsigned int rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long long lhs, unsigned long rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long long lhs, unsigned long long rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( long long lhs, unsigned char rhs ) {
-        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
-    }
-
-    // unsigned long long to X
-    template<Operator Op> bool compare( unsigned long long lhs, int rhs ) {
-        return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( unsigned long long lhs, long rhs ) {
-        return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( unsigned long long lhs, long long rhs ) {
-        return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
-    }
-    template<Operator Op> bool compare( unsigned long long lhs, char rhs ) {
-        return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
-    }
-
-    // pointer to long long (when comparing against NULL)
-    template<Operator Op, typename T> bool compare( long long lhs, T* rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
-    }
-    template<Operator Op, typename T> bool compare( T* lhs, long long rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
-    }
-#endif // CATCH_CONFIG_CPP11_LONG_LONG
-
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-    // pointer to nullptr_t (when comparing against nullptr)
-    template<Operator Op, typename T> bool compare( std::nullptr_t, T* rhs ) {
-        return Evaluator<T*, T*, Op>::evaluate( nullptr, rhs );
-    }
-    template<Operator Op, typename T> bool compare( T* lhs, std::nullptr_t ) {
-        return Evaluator<T*, T*, Op>::evaluate( lhs, nullptr );
-    }
-#endif // CATCH_CONFIG_CPP11_NULLPTR
-
-} // end of namespace Internal
-} // end of namespace Catch
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#endif // TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED

+ 0 - 73
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_exception_translator_registry.hpp

@@ -1,73 +0,0 @@
-/*
- *  Created by Phil on 20/04/2011.
- *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
-
-#include "catch_interfaces_exception.h"
-#include "catch_tostring.h"
-
-#ifdef __OBJC__
-#import "Foundation/Foundation.h"
-#endif
-
-namespace Catch {
-
-    class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
-    public:
-        ~ExceptionTranslatorRegistry() {
-            deleteAll( m_translators );
-        }
-
-        virtual void registerTranslator( const IExceptionTranslator* translator ) {
-            m_translators.push_back( translator );
-        }
-
-        virtual std::string translateActiveException() const {
-            try {
-#ifdef __OBJC__
-                // In Objective-C try objective-c exceptions first
-                @try {
-                    return tryTranslators();
-                }
-                @catch (NSException *exception) {
-                    return Catch::toString( [exception description] );
-                }
-#else
-                return tryTranslators();
-#endif
-            }
-            catch( TestFailureException& ) {
-                throw;
-            }
-            catch( std::exception& ex ) {
-                return ex.what();
-            }
-            catch( std::string& msg ) {
-                return msg;
-            }
-            catch( const char* msg ) {
-                return msg;
-            }
-            catch(...) {
-                return "Unknown exception";
-            }
-        }
-
-        std::string tryTranslators() const {
-            if( m_translators.empty() )
-                throw;
-            else
-                return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() );
-        }
-
-    private:
-        std::vector<const IExceptionTranslator*> m_translators;
-    };
-}
-
-#endif // TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED

+ 0 - 174
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_expression_lhs.hpp

@@ -1,174 +0,0 @@
-/*
- *  Created by Phil on 11/5/2012.
- *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED
-
-#include "catch_result_builder.h"
-#include "catch_evaluate.hpp"
-#include "catch_tostring.h"
-
-namespace Catch {
-
-template<typename LhsT, Internal::Operator Op, typename RhsT>
-class BinaryExpression;
-
-template<typename ArgT, typename MatcherT>
-class MatchExpression;
-
-// Wraps the LHS of an expression and overloads comparison operators
-// for also capturing those and RHS (if any)
-template<typename T>
-class ExpressionLhs : public DecomposedExpression {
-public:
-    ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ), m_truthy(false) {}
-
-    ExpressionLhs& operator = ( const ExpressionLhs& );
-
-    template<typename RhsT>
-    BinaryExpression<T, Internal::IsEqualTo, RhsT const&>
-    operator == ( RhsT const& rhs ) {
-        return captureExpression<Internal::IsEqualTo>( rhs );
-    }
-
-    template<typename RhsT>
-    BinaryExpression<T, Internal::IsNotEqualTo, RhsT const&>
-    operator != ( RhsT const& rhs ) {
-        return captureExpression<Internal::IsNotEqualTo>( rhs );
-    }
-
-    template<typename RhsT>
-    BinaryExpression<T, Internal::IsLessThan, RhsT const&>
-    operator < ( RhsT const& rhs ) {
-        return captureExpression<Internal::IsLessThan>( rhs );
-    }
-
-    template<typename RhsT>
-    BinaryExpression<T, Internal::IsGreaterThan, RhsT const&>
-    operator > ( RhsT const& rhs ) {
-        return captureExpression<Internal::IsGreaterThan>( rhs );
-    }
-
-    template<typename RhsT>
-    BinaryExpression<T, Internal::IsLessThanOrEqualTo, RhsT const&>
-    operator <= ( RhsT const& rhs ) {
-        return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
-    }
-
-    template<typename RhsT>
-    BinaryExpression<T, Internal::IsGreaterThanOrEqualTo, RhsT const&>
-    operator >= ( RhsT const& rhs ) {
-        return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs );
-    }
-
-    BinaryExpression<T, Internal::IsEqualTo, bool> operator == ( bool rhs ) {
-        return captureExpression<Internal::IsEqualTo>( rhs );
-    }
-
-    BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) {
-        return captureExpression<Internal::IsNotEqualTo>( rhs );
-    }
-
-    void endExpression() {
-        m_truthy = m_lhs ? true : false;
-        m_rb
-            .setResultType( m_truthy )
-            .endExpression( *this );
-    }
-
-    virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE {
-        dest = Catch::toString( m_lhs );
-    }
-
-private:
-    template<Internal::Operator Op, typename RhsT>
-    BinaryExpression<T, Op, RhsT&> captureExpression( RhsT& rhs ) const {
-        return BinaryExpression<T, Op, RhsT&>( m_rb, m_lhs, rhs );
-    }
-
-    template<Internal::Operator Op>
-    BinaryExpression<T, Op, bool> captureExpression( bool rhs ) const {
-        return BinaryExpression<T, Op, bool>( m_rb, m_lhs, rhs );
-    }
-
-private:
-    ResultBuilder& m_rb;
-    T m_lhs;
-    bool m_truthy;
-};
-
-template<typename LhsT, Internal::Operator Op, typename RhsT>
-class BinaryExpression : public DecomposedExpression {
-public:
-    BinaryExpression( ResultBuilder& rb, LhsT lhs, RhsT rhs )
-        : m_rb( rb ), m_lhs( lhs ), m_rhs( rhs ) {}
-
-    BinaryExpression& operator = ( BinaryExpression& );
-
-    void endExpression() const {
-        m_rb
-            .setResultType( Internal::compare<Op>( m_lhs, m_rhs ) )
-            .endExpression( *this );
-    }
-
-    virtual bool isBinaryExpression() const CATCH_OVERRIDE {
-        return true;
-    }
-
-    virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE {
-        std::string lhs = Catch::toString( m_lhs );
-        std::string rhs = Catch::toString( m_rhs );
-        char delim = lhs.size() + rhs.size() < 40 &&
-                     lhs.find('\n') == std::string::npos &&
-                     rhs.find('\n') == std::string::npos ? ' ' : '\n';
-        dest.reserve( 7 + lhs.size() + rhs.size() );
-                   // 2 for spaces around operator
-                   // 2 for operator
-                   // 2 for parentheses (conditionally added later)
-                   // 1 for negation (conditionally added later)
-        dest = lhs;
-        dest += delim;
-        dest += Internal::OperatorTraits<Op>::getName();
-        dest += delim;
-        dest += rhs;
-    }
-
-private:
-    ResultBuilder& m_rb;
-    LhsT m_lhs;
-    RhsT m_rhs;
-};
-
-template<typename ArgT, typename MatcherT>
-class MatchExpression : public DecomposedExpression {
-public:
-    MatchExpression( ArgT arg, MatcherT matcher, char const* matcherString )
-        : m_arg( arg ), m_matcher( matcher ), m_matcherString( matcherString ) {}
-
-    virtual bool isBinaryExpression() const CATCH_OVERRIDE {
-        return true;
-    }
-
-    virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE {
-        std::string matcherAsString = m_matcher.toString();
-        dest = Catch::toString( m_arg );
-        dest += ' ';
-        if( matcherAsString == Detail::unprintableString )
-            dest += m_matcherString;
-        else
-            dest += matcherAsString;
-    }
-
-private:
-    ArgT m_arg;
-    MatcherT m_matcher;
-    char const* m_matcherString;
-};
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED

+ 0 - 200
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_fatal_condition.hpp

@@ -1,200 +0,0 @@
-/*
- *  Created by Phil on 21/08/2014
- *  Copyright 2014 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- *
- */
-#ifndef TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
-#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
-
-
-namespace Catch {
-
-    // Report the error condition
-    inline void reportFatal( std::string const& message ) {
-        IContext& context = Catch::getCurrentContext();
-        IResultCapture* resultCapture = context.getResultCapture();
-        resultCapture->handleFatalErrorCondition( message );
-    }
-
-} // namespace Catch
-
-#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
-#include "catch_windows_h_proxy.h"
-
-#  if !defined ( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
-    struct FatalConditionHandler {
-        void reset() {}
-    };
-}
-
-#  else // CATCH_CONFIG_WINDOWS_SEH is defined
-
-namespace Catch {
-
-    struct SignalDefs { DWORD id; const char* name; };
-    extern SignalDefs signalDefs[];
-    // There is no 1-1 mapping between signals and windows exceptions.
-    // Windows can easily distinguish between SO and SigSegV,
-    // but SigInt, SigTerm, etc are handled differently.
-    SignalDefs signalDefs[] = {
-        { EXCEPTION_ILLEGAL_INSTRUCTION,  "SIGILL - Illegal instruction signal" },
-        { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" },
-        { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" },
-        { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" },
-    };
-
-    struct FatalConditionHandler {
-
-        static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) {
-            for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) {
-                if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) {
-                    reportFatal(signalDefs[i].name);
-                }
-            }
-            // If its not an exception we care about, pass it along.
-            // This stops us from eating debugger breaks etc.
-            return EXCEPTION_CONTINUE_SEARCH;
-        }
-
-        FatalConditionHandler() {
-            isSet = true;
-            // 32k seems enough for Catch to handle stack overflow,
-            // but the value was found experimentally, so there is no strong guarantee
-            guaranteeSize = 32 * 1024;
-            exceptionHandlerHandle = CATCH_NULL;
-            // Register as first handler in current chain
-            exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
-            // Pass in guarantee size to be filled
-            SetThreadStackGuarantee(&guaranteeSize);
-        }
-
-        static void reset() {
-            if (isSet) {
-                // Unregister handler and restore the old guarantee
-                RemoveVectoredExceptionHandler(exceptionHandlerHandle);
-                SetThreadStackGuarantee(&guaranteeSize);
-                exceptionHandlerHandle = CATCH_NULL;
-                isSet = false;
-            }
-        }
-
-        ~FatalConditionHandler() {
-            reset();
-        }
-    private:
-        static bool isSet;
-        static ULONG guaranteeSize;
-        static PVOID exceptionHandlerHandle;
-    };
-
-    bool FatalConditionHandler::isSet = false;
-    ULONG FatalConditionHandler::guaranteeSize = 0;
-    PVOID FatalConditionHandler::exceptionHandlerHandle = CATCH_NULL;
-
-} // namespace Catch
-
-#  endif // CATCH_CONFIG_WINDOWS_SEH
-
-#else // Not Windows - assumed to be POSIX compatible //////////////////////////
-
-#  if !defined(CATCH_CONFIG_POSIX_SIGNALS)
-
-namespace Catch {
-    struct FatalConditionHandler {
-        void reset() {}
-    };
-}
-
-
-#  else // CATCH_CONFIG_POSIX_SIGNALS is defined
-
-#include <signal.h>
-
-namespace Catch {
-
-    struct SignalDefs {
-        int id;
-        const char* name;
-    };
-    extern SignalDefs signalDefs[];
-    SignalDefs signalDefs[] = {
-            { SIGINT,  "SIGINT - Terminal interrupt signal" },
-            { SIGILL,  "SIGILL - Illegal instruction signal" },
-            { SIGFPE,  "SIGFPE - Floating point error signal" },
-            { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
-            { SIGTERM, "SIGTERM - Termination request signal" },
-            { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
-    };
-
-    struct FatalConditionHandler {
-
-        static bool isSet;
-        static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)];
-        static stack_t oldSigStack;
-        static char altStackMem[SIGSTKSZ];
-
-        static void handleSignal( int sig ) {
-            std::string name = "<unknown signal>";
-            for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) {
-                SignalDefs &def = signalDefs[i];
-                if (sig == def.id) {
-                    name = def.name;
-                    break;
-                }
-            }
-            reset();
-            reportFatal(name);
-            raise( sig );
-        }
-
-        FatalConditionHandler() {
-            isSet = true;
-            stack_t sigStack;
-            sigStack.ss_sp = altStackMem;
-            sigStack.ss_size = SIGSTKSZ;
-            sigStack.ss_flags = 0;
-            sigaltstack(&sigStack, &oldSigStack);
-            struct sigaction sa = { 0 };
-
-            sa.sa_handler = handleSignal;
-            sa.sa_flags = SA_ONSTACK;
-            for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) {
-                sigaction(signalDefs[i].id, &sa, &oldSigActions[i]);
-            }
-        }
-
-
-        ~FatalConditionHandler() {
-            reset();
-        }
-        static void reset() {
-            if( isSet ) {
-                // Set signals back to previous values -- hopefully nobody overwrote them in the meantime
-                for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) {
-                    sigaction(signalDefs[i].id, &oldSigActions[i], CATCH_NULL);
-                }
-                // Return the old stack
-                sigaltstack(&oldSigStack, CATCH_NULL);
-                isSet = false;
-            }
-        }
-    };
-
-    bool FatalConditionHandler::isSet = false;
-    struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {};
-    stack_t FatalConditionHandler::oldSigStack = {};
-    char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
-
-
-} // namespace Catch
-
-#  endif // CATCH_CONFIG_POSIX_SIGNALS
-
-#endif // not Windows
-
-#endif // TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED

+ 163 - 139
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_generators.hpp

@@ -1,6 +1,5 @@
 /*
- *  Created by Phil on 27/01/2011.
- *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
+ *  Created by Phil Nash on 15/6/2018.
  *
  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,182 +7,207 @@
 #ifndef TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
 
-#include "catch_context.h"
+#include "catch_interfaces_generatortracker.h"
+#include "catch_common.h"
+#include "catch_enforce.h"
 
+#include <memory>
 #include <vector>
-#include <string>
-#include <stdlib.h>
+#include <cassert>
+
+#include <utility>
+#include <exception>
 
 namespace Catch {
 
-template<typename T>
-struct IGenerator {
-    virtual ~IGenerator() {}
-    virtual T getValue( std::size_t index ) const = 0;
-    virtual std::size_t size () const = 0;
-};
+class GeneratorException : public std::exception {
+    const char* const m_msg = "";
 
-template<typename T>
-class BetweenGenerator : public IGenerator<T> {
 public:
-    BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){}
+    GeneratorException(const char* msg):
+        m_msg(msg)
+    {}
 
-    virtual T getValue( std::size_t index ) const {
-        return m_from+static_cast<int>( index );
-    }
+    const char* what() const noexcept override final;
+};
+
+namespace Generators {
 
-    virtual std::size_t size() const {
-        return static_cast<std::size_t>( 1+m_to-m_from );
+    // !TBD move this into its own location?
+    namespace pf{
+        template<typename T, typename... Args>
+        std::unique_ptr<T> make_unique( Args&&... args ) {
+            return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+        }
     }
 
-private:
+    template<typename T>
+    struct IGenerator : GeneratorUntypedBase {
+        virtual ~IGenerator() = default;
 
-    T m_from;
-    T m_to;
-};
+        // Returns the current element of the generator
+        //
+        // \Precondition The generator is either freshly constructed,
+        // or the last call to `next()` returned true
+        virtual T const& get() const = 0;
+        using type = T;
+    };
 
-template<typename T>
-class ValuesGenerator : public IGenerator<T> {
-public:
-    ValuesGenerator(){}
+    template<typename T>
+    class SingleValueGenerator final : public IGenerator<T> {
+        T m_value;
+    public:
+        SingleValueGenerator(T const& value) : m_value( value ) {}
+        SingleValueGenerator(T&& value) : m_value(std::move(value)) {}
+
+        T const& get() const override {
+            return m_value;
+        }
+        bool next() override {
+            return false;
+        }
+    };
 
-    void add( T value ) {
-        m_values.push_back( value );
-    }
+    template<typename T>
+    class FixedValuesGenerator final : public IGenerator<T> {
+        static_assert(!std::is_same<T, bool>::value,
+            "FixedValuesGenerator does not support bools because of std::vector<bool>"
+            "specialization, use SingleValue Generator instead.");
+        std::vector<T> m_values;
+        size_t m_idx = 0;
+    public:
+        FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
+
+        T const& get() const override {
+            return m_values[m_idx];
+        }
+        bool next() override {
+            ++m_idx;
+            return m_idx < m_values.size();
+        }
+    };
+
+    template <typename T>
+    class GeneratorWrapper final {
+        std::unique_ptr<IGenerator<T>> m_generator;
+    public:
+        GeneratorWrapper(std::unique_ptr<IGenerator<T>> generator):
+            m_generator(std::move(generator))
+        {}
+        T const& get() const {
+            return m_generator->get();
+        }
+        bool next() {
+            return m_generator->next();
+        }
+    };
 
-    virtual T getValue( std::size_t index ) const {
-        return m_values[index];
+    template <typename T>
+    GeneratorWrapper<T> value(T&& value) {
+        return GeneratorWrapper<T>(pf::make_unique<SingleValueGenerator<T>>(std::forward<T>(value)));
     }
-
-    virtual std::size_t size() const {
-        return m_values.size();
+    template <typename T>
+    GeneratorWrapper<T> values(std::initializer_list<T> values) {
+        return GeneratorWrapper<T>(pf::make_unique<FixedValuesGenerator<T>>(values));
     }
 
-private:
-    std::vector<T> m_values;
-};
+    template<typename T>
+    class Generators : public IGenerator<T> {
+        std::vector<GeneratorWrapper<T>> m_generators;
+        size_t m_current = 0;
 
-template<typename T>
-class CompositeGenerator {
-public:
-    CompositeGenerator() : m_totalSize( 0 ) {}
-
-    // *** Move semantics, similar to auto_ptr ***
-    CompositeGenerator( CompositeGenerator& other )
-    :   m_fileInfo( other.m_fileInfo ),
-        m_totalSize( 0 )
-    {
-        move( other );
-    }
+        void populate(GeneratorWrapper<T>&& generator) {
+            m_generators.emplace_back(std::move(generator));
+        }
+        void populate(T&& val) {
+            m_generators.emplace_back(value(std::move(val)));
+        }
+        template<typename U>
+        void populate(U&& val) {
+            populate(T(std::move(val)));
+        }
+        template<typename U, typename... Gs>
+        void populate(U&& valueOrGenerator, Gs... moreGenerators) {
+            populate(std::forward<U>(valueOrGenerator));
+            populate(std::forward<Gs>(moreGenerators)...);
+        }
 
-    CompositeGenerator& setFileInfo( const char* fileInfo ) {
-        m_fileInfo = fileInfo;
-        return *this;
-    }
+    public:
+        template <typename... Gs>
+        Generators(Gs... moreGenerators) {
+            m_generators.reserve(sizeof...(Gs));
+            populate(std::forward<Gs>(moreGenerators)...);
+        }
 
-    ~CompositeGenerator() {
-        deleteAll( m_composed );
-    }
+        T const& get() const override {
+            return m_generators[m_current].get();
+        }
 
-    operator T () const {
-        size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize );
-
-        typename std::vector<const IGenerator<T>*>::const_iterator it = m_composed.begin();
-        typename std::vector<const IGenerator<T>*>::const_iterator itEnd = m_composed.end();
-        for( size_t index = 0; it != itEnd; ++it )
-        {
-            const IGenerator<T>* generator = *it;
-            if( overallIndex >= index && overallIndex < index + generator->size() )
-            {
-                return generator->getValue( overallIndex-index );
+        bool next() override {
+            if (m_current >= m_generators.size()) {
+                return false;
+            }
+            const bool current_status = m_generators[m_current].next();
+            if (!current_status) {
+                ++m_current;
             }
-            index += generator->size();
+            return m_current < m_generators.size();
         }
-        CATCH_INTERNAL_ERROR( "Indexed past end of generated range" );
-        return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so
-    }
+    };
 
-    void add( const IGenerator<T>* generator ) {
-        m_totalSize += generator->size();
-        m_composed.push_back( generator );
-    }
-
-    CompositeGenerator& then( CompositeGenerator& other ) {
-        move( other );
-        return *this;
-    }
 
-    CompositeGenerator& then( T value ) {
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( value );
-        add( valuesGen );
-        return *this;
+    template<typename... Ts>
+    GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<typename std::decay<Ts>::type...>> tuples ) {
+        return values<std::tuple<Ts...>>( tuples );
     }
 
-private:
+    // Tag type to signal that a generator sequence should convert arguments to a specific type
+    template <typename T>
+    struct as {};
 
-    void move( CompositeGenerator& other ) {
-        m_composed.insert( m_composed.end(), other.m_composed.begin(), other.m_composed.end() );
-        m_totalSize += other.m_totalSize;
-        other.m_composed.clear();
+    template<typename T, typename... Gs>
+    auto makeGenerators( GeneratorWrapper<T>&& generator, Gs... moreGenerators ) -> Generators<T> {
+        return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...);
     }
-
-    std::vector<const IGenerator<T>*> m_composed;
-    std::string m_fileInfo;
-    size_t m_totalSize;
-};
-
-namespace Generators
-{
     template<typename T>
-    CompositeGenerator<T> between( T from, T to ) {
-        CompositeGenerator<T> generators;
-        generators.add( new BetweenGenerator<T>( from, to ) );
-        return generators;
+    auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> {
+        return Generators<T>(std::move(generator));
     }
-
-    template<typename T>
-    CompositeGenerator<T> values( T val1, T val2 ) {
-        CompositeGenerator<T> generators;
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( val1 );
-        valuesGen->add( val2 );
-        generators.add( valuesGen );
-        return generators;
+    template<typename T, typename... Gs>
+    auto makeGenerators( T&& val, Gs... moreGenerators ) -> Generators<T> {
+        return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... );
     }
-
-    template<typename T>
-    CompositeGenerator<T> values( T val1, T val2, T val3 ){
-        CompositeGenerator<T> generators;
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( val1 );
-        valuesGen->add( val2 );
-        valuesGen->add( val3 );
-        generators.add( valuesGen );
-        return generators;
+    template<typename T, typename U, typename... Gs>
+    auto makeGenerators( as<T>, U&& val, Gs... moreGenerators ) -> Generators<T> {
+        return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
     }
 
-    template<typename T>
-    CompositeGenerator<T> values( T val1, T val2, T val3, T val4 ) {
-        CompositeGenerator<T> generators;
-        ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
-        valuesGen->add( val1 );
-        valuesGen->add( val2 );
-        valuesGen->add( val3 );
-        valuesGen->add( val4 );
-        generators.add( valuesGen );
-        return generators;
-    }
+    auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
 
-} // end namespace Generators
+    template<typename L>
+    // Note: The type after -> is weird, because VS2015 cannot parse
+    //       the expression used in the typedef inside, when it is in
+    //       return type. Yeah.
+    auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
+        using UnderlyingType = typename decltype(generatorExpression())::type;
 
-using namespace Generators;
+        IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
+        if (!tracker.hasGenerator()) {
+            tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
+        }
 
-} // end namespace Catch
+        auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
+        return generator.get();
+    }
 
-#define INTERNAL_CATCH_LINESTR2( line ) #line
-#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line )
+} // namespace Generators
+} // namespace Catch
 
-#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" )
+#define GENERATE( ... ) \
+    Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
+#define GENERATE_COPY( ... ) \
+    Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
+#define GENERATE_REF( ... ) \
+    Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
 
 #endif // TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED

+ 0 - 86
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_generators_impl.hpp

@@ -1,86 +0,0 @@
-/*
- *  Created by Phil on 28/01/2011.
- *  Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
-
-#include "catch_interfaces_generators.h"
-
-#include "catch_common.h"
-
-#include <vector>
-#include <string>
-#include <map>
-
-namespace Catch {
-
-    struct GeneratorInfo : IGeneratorInfo {
-
-        GeneratorInfo( std::size_t size )
-        :   m_size( size ),
-            m_currentIndex( 0 )
-        {}
-
-        bool moveNext() {
-            if( ++m_currentIndex == m_size ) {
-                m_currentIndex = 0;
-                return false;
-            }
-            return true;
-        }
-
-        std::size_t getCurrentIndex() const {
-            return m_currentIndex;
-        }
-
-        std::size_t m_size;
-        std::size_t m_currentIndex;
-    };
-
-    ///////////////////////////////////////////////////////////////////////////
-
-    class GeneratorsForTest : public IGeneratorsForTest {
-
-    public:
-        ~GeneratorsForTest() {
-            deleteAll( m_generatorsInOrder );
-        }
-
-        IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) {
-            std::map<std::string, IGeneratorInfo*>::const_iterator it = m_generatorsByName.find( fileInfo );
-            if( it == m_generatorsByName.end() ) {
-                IGeneratorInfo* info = new GeneratorInfo( size );
-                m_generatorsByName.insert( std::make_pair( fileInfo, info ) );
-                m_generatorsInOrder.push_back( info );
-                return *info;
-            }
-            return *it->second;
-        }
-
-        bool moveNext() {
-            std::vector<IGeneratorInfo*>::const_iterator it = m_generatorsInOrder.begin();
-            std::vector<IGeneratorInfo*>::const_iterator itEnd = m_generatorsInOrder.end();
-            for(; it != itEnd; ++it ) {
-                if( (*it)->moveNext() )
-                    return true;
-            }
-            return false;
-        }
-
-    private:
-        std::map<std::string, IGeneratorInfo*> m_generatorsByName;
-        std::vector<IGeneratorInfo*> m_generatorsInOrder;
-    };
-
-    IGeneratorsForTest* createGeneratorsForTest()
-    {
-        return new GeneratorsForTest();
-    }
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED

+ 8 - 85
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_impl.hpp

@@ -8,99 +8,22 @@
 #ifndef TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
 
-// Collect all the implementation files together here
-// These are the equivalent of what would usually be cpp files
-
 #ifdef __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wweak-vtables"
 #endif
 
-#include "../catch_session.hpp"
-#include "catch_registry_hub.hpp"
-#include "catch_notimplemented_exception.hpp"
-#include "catch_context_impl.hpp"
-#include "catch_console_colour_impl.hpp"
-#include "catch_generators_impl.hpp"
-#include "catch_assertionresult.hpp"
-#include "catch_test_case_info.hpp"
-#include "catch_test_spec.hpp"
-#include "catch_version.hpp"
-#include "catch_message.hpp"
-#include "catch_legacy_reporter_adapter.hpp"
-#include "catch_timer.hpp"
-#include "catch_common.hpp"
-#include "catch_section.hpp"
-#include "catch_debugger.hpp"
-#include "catch_tostring.hpp"
-#include "catch_result_builder.hpp"
-#include "catch_tag_alias_registry.hpp"
-#include "catch_test_case_tracker.hpp"
-#include "catch_matchers_string.hpp"
-
-#include "../reporters/catch_reporter_multi.hpp"
-#include "../reporters/catch_reporter_xml.hpp"
-#include "../reporters/catch_reporter_junit.hpp"
-#include "../reporters/catch_reporter_console.hpp"
-#include "../reporters/catch_reporter_compact.hpp"
+// Keep these here for external reporters
+#include "catch_test_spec.h"
+#include "catch_test_case_tracker.h"
 
-namespace Catch {
-    // These are all here to avoid warnings about not having any out of line
-    // virtual methods
-    NonCopyable::~NonCopyable() {}
-    IShared::~IShared() {}
-    IStream::~IStream() CATCH_NOEXCEPT {}
-    FileStream::~FileStream() CATCH_NOEXCEPT {}
-    CoutStream::~CoutStream() CATCH_NOEXCEPT {}
-    DebugOutStream::~DebugOutStream() CATCH_NOEXCEPT {}
-    StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {}
-    IContext::~IContext() {}
-    IResultCapture::~IResultCapture() {}
-    ITestCase::~ITestCase() {}
-    ITestCaseRegistry::~ITestCaseRegistry() {}
-    IRegistryHub::~IRegistryHub() {}
-    IMutableRegistryHub::~IMutableRegistryHub() {}
-    IExceptionTranslator::~IExceptionTranslator() {}
-    IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
-    IReporter::~IReporter() {}
-    IReporterFactory::~IReporterFactory() {}
-    IReporterRegistry::~IReporterRegistry() {}
-    IStreamingReporter::~IStreamingReporter() {}
-    AssertionStats::~AssertionStats() {}
-    SectionStats::~SectionStats() {}
-    TestCaseStats::~TestCaseStats() {}
-    TestGroupStats::~TestGroupStats() {}
-    TestRunStats::~TestRunStats() {}
-    CumulativeReporterBase::SectionNode::~SectionNode() {}
-    CumulativeReporterBase::~CumulativeReporterBase() {}
+#include "catch_leak_detector.h"
 
-    StreamingReporterBase::~StreamingReporterBase() {}
-    ConsoleReporter::~ConsoleReporter() {}
-    CompactReporter::~CompactReporter() {}
-    IRunner::~IRunner() {}
-    IMutableContext::~IMutableContext() {}
-    IConfig::~IConfig() {}
-    XmlReporter::~XmlReporter() {}
-    JunitReporter::~JunitReporter() {}
-    TestRegistry::~TestRegistry() {}
-    FreeFunctionTestCase::~FreeFunctionTestCase() {}
-    IGeneratorInfo::~IGeneratorInfo() {}
-    IGeneratorsForTest::~IGeneratorsForTest() {}
-    WildcardPattern::~WildcardPattern() {}
-    TestSpec::Pattern::~Pattern() {}
-    TestSpec::NamePattern::~NamePattern() {}
-    TestSpec::TagPattern::~TagPattern() {}
-    TestSpec::ExcludedPattern::~ExcludedPattern() {}
-    Matchers::Impl::MatcherUntypedBase::~MatcherUntypedBase() {}
+// Cpp files will be included in the single-header file here
+// ~*~* CATCH_CPP_STITCH_PLACE *~*~
 
-    void Config::dummy() {}
-
-    namespace TestCaseTracking {
-        ITracker::~ITracker() {}
-        TrackerBase::~TrackerBase() {}
-        SectionTracker::~SectionTracker() {}
-        IndexTracker::~IndexTracker() {}
-    }
+namespace Catch {
+    LeakDetector leakDetector;
 }
 
 #ifdef __clang__

+ 56 - 9
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/external/catch/include/internal/catch_interfaces_capture.h

@@ -9,42 +9,89 @@
 #define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
 
 #include <string>
+#include <chrono>
+
+#include "catch_stringref.h"
 #include "catch_result_type.h"
-#include "catch_common.h"
 
 namespace Catch {
 
-    class TestCase;
     class AssertionResult;
     struct AssertionInfo;
     struct SectionInfo;
     struct SectionEndInfo;
     struct MessageInfo;
-    class ScopedMessageBuilder;
+    struct MessageBuilder;
     struct Counts;
+    struct AssertionReaction;
+    struct SourceLineInfo;
+
+    struct ITransientExpression;
+    struct IGeneratorTracker;
+
+#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
+    struct BenchmarkInfo;
+    template <typename Duration = std::chrono::duration<double, std::nano>>
+    struct BenchmarkStats;
+#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
 
     struct IResultCapture {
 
         virtual ~IResultCapture();
 
-        virtual void assertionEnded( AssertionResult const& result ) = 0;
         virtual bool sectionStarted(    SectionInfo const& sectionInfo,
                                         Counts& assertions ) = 0;
         virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
         virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
+
+        virtual auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
+
+#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
+        virtual void benchmarkPreparing( std::string const& name ) = 0;
+        virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0;
+        virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0;
+        virtual void benchmarkFailed( std::string const& error ) = 0;
+#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
+
         virtual void pushScopedMessage( MessageInfo const& message ) = 0;
         virtual void popScopedMessage( MessageInfo const& message ) = 0;
 
-        virtual std::string getCurrentTestName() const = 0;
-        virtual const AssertionResult* getLastResult() const = 0;
+        virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0;
+
+        virtual void handleFatalErrorCondition( StringRef message ) = 0;
+
+        virtual void handleExpr
+                (   AssertionInfo const& info,
+                    ITransientExpression const& expr,
+                    AssertionReaction& reaction ) = 0;
+        virtual void handleMessage
+                (   AssertionInfo const& info,
+                    ResultWas::OfType resultType,
+                    StringRef const& message,
+                    AssertionReaction& reaction ) = 0;
+        virtual void handleUnexpectedExceptionNotThrown
+                (   AssertionInfo const& info,
+                    AssertionReaction& reaction ) = 0;
+        virtual void handleUnexpectedInflightException
+                (   AssertionInfo const& info,
+                    std::string const& message,
+                    AssertionReaction& reaction ) = 0;
+        virtual void handleIncomplete
+                (   AssertionInfo const& info ) = 0;
+        virtual void handleNonExpr
+                (   AssertionInfo const &info,
+                    ResultWas::OfType resultType,
+                    AssertionReaction &reaction ) = 0;
 
-        virtual void exceptionEarlyReported() = 0;
 
-        virtual void handleFatalErrorCondition( std::string const& message ) = 0;
 
         virtual bool lastAssertionPassed() = 0;
         virtual void assertionPassed() = 0;
-        virtual void assertionRun() = 0;
+
+        // Deprecated, do not use:
+        virtual std::string getCurrentTestName() const = 0;
+        virtual const AssertionResult* getLastResult() const = 0;
+        virtual void exceptionEarlyReported() = 0;
     };
 
     IResultCapture& getResultCapture();

Some files were not shown because too many files changed in this diff