ReplayTests.swift 1.0 KB

1234567891011121314151617181920212223242526272829
  1. import Foundation
  2. /// Flag to enable replay tests.
  3. ///
  4. /// These test are only used for debugging so normally they should be disabled. But
  5. /// if you're debugging the oref-swift functions they are extremely useful. To enable them
  6. /// add these lines to your ConfigOverride.xcconfig file:
  7. /// ```
  8. /// ENABLE_REPLAY_TESTS = YES
  9. /// ```
  10. enum ReplayTests {
  11. static var enabled: Bool {
  12. let bundle = Bundle(for: BundleReference.self)
  13. return bundle.object(forInfoDictionaryKey: "EnableReplayTests") as? String == "YES"
  14. }
  15. /// Timezone to use for replay tests.
  16. ///
  17. /// This is used to filter replay test files by timezone. If not set, it defaults to "America/Los_Angeles".
  18. /// To set it, add this line to your ConfigOverride.xcconfig file:
  19. /// ```
  20. /// REPLAY_TEST_TIMEZONE = Europe/Berlin
  21. /// ```
  22. static var timezone: String {
  23. let bundle = Bundle(for: BundleReference.self)
  24. return bundle.object(forInfoDictionaryKey: "ReplayTestTimezone") as? String ?? "America/Los_Angeles"
  25. }
  26. }