FSTSpecTests.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. NS_ASSUME_NONNULL_BEGIN
  19. extern NSString *const kEagerGC;
  20. extern NSString *const kDurablePersistence;
  21. /**
  22. * FSTSpecTests run a set of portable event specifications from JSON spec files against a
  23. * special isolated version of the Firestore client that allows precise control over when events
  24. * are delivered. This allows us to test client behavior in a very reliable, deterministic way,
  25. * including edge cases that would be difficult to reliably reproduce in a full integration test.
  26. *
  27. * Both events from user code (adding/removing listens, performing mutations) and events from the
  28. * Datastore are simulated, while installing as much of the system in between as possible.
  29. *
  30. * FSTSpecTests is an abstract base class that must be subclassed to test against a specific local
  31. * store implementation. To create a new variant of FSTSpecTests:
  32. *
  33. * + Subclass FSTSpecTests
  34. * + override -persistence to create and return an appropriate Persistence implementation.
  35. */
  36. @interface FSTSpecTests : XCTestCase
  37. /** Based on its tags, determine whether the test case should run. */
  38. - (BOOL)shouldRunWithTags:(NSArray<NSString *> *)tags;
  39. /** Do any necessary setup for a single spec test */
  40. - (void)setUpForSpecWithConfig:(NSDictionary *)config;
  41. @end
  42. NS_ASSUME_NONNULL_END