Skip to content

Commit e002b98

Browse files
wilhuffCorrob
authored andcommitted
Add support for running Firestore integration tests (#2660)
* Add Firestore_IntegrationTests_macOS to Xcode * Change deployment target from 10.14 to 10.10 * Make standard target edits * Force C99/C++11 * Use shared test info.plist * Remove CODE_SIGN_IDENTITY * Add Firestore_IntegrationTests_macOS to the Podfile * Have sync_project handle macOS integration tests * Pod install and sync_project * Add header search paths and ldflags * Build integration tests on macos * Remove integration tests from unit tests * Make Firestore_IntegrationTests_macOS buildable from the command-line
1 parent a0c6da2 commit e002b98

File tree

7 files changed

+456
-32
lines changed

7 files changed

+456
-32
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 318 additions & 11 deletions
Large diffs are not rendered by default.

Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_Example_macOS.xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@
3838
ReferencedContainer = "container:Firestore.xcodeproj">
3939
</BuildableReference>
4040
</TestableReference>
41+
<TestableReference
42+
skipped = "NO">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "54B8E4A9224BDC4100930F18"
46+
BuildableName = "Firestore_IntegrationTests_macOS.xctest"
47+
BlueprintName = "Firestore_IntegrationTests_macOS"
48+
ReferencedContainer = "container:Firestore.xcodeproj">
49+
</BuildableReference>
50+
</TestableReference>
4151
</Testables>
4252
<MacroExpansion>
4353
<BuildableReference
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1010"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "54B8E4A9224BDC4100930F18"
18+
BuildableName = "Firestore_IntegrationTests_macOS.xctest"
19+
BlueprintName = "Firestore_IntegrationTests_macOS"
20+
ReferencedContainer = "container:Firestore.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "54B8E4A9224BDC4100930F18"
36+
BuildableName = "Firestore_IntegrationTests_macOS.xctest"
37+
BlueprintName = "Firestore_IntegrationTests_macOS"
38+
ReferencedContainer = "container:Firestore.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "54B8E4A9224BDC4100930F18"
46+
BuildableName = "Firestore_IntegrationTests_macOS.xctest"
47+
BlueprintName = "Firestore_IntegrationTests_macOS"
48+
ReferencedContainer = "container:Firestore.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "54B8E4A9224BDC4100930F18"
68+
BuildableName = "Firestore_IntegrationTests_macOS.xctest"
69+
BlueprintName = "Firestore_IntegrationTests_macOS"
70+
ReferencedContainer = "container:Firestore.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<AdditionalOptions>
74+
</AdditionalOptions>
75+
</LaunchAction>
76+
<ProfileAction
77+
buildConfiguration = "Release"
78+
shouldUseLaunchSchemeArgsEnv = "YES"
79+
savedToolIdentifier = ""
80+
useCustomWorkingDirectory = "NO"
81+
debugDocumentVersioning = "YES">
82+
<MacroExpansion>
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "54B8E4A9224BDC4100930F18"
86+
BuildableName = "Firestore_IntegrationTests_macOS.xctest"
87+
BlueprintName = "Firestore_IntegrationTests_macOS"
88+
ReferencedContainer = "container:Firestore.xcodeproj">
89+
</BuildableReference>
90+
</MacroExpansion>
91+
</ProfileAction>
92+
<AnalyzeAction
93+
buildConfiguration = "Debug">
94+
</AnalyzeAction>
95+
<ArchiveAction
96+
buildConfiguration = "Release"
97+
revealArchiveInOrganizer = "YES">
98+
</ArchiveAction>
99+
</Scheme>

Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_Tests_macOS.xcscheme

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@
6868
savedToolIdentifier = ""
6969
useCustomWorkingDirectory = "NO"
7070
debugDocumentVersioning = "YES">
71-
<MacroExpansion>
72-
<BuildableReference
73-
BuildableIdentifier = "primary"
74-
BlueprintIdentifier = "DAFF0CF421E64AC30062958F"
75-
BuildableName = "Firestore_Example_macOS.app"
76-
BlueprintName = "Firestore_Example_macOS"
77-
ReferencedContainer = "container:Firestore.xcodeproj">
78-
</BuildableReference>
79-
</MacroExpansion>
8071
</ProfileAction>
8172
<AnalyzeAction
8273
buildConfiguration = "Debug">

Firestore/Example/Podfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,13 @@ target 'Firestore_Example_macOS' do
7676
pod 'OCMock'
7777
pod 'leveldb-library'
7878
end
79+
80+
target 'Firestore_IntegrationTests_macOS' do
81+
inherit! :search_paths
82+
83+
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
84+
85+
pod 'OCMock'
86+
pod 'leveldb-library'
87+
end
7988
end

scripts/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ case "$product-$method-$platform" in
314314
"${xcb_flags[@]}" \
315315
build \
316316
test
317+
318+
RunXcodebuild \
319+
-workspace 'Firestore/Example/Firestore.xcworkspace' \
320+
-scheme "Firestore_IntegrationTests_$platform" \
321+
"${xcb_flags[@]}" \
322+
build
317323
;;
318324

319325
Firestore-cmake-macOS)

scripts/sync_project.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def sync_firestore()
6262
'SwiftTests',
6363
]
6464

65-
['Firestore_Tests_iOS', 'Firestore_Tests_macOS'].each do |target_name|
66-
s.target target_name do |t|
65+
['iOS', 'macOS'].each do |platform|
66+
s.target "Firestore_Tests_#{platform}" do |t|
6767
t.source_files = [
6868
'Firestore/Example/Tests/**',
6969
'Firestore/core/test/**',
@@ -80,16 +80,18 @@ def sync_firestore()
8080
end
8181
end
8282

83-
s.target 'Firestore_IntegrationTests_iOS' do |t|
84-
t.source_files = [
85-
'Firestore/Example/Tests/Integration/**',
86-
'Firestore/Example/Tests/Util/FSTEventAccumulator.mm',
87-
'Firestore/Example/Tests/Util/FSTHelpers.mm',
88-
'Firestore/Example/Tests/Util/FSTIntegrationTestCase.mm',
89-
'Firestore/Example/Tests/Util/XCTestCase+Await.mm',
90-
'Firestore/Example/Tests/en.lproj/InfoPlist.strings',
91-
'Firestore/core/test/firebase/firestore/testutil/**',
92-
]
83+
['iOS', 'macOS'].each do |platform|
84+
s.target "Firestore_IntegrationTests_#{platform}" do |t|
85+
t.source_files = [
86+
'Firestore/Example/Tests/Integration/**',
87+
'Firestore/Example/Tests/Util/FSTEventAccumulator.mm',
88+
'Firestore/Example/Tests/Util/FSTHelpers.mm',
89+
'Firestore/Example/Tests/Util/FSTIntegrationTestCase.mm',
90+
'Firestore/Example/Tests/Util/XCTestCase+Await.mm',
91+
'Firestore/Example/Tests/en.lproj/InfoPlist.strings',
92+
'Firestore/core/test/firebase/firestore/testutil/**',
93+
]
94+
end
9395
end
9496

9597
s.sync()

0 commit comments

Comments
 (0)