* Move FSTQueryCacheTests files to Firestore/core
* Rewrite QueryCache tests in C++
* Fix test flake in local store tests
This doesn't affect production because we always set the additional
references pointer there, but it's technically optional and some tests
don't do this.
There are more sources that can be `.cc` now (e.g., in API); these are left for a follow-up PR.
The dependency on Objective-C proto library cannot be removed just yet due to current lack of pretty-printing support for Nanopb.
* Move FSTPersistenceHelpers to core/test/.../local
* Rewrite persistence_testing in C++
* Migrate from FSTPersistenceTestHelpers to C++ persistence_testing
* Rename .mm to .cc where possible in IndexManager tests
* Remove Objective-C gunk from index_manager_test.h
Replace all uses of `FSTSerializerBeta` in `remote_objc_bridge.{h,mm}` with the C++ `Serializer`. Also, make most of `remote/` sources pure C++ and remove no-longer-used methods in `FSTSerializerBeta`. All integration tests pass, under Address Sanitizer as well.
Unfortunately, pretty-printing is still delegated to Objective-C, so that `remote_objc_bridge.mm` still has to be an Objective-C++ source (and which prevents inlining `remote_objc_bridge` into the streams).
#no-changelog Will add a changelog entry when local serializer is ported, too.
* Drop dependency on OCMock
* Move Firestore onto Xcode 11 in Travis
* Special case simulators based on Xcode version, not product
This allows Firestore's build with Xcode 8.3.3 to continue to work.
* Make the Firestore Podfile install only one platform at a time
Use the PLATFORM environment variable to limit which targets are
modified. This makes the selected platform work but leaves the other
platforms in a broken state in the Xcode UI.
* Fix code signing errors on macOS builds
* Add Executor::CreateSerial
... a standard way to create an Executor for most cases where we don't
care about the implementation.
* Add ExecutorForTesting/AsyncQueueForTesting
Uses Executor::CreateSerial to do the heavy lifting.
* Use AsyncQueueForTesting
* Avoid direct references to ExecutorLibdispatch in prod code
* Rewrite time_testing in terms of absl::Time
* Migrate async_test_util's now to time_testing
* Fix AddressSanitizer stack-buffer-underflow error
This was reading random data off the stack until it hit a negative
integer's worth of data. The test passed because this was generating the
input and expected values, which were much longer than expected given
the input.
This was caused by running under Asan with XCode 11. Apparently, previous versions of XCode cannot catch it (which is why Travis is passing, apparently).
Also:
* enable "Detect use of stack after return" option for Asan. AFAIU, it can only be enabled in the scheme. It's already enabled for unit tests, this PR additionally enables it for integration tests;
* make Asan failures fail Travis build. They were originally not considered blocking due to some sporadic failures. I haven't seen those for some time, and worst case scenario, we can revert this change.
* Tidy up mutation_test.cc ahead of filling it out
* Move FSTUserDataConverter tests out of FSTMutationTests
* Add operator<< for Document
The compiler won't apply the one for MaybeDocument.
* Port FSTMutationTests to C++
* Delete FSTMutationTests
* Rewrite Document-related classes as a polymorphic value type
* Pass ObjectValue without rvalue references
* Rename HasLocalMutations
* Port C++ users to new Documents
* Port FSTDocumentTests to C++
* Port FSTDocumentSetTests to C++
* Migrate DocumentMap and DocumentSet to C++ Document
* Migrate test helpers
* Delete FSTDocumentSetTests
* Delete FSTDocumentTests
* Mechanical changes to use C++ Document
* Updates to the project file
* Nontrivial test updates
* Remove FSTTestDeletedDoc
* Remove FSTTestUnknownDoc
* Remove FSTDocument
* Convert usage of FSTDocument to C++ Document
* Fix Serializer usage of Documents
* Use C++ Documents in FSTQueryTests
* Fix FieldPath::kDocumentKeyPath definition
* Add missing operator<< to Document and DocumentKey
* Migrate FSTQueryTests.mm to C++ query_test.cc
* Remove FSTQueryTests
* Remove FSTQuery
* Rename relation_filter.{h,cc} to field_filter.{h,cc}
* Rename RelationFilter to FieldFilter
* Move Filter::Create to FieldFilter
* Port api::Query::ValidateNewFilter
* Add ArrayContainsFilter
* Add KeyFieldFilter
* Make FieldFilter constructor protected
* Port FieldFilter refactor from the JS SDK
https://github.com/firebase/firebase-js-sdk/pull/1894
* Add spec test from firebase/firebase-js-sdk#1913
* Accept array-contains as a synonym for array_contains
* Enable incremental CocoaPods installation
* Disable input/output path checking for generated frameworks
... to make incremental builds work properly. Without this, changes to
the framework may not be picked up in between test runs.
This does make incremental builds slightly slower, but not by much.
* Standardize on DWARF debug symbols for Debug builds
Configure this once at the project level and remove customizations.
This speeds up link times because it avoids needing to separately
generate dSYM bundles for our executables.
* Rename FIRQueryTests to FIRQueryUnitTests
* Make IntegrationTests targets run everything
The incremental cost of running all tests is an extra two seconds of run
time, but not starting the simulator three times during a build cuts
build times by ~25%.
* sync_project.rb generated changes
* sync_project.rb generated changes
* Remove AllTests_iOS aggregate target
* Add unit test deps to Firestore_IntegrationTests_*
* Fix BasicCompileTests on macOS and tvOS
* Run Firestore IntegrationTests only on Travis
This cuts build time for the job by about 25%, primarily due to not
having to start/deploy to the simulator repeatedly.
* Add deployment_targets for macOS and tvOS in FirebaseFirestoreSwift
* Add FirebaseFirestoreSwift as a dependency to all integration tests
* Add swift integration tests to sync_project.rb
* Fix leveldb benchmarks
... which apparently haven't been built in a while
* Manage configuration for Benchmarks and FuzzTests
* Suppress warnings in LibFuzzer
* Add a Firestore_Benchmarks_iOS scheme
* xcodeproj: Remove manual configuration for Fuzzer and Benchmarks
* Update LibFuzzer build for recent clangs
Builds are currently failing with this on standard out:
-fsanitize-coverage=trace-pc-guard is no longer supported by
libFuzzer. Please either migrate to a compiler that supports
-fsanitize=fuzzer or use an older version of libFuzzer
* Add an -all_load linker flag to all example apps
This fixes macOS and tvOS builds such that they no longer need to
explicitly link against the built FirebaseFirestore framework, which is
good because this wasn't working right: changes to the framework would
take two builds to get tests to actually see them.
The mechanism here is to amend the .xcconfig files that CocoaPods plugs
into the project, just after it generates them. This avoids the need to
actually modify the project.xcodeproj file, which reduces the potential
for conflicts.
Going forward all manual modifications to the project's configuration
will be handled this way to avoid needing special project configuration.
This also moves us incrementally closer to be being able to use test
specs and cocoapods-generate. There's too much custom configuration yet
(and several other blockers) but figuring out what's required to build
will make it such that we can eventually transition.
* xcodeproj: Remove -all_load and -framework flags
-all_load is now being supplied by sync_project.rb.
Remove manually specified -framework flags from the project file. The
-framework flags are actually coming from CocoaPods, but we copied the
others when manually linking against FirebaseFirestore. Now that that's
no longer required these can go away.
* Add a test-only mode to sync_project.rb
* Re-add CodableIntegrationTests.swift
A previous commit merged this incorrectly.
* Fix and rewrite sync_project.rb
Ever since we added multiple platforms, removing a file has been broken.
This fixes that issue.
Also, rewrite target synchronization to make more sense. Essentially now
there's one diff between the filesystem and the groups and then an
explicit diff is done between project files and target contents.
* Run sync_project.rb on post-install
* working serverTimestamp
* working FieldValue. Still need: document ref and ability to Eq of FieldValue
* DocumentReference implemented and testing works
* clean up header search path
* improving FieldValue enum comments
* run through formatting
* addressing comments
* formatted with swiftformat 0.35.7
* add missing bool->BOOL change
* undo unintended swift version change
* remove unwanted proj file change
* Clean up GeoPoint port to C++
... based on things learned porting Timestamps.
There's no good way to include conversions equivalent to toGeoPoint in
FIRTimestamp, so pull out separate conversion functions that match other
similar things.
* Extract MakeTimePoint into time_testing.h
... for reuse elsewhere
* Add TimestampInternal Hash/Truncate
* Use a method similar to NSDate to get current time on apple platforms
* Rename nanopb::String to nanopb::ByteString
... and flesh it out.
* Remove const pb_bytes_array* constructor
* Use std:: prefixes
* Pull forward CopyVector
* Simplify nanopb::Reader/Writer construction
* Reuse ByteString construction in serializer
* Add nanopb_testing.h
* Make QueryData.resume_token a ByteString
* Use ByteString as FieldValue::blob_value
* Migrate FSTBlobValue to FSTDelegateValue
* Rework the ByteString API
* Make data(), begin(), and end() never return nullptr
* Make copies of pb_bytes_array_t* more obvious (also avoids ambiguity
with the private constructor).
* Remove constructors that duplicate absl::string_view
* Make ByteString::Copy just a constructor
* Remove EncodeBytes/DecodeBytes
These duplicate ByteString constructors
* Overhaul ByteString and users
* Remove most conversions from ByteString
* Put remaining conversions in nanopb_util as free functions
* Make ByteStringWriter accumulate in a pb_bytes_array_t*
* Have ProtobufSerialize use ByteStringWriter
* Avoid reserving/writing if we're not asked to append data
* Ensure ByteStringWriter initializes/frees
* Make copies explicit
* Make Reserve match std::vector::reserve
* Add comments, assertions, and tests
* Remove _Nullable in plain C++
* Avoid adding -framework Foundation multiplatform targets on
non-Apple platforms
* Fix ordered_code_benchmark to be in a .cc file