Skip to content

Commit 6f791ce

Browse files
authored
Use xcodebuild for ios unit tests (#787)
* Update exampleTests to point use GoogleMobileAds.xcframework from pods * Update ios unit tests to use xcodebuild * Add more paths to google_mobile_ads.yaml
1 parent 0097578 commit 6f791ce

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/google_mobile_ads.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
paths:
2020
- "packages/google_mobile_ads/**"
2121
- ".github/workflows/google_mobile_ads.yaml"
22+
- "packages/google_mobile_ads/ios/**"
23+
- "packages/google_mobile_ads/android/**"
2224
push:
2325
branches:
2426
- master
@@ -63,9 +65,9 @@ jobs:
6365
run: ./.github/workflows/scripts/build-example.sh ios ./lib/main.dart
6466
- name: "Unit Tests"
6567
run: |
66-
cd packages/google_mobile_ads/ios
67-
pod lib lint --allow-warnings
68-
68+
cd packages/google_mobile_ads/example/ios
69+
xcodebuild -configuration Debug VERBOSE_SCRIPT_LOGGING=YES -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.2' test
70+
6971
flutter:
7072
runs-on: ubuntu-latest
7173
if: github.event_name == 'pull_request'

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
9E7A912E2825E14C005FD19A /* FLTUserMessagingPlatformReaderWriterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E7A912C2825E14C005FD19A /* FLTUserMessagingPlatformReaderWriterTest.m */; };
2828
9E7A912F2825E14C005FD19A /* FLTUserMessagingPlatformManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E7A912D2825E14C005FD19A /* FLTUserMessagingPlatformManagerTest.m */; };
2929
9E7B9D8F273206F800C6A6AB /* FLTAppStateNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E7B9D8E273206F800C6A6AB /* FLTAppStateNotifier.m */; };
30-
9EA7213725BB6517008D57E3 /* GoogleMobileAds.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EA7213525BB6464008D57E3 /* GoogleMobileAds.xcframework */; };
3130
9EA7474E2637CD6800E0B0E4 /* FLTBannerAdTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EA7474C2637CD6800E0B0E4 /* FLTBannerAdTest.m */; };
3231
9EA7474F2637CD6800E0B0E4 /* FLTGAMBannerAdTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EA7474D2637CD6800E0B0E4 /* FLTGAMBannerAdTest.m */; };
3332
9EA747532637EC7000E0B0E4 /* FLTGamInterstitialAdTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EA747512637EC7000E0B0E4 /* FLTGamInterstitialAdTest.m */; };
@@ -59,6 +58,7 @@
5958
9EF4E70C26392B230007E4FE /* FLTMobileAds_Internal.h in Sources */ = {isa = PBXBuildFile; fileRef = 9EF4E6FF26392B230007E4FE /* FLTMobileAds_Internal.h */; };
6059
9EF4E7102639410D0007E4FE /* FLTRewardedAdTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EF4E70F2639410D0007E4FE /* FLTRewardedAdTest.m */; };
6160
9EF4E7142639D4B30007E4FE /* FLTNativeAdTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EF4E7132639D4B30007E4FE /* FLTNativeAdTest.m */; };
61+
9EFEAB4F29B0019F000A063B /* GoogleMobileAds.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EFEAB4E29B0019F000A063B /* GoogleMobileAds.xcframework */; };
6262
BEF5C9D9BC96688454A0E3B0 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F14CED182CC13194D568B4C4 /* Pods_Runner.framework */; };
6363
/* End PBXBuildFile section */
6464

@@ -169,6 +169,7 @@
169169
9EF4E6FF26392B230007E4FE /* FLTMobileAds_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FLTMobileAds_Internal.h; path = ../../ios/Classes/FLTMobileAds_Internal.h; sourceTree = "<group>"; };
170170
9EF4E70F2639410D0007E4FE /* FLTRewardedAdTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FLTRewardedAdTest.m; path = ../../../ios/Tests/FLTRewardedAdTest.m; sourceTree = "<group>"; };
171171
9EF4E7132639D4B30007E4FE /* FLTNativeAdTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FLTNativeAdTest.m; path = ../../../ios/Tests/FLTNativeAdTest.m; sourceTree = "<group>"; };
172+
9EFEAB4E29B0019F000A063B /* GoogleMobileAds.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = GoogleMobileAds.xcframework; path = "Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework/GoogleMobileAds.xcframework"; sourceTree = "<group>"; };
172173
B4B811D89E676EBD37E2E206 /* libPods-google_mobile_ads_exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-google_mobile_ads_exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
173174
C0B22AB9B287C9F711EAAF48 /* Pods-google_mobile_ads_exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-google_mobile_ads_exampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-google_mobile_ads_exampleTests/Pods-google_mobile_ads_exampleTests.debug.xcconfig"; sourceTree = "<group>"; };
174175
CE82265EF05E2A9632B25E60 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
@@ -181,8 +182,8 @@
181182
isa = PBXFrameworksBuildPhase;
182183
buildActionMask = 2147483647;
183184
files = (
185+
9EFEAB4F29B0019F000A063B /* GoogleMobileAds.xcframework in Frameworks */,
184186
9EB9FE59280F86D100DDBB4F /* UserMessagingPlatform.xcframework in Frameworks */,
185-
9EA7213725BB6517008D57E3 /* GoogleMobileAds.xcframework in Frameworks */,
186187
5C7E63AC163134A326635FC7 /* libPods-google_mobile_ads_exampleTests.a in Frameworks */,
187188
);
188189
runOnlyForDeploymentPostprocessing = 0;
@@ -212,6 +213,7 @@
212213
5B6AAA352BAC85BF7DD68C46 /* Frameworks */ = {
213214
isa = PBXGroup;
214215
children = (
216+
9EFEAB4E29B0019F000A063B /* GoogleMobileAds.xcframework */,
215217
9EB9FE57280F853D00DDBB4F /* UserMessagingPlatform.xcframework */,
216218
9EA7213525BB6464008D57E3 /* GoogleMobileAds.xcframework */,
217219
B4B811D89E676EBD37E2E206 /* libPods-google_mobile_ads_exampleTests.a */,

0 commit comments

Comments
 (0)