FSTSpecTests.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import <XCTest/XCTest.h>
  18. @protocol FSTPersistence;
  19. NS_ASSUME_NONNULL_BEGIN
  20. extern NSString *const kEagerGC;
  21. extern NSString *const kDurablePersistence;
  22. /**
  23. * FSTSpecTests run a set of portable event specifications from JSON spec files against a
  24. * special isolated version of the Firestore client that allows precise control over when events
  25. * are delivered. This allows us to test client behavior in a very reliable, deterministic way,
  26. * including edge cases that would be difficult to reliably reproduce in a full integration test.
  27. *
  28. * Both events from user code (adding/removing listens, performing mutations) and events from the
  29. * Datastore are simulated, while installing as much of the system in between as possible.
  30. *
  31. * FSTSpecTests is an abstract base class that must be subclassed to test against a specific local
  32. * store implementation. To create a new variant of FSTSpecTests:
  33. *
  34. * + Subclass FSTSpecTests
  35. * + override -persistence to create and return an appropriate id<FSTPersistence> implementation.
  36. */
  37. @interface FSTSpecTests : XCTestCase
  38. /** Based on its tags, determine whether the test case should run. */
  39. - (BOOL)shouldRunWithTags:(NSArray<NSString *> *)tags;
  40. /** Do any necessary setup for a single spec test */
  41. - (void)setUpForSpecWithConfig:(NSDictionary *)config;
  42. @end
  43. NS_ASSUME_NONNULL_END