Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 2a236e9

Browse files
Standardize XCTest locations and harnesses (#4005)
- Moves XCTest files to the now-standard location - Ensures that the harnesses are called RunnerTests for consistency - Splits the image_picker unit tests out of the UI target into a new unit test target - Moves existing google_sign_in tests into the harness, since they weren't being run. One new test, added since we accidentally stopped compiling the file, was removed since it crashed other tests in the suite (which has non-trivial global state, so fixing it wasn't feasible here; I've follow up on the PR that added the test).
1 parent b2dd320 commit 2a236e9

File tree

43 files changed

+476
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+476
-345
lines changed

packages/camera/camera/example/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ flutter_ios_podfile_setup
2929

3030
target 'Runner' do
3131
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32-
33-
target 'UnitTests' do
32+
33+
target 'RunnerTests' do
3434
platform :ios, '9.0'
3535
inherit! :search_paths
3636
# Pods for testing

packages/camera/camera/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
01010359265BEB94FD7CE839 /* libPods-UnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CCBF0769BA2C53F6AED0F17 /* libPods-UnitTests.a */; };
1110
03BB766B2665316900CE5A93 /* CameraFocusTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03BB766A2665316900CE5A93 /* CameraFocusTests.m */; };
12-
03BB767326653ABE00CE5A93 /* CameraPluginTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03BB767226653ABE00CE5A93 /* CameraPluginTests.m */; };
1311
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
12+
334733EA2668111C00DCC49E /* CameraPluginTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03BB767226653ABE00CE5A93 /* CameraPluginTests.m */; };
1413
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1514
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1615
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
1716
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1817
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1918
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
19+
A513685080F868CF2695CE75 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5555DD51E06E67921CFA83DD /* libPods-RunnerTests.a */; };
2020
D065CD815D405ECB22FB1BBA /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A4F2DE74AE0C572296A00BF /* libPods-Runner.a */; };
2121
/* End PBXBuildFile section */
2222

@@ -44,15 +44,16 @@
4444
/* End PBXCopyFilesBuildPhase section */
4545

4646
/* Begin PBXFileReference section */
47-
03BB76682665316900CE5A93 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
47+
03BB76682665316900CE5A93 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4848
03BB766A2665316900CE5A93 /* CameraFocusTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CameraFocusTests.m; sourceTree = "<group>"; };
4949
03BB766C2665316900CE5A93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
50-
03BB767226653ABE00CE5A93 /* CameraPluginTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CameraPluginTests.m; path = ../../../ios/Tests/CameraPluginTests.m; sourceTree = "<group>"; };
50+
03BB767226653ABE00CE5A93 /* CameraPluginTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraPluginTests.m; sourceTree = "<group>"; };
5151
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
5252
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
5353
2A4F2DE74AE0C572296A00BF /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5454
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
55-
6CCBF0769BA2C53F6AED0F17 /* libPods-UnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-UnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
55+
40D9DDFB3787960D28DF3FB3 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
56+
5555DD51E06E67921CFA83DD /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5657
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
5758
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5859
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -66,16 +67,15 @@
6667
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6768
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6869
A4725B4F24805CD3CA67828F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
69-
A903DC9BC9D1CB89BD4FB3CB /* Pods-UnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.debug.xcconfig"; path = "Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig"; sourceTree = "<group>"; };
70-
C2D350ADCDFC81FCB0D6F12C /* Pods-UnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.release.xcconfig"; path = "Target Support Files/Pods-UnitTests/Pods-UnitTests.release.xcconfig"; sourceTree = "<group>"; };
70+
D1FF8C34CA9E9BE702C5EC06 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
7171
/* End PBXFileReference section */
7272

7373
/* Begin PBXFrameworksBuildPhase section */
7474
03BB76652665316900CE5A93 /* Frameworks */ = {
7575
isa = PBXFrameworksBuildPhase;
7676
buildActionMask = 2147483647;
7777
files = (
78-
01010359265BEB94FD7CE839 /* libPods-UnitTests.a in Frameworks */,
78+
A513685080F868CF2695CE75 /* libPods-RunnerTests.a in Frameworks */,
7979
);
8080
runOnlyForDeploymentPostprocessing = 0;
8181
};
@@ -90,21 +90,21 @@
9090
/* End PBXFrameworksBuildPhase section */
9191

9292
/* Begin PBXGroup section */
93-
03BB76692665316900CE5A93 /* UnitTests */ = {
93+
03BB76692665316900CE5A93 /* RunnerTests */ = {
9494
isa = PBXGroup;
9595
children = (
9696
03BB767226653ABE00CE5A93 /* CameraPluginTests.m */,
9797
03BB766A2665316900CE5A93 /* CameraFocusTests.m */,
9898
03BB766C2665316900CE5A93 /* Info.plist */,
9999
);
100-
path = UnitTests;
100+
path = RunnerTests;
101101
sourceTree = "<group>";
102102
};
103103
78D1009194BD06C03BED950D /* Frameworks */ = {
104104
isa = PBXGroup;
105105
children = (
106106
2A4F2DE74AE0C572296A00BF /* libPods-Runner.a */,
107-
6CCBF0769BA2C53F6AED0F17 /* libPods-UnitTests.a */,
107+
5555DD51E06E67921CFA83DD /* libPods-RunnerTests.a */,
108108
);
109109
name = Frameworks;
110110
sourceTree = "<group>";
@@ -125,7 +125,7 @@
125125
children = (
126126
9740EEB11CF90186004384FC /* Flutter */,
127127
97C146F01CF9000F007C117D /* Runner */,
128-
03BB76692665316900CE5A93 /* UnitTests */,
128+
03BB76692665316900CE5A93 /* RunnerTests */,
129129
97C146EF1CF9000F007C117D /* Products */,
130130
FD386F00E98D73419C929072 /* Pods */,
131131
78D1009194BD06C03BED950D /* Frameworks */,
@@ -136,7 +136,7 @@
136136
isa = PBXGroup;
137137
children = (
138138
97C146EE1CF9000F007C117D /* Runner.app */,
139-
03BB76682665316900CE5A93 /* UnitTests.xctest */,
139+
03BB76682665316900CE5A93 /* RunnerTests.xctest */,
140140
);
141141
name = Products;
142142
sourceTree = "<group>";
@@ -170,18 +170,18 @@
170170
children = (
171171
8F7D83D0CFC9B51065F87CE1 /* Pods-Runner.debug.xcconfig */,
172172
A4725B4F24805CD3CA67828F /* Pods-Runner.release.xcconfig */,
173-
A903DC9BC9D1CB89BD4FB3CB /* Pods-UnitTests.debug.xcconfig */,
174-
C2D350ADCDFC81FCB0D6F12C /* Pods-UnitTests.release.xcconfig */,
173+
40D9DDFB3787960D28DF3FB3 /* Pods-RunnerTests.debug.xcconfig */,
174+
D1FF8C34CA9E9BE702C5EC06 /* Pods-RunnerTests.release.xcconfig */,
175175
);
176176
path = Pods;
177177
sourceTree = "<group>";
178178
};
179179
/* End PBXGroup section */
180180

181181
/* Begin PBXNativeTarget section */
182-
03BB76672665316900CE5A93 /* UnitTests */ = {
182+
03BB76672665316900CE5A93 /* RunnerTests */ = {
183183
isa = PBXNativeTarget;
184-
buildConfigurationList = 03BB76712665316900CE5A93 /* Build configuration list for PBXNativeTarget "UnitTests" */;
184+
buildConfigurationList = 03BB76712665316900CE5A93 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
185185
buildPhases = (
186186
604FC00FF5713F40F2A4441D /* [CP] Check Pods Manifest.lock */,
187187
03BB76642665316900CE5A93 /* Sources */,
@@ -193,9 +193,9 @@
193193
dependencies = (
194194
03BB766E2665316900CE5A93 /* PBXTargetDependency */,
195195
);
196-
name = UnitTests;
196+
name = RunnerTests;
197197
productName = camera_exampleTests;
198-
productReference = 03BB76682665316900CE5A93 /* UnitTests.xctest */;
198+
productReference = 03BB76682665316900CE5A93 /* RunnerTests.xctest */;
199199
productType = "com.apple.product-type.bundle.unit-test";
200200
};
201201
97C146ED1CF9000F007C117D /* Runner */ = {
@@ -253,7 +253,7 @@
253253
projectRoot = "";
254254
targets = (
255255
97C146ED1CF9000F007C117D /* Runner */,
256-
03BB76672665316900CE5A93 /* UnitTests */,
256+
03BB76672665316900CE5A93 /* RunnerTests */,
257257
);
258258
};
259259
/* End PBXProject section */
@@ -331,7 +331,7 @@
331331
outputFileListPaths = (
332332
);
333333
outputPaths = (
334-
"$(DERIVED_FILE_DIR)/Pods-UnitTests-checkManifestLockResult.txt",
334+
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
335335
);
336336
runOnlyForDeploymentPostprocessing = 0;
337337
shellPath = /bin/sh;
@@ -360,7 +360,7 @@
360360
buildActionMask = 2147483647;
361361
files = (
362362
03BB766B2665316900CE5A93 /* CameraFocusTests.m in Sources */,
363-
03BB767326653ABE00CE5A93 /* CameraPluginTests.m in Sources */,
363+
334733EA2668111C00DCC49E /* CameraPluginTests.m in Sources */,
364364
);
365365
runOnlyForDeploymentPostprocessing = 0;
366366
};
@@ -406,7 +406,7 @@
406406
/* Begin XCBuildConfiguration section */
407407
03BB766F2665316900CE5A93 /* Debug */ = {
408408
isa = XCBuildConfiguration;
409-
baseConfigurationReference = A903DC9BC9D1CB89BD4FB3CB /* Pods-UnitTests.debug.xcconfig */;
409+
baseConfigurationReference = 40D9DDFB3787960D28DF3FB3 /* Pods-RunnerTests.debug.xcconfig */;
410410
buildSettings = {
411411
BUNDLE_LOADER = "$(TEST_HOST)";
412412
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@@ -417,7 +417,7 @@
417417
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
418418
CODE_SIGN_STYLE = Automatic;
419419
GCC_C_LANGUAGE_STANDARD = gnu11;
420-
INFOPLIST_FILE = UnitTests/Info.plist;
420+
INFOPLIST_FILE = RunnerTests/Info.plist;
421421
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
422422
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
423423
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
@@ -431,7 +431,7 @@
431431
};
432432
03BB76702665316900CE5A93 /* Release */ = {
433433
isa = XCBuildConfiguration;
434-
baseConfigurationReference = C2D350ADCDFC81FCB0D6F12C /* Pods-UnitTests.release.xcconfig */;
434+
baseConfigurationReference = D1FF8C34CA9E9BE702C5EC06 /* Pods-RunnerTests.release.xcconfig */;
435435
buildSettings = {
436436
BUNDLE_LOADER = "$(TEST_HOST)";
437437
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@@ -442,7 +442,7 @@
442442
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
443443
CODE_SIGN_STYLE = Automatic;
444444
GCC_C_LANGUAGE_STANDARD = gnu11;
445-
INFOPLIST_FILE = UnitTests/Info.plist;
445+
INFOPLIST_FILE = RunnerTests/Info.plist;
446446
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
447447
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
448448
MTL_FAST_MATH = YES;
@@ -606,7 +606,7 @@
606606
/* End XCBuildConfiguration section */
607607

608608
/* Begin XCConfigurationList section */
609-
03BB76712665316900CE5A93 /* Build configuration list for PBXNativeTarget "UnitTests" */ = {
609+
03BB76712665316900CE5A93 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
610610
isa = XCConfigurationList;
611611
buildConfigurations = (
612612
03BB766F2665316900CE5A93 /* Debug */,

packages/camera/camera/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<BuildableReference
4343
BuildableIdentifier = "primary"
4444
BlueprintIdentifier = "03BB76672665316900CE5A93"
45-
BuildableName = "UnitTests.xctest"
46-
BlueprintName = "UnitTests"
45+
BuildableName = "RunnerTests.xctest"
46+
BlueprintName = "RunnerTests"
4747
ReferencedContainer = "container:Runner.xcodeproj">
4848
</BuildableReference>
4949
</TestableReference>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

packages/camera/camera/ios/camera.podspec

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,4 @@ A Flutter plugin to use the camera from your Flutter app.
1919

2020
s.platform = :ios, '8.0'
2121
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
22-
23-
s.test_spec 'Tests' do |test_spec|
24-
test_spec.source_files = 'Tests/**/*'
25-
end
2622
end

packages/google_sign_in/google_sign_in/example/ios/Podfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ target 'Runner' do
3131
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3232
target 'RunnerTests' do
3333
inherit! :search_paths
34+
35+
pod 'OCMock','3.5'
3436
end
3537
end
3638

0 commit comments

Comments
 (0)