From 090b00cc2f57ea5bba4b3469fac02482ca99e35e Mon Sep 17 00:00:00 2001 From: Jawwad Ahmad Date: Tue, 4 Oct 2022 16:35:17 -0700 Subject: [PATCH] Remove TestTools.h Summary: - TestTools is now 100% Swift - FBSDKCoreKit imports had to be added since it was no longer imported globally via TestTools.h - A few line breaks had to be added above the new import to prevent the "Imports should be sorted" violation from SwiftLint Reviewed By: samodom Differential Revision: D40077738 fbshipit-source-id: 2cb5cbeceb90214f58fa0f6fe635eef133faa336 --- .../FBSDKCoreKitTests-Bridging-Header.h | 2 +- .../Internal/AppEventsDeviceInfoTests.swift | 1 + .../ChooseContextContentTests.swift | 2 ++ .../ChooseContextDialogTests.swift | 1 + .../ContextWebDialogTests.swift | 2 ++ .../FriendFinderDialogTests.swift | 2 ++ .../GameRequestDialogTests.swift | 2 ++ .../GameRequestURLProviderTests.swift | 1 + .../GamingGroupIntegrationTests.swift | 1 + .../GamingImageUploaderTests.swift | 2 ++ .../GamingVideoUploaderTests.swift | 2 ++ .../SampleContextDialogs.swift | 2 ++ .../ShareTournamentDialogTests.swift | 2 ++ .../SwitchContextContentTests.swift | 2 ++ .../Bridging/TestBridgeAPIRequestFactory.swift | 1 + .../Content/ShareModelTestUtility.swift | 1 + .../Content/SharePhotoTests.swift | 1 + .../Content/ShareVideoTests.swift | 1 + .../UserInterface/FBSendButtonTests.swift | 1 + .../UserInterface/FBShareButtonTests.swift | 2 ++ .../UserInterface/MessageDialogTests.swift | 2 ++ TestTools/TestTools.xcodeproj/project.pbxproj | 15 --------------- TestTools/TestTools/SampleError.swift | 2 ++ TestTools/TestTools/TestBridgeAPIRequest.swift | 1 + .../TestTools/TestBridgeAPIRequestOpener.swift | 1 + TestTools/TestTools/TestErrorFactory.swift | 1 + TestTools/TestTools/TestSettings.swift | 1 + TestTools/TestTools/TestTools.h | 9 --------- TestTools/project.yml | 1 - 29 files changed, 38 insertions(+), 26 deletions(-) delete mode 100644 TestTools/TestTools/TestTools.h diff --git a/FBSDKCoreKit/FBSDKCoreKitTests/FBSDKCoreKitTests-Bridging-Header.h b/FBSDKCoreKit/FBSDKCoreKitTests/FBSDKCoreKitTests-Bridging-Header.h index 41369645e..8b70e82b3 100644 --- a/FBSDKCoreKit/FBSDKCoreKitTests/FBSDKCoreKitTests-Bridging-Header.h +++ b/FBSDKCoreKit/FBSDKCoreKitTests/FBSDKCoreKitTests-Bridging-Header.h @@ -11,7 +11,7 @@ #import #import #import -#import +@import TestTools; #import "XCTestCase+Extensions.h" diff --git a/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEventsDeviceInfoTests.swift b/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEventsDeviceInfoTests.swift index 224d21817..bd7aca691 100644 --- a/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEventsDeviceInfoTests.swift +++ b/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEventsDeviceInfoTests.swift @@ -8,6 +8,7 @@ @testable import FBSDKCoreKit +import TestTools import XCTest final class AppEventsDeviceInfoTests: XCTestCase { diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextContentTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextContentTests.swift index 86d42c91b..c57846eef 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextContentTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextContentTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextDialogTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextDialogTests.swift index e0bd29b38..16467dcd1 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextDialogTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ChooseContextDialogTests.swift @@ -8,6 +8,7 @@ @testable import FBSDKGamingServicesKit +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ContextWebDialogTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ContextWebDialogTests.swift index f98f2db18..8414b9d2e 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ContextWebDialogTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ContextWebDialogTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/FriendFinderDialogTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/FriendFinderDialogTests.swift index 943cc977c..939cee002 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/FriendFinderDialogTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/FriendFinderDialogTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestDialogTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestDialogTests.swift index f0ee7f02c..a507c3675 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestDialogTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestDialogTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import FBSDKShareKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestURLProviderTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestURLProviderTests.swift index f85c1e170..dad935689 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestURLProviderTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GameRequestURLProviderTests.swift @@ -8,6 +8,7 @@ @testable import FBSDKGamingServicesKit +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingGroupIntegrationTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingGroupIntegrationTests.swift index db250d28b..d2127c93a 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingGroupIntegrationTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingGroupIntegrationTests.swift @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingImageUploaderTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingImageUploaderTests.swift index 14b770064..03a4d17af 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingImageUploaderTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingImageUploaderTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingVideoUploaderTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingVideoUploaderTests.swift index 6ce118df4..4ec3f5a65 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingVideoUploaderTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/GamingVideoUploaderTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SampleContextDialogs.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SampleContextDialogs.swift index c1be5f473..013188edc 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SampleContextDialogs.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SampleContextDialogs.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools enum SampleContextDialogs { diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ShareTournamentDialogTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ShareTournamentDialogTests.swift index e979c380e..1f0be7d36 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ShareTournamentDialogTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/ShareTournamentDialogTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SwitchContextContentTests.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SwitchContextContentTests.swift index 243ad00bb..c81870a61 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SwitchContextContentTests.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/SwitchContextContentTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKGamingServicesKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKShareKit/FBSDKShareKitTests/Bridging/TestBridgeAPIRequestFactory.swift b/FBSDKShareKit/FBSDKShareKitTests/Bridging/TestBridgeAPIRequestFactory.swift index cffd333cc..c4b836595 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/Bridging/TestBridgeAPIRequestFactory.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/Bridging/TestBridgeAPIRequestFactory.swift @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +import FBSDKCoreKit import Foundation import TestTools diff --git a/FBSDKShareKit/FBSDKShareKitTests/Content/ShareModelTestUtility.swift b/FBSDKShareKit/FBSDKShareKitTests/Content/ShareModelTestUtility.swift index cb3307f5f..e0156254c 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/Content/ShareModelTestUtility.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/Content/ShareModelTestUtility.swift @@ -8,6 +8,7 @@ import FBSDKShareKit import TestTools +import UIKit enum ShareModelTestUtility { diff --git a/FBSDKShareKit/FBSDKShareKitTests/Content/SharePhotoTests.swift b/FBSDKShareKit/FBSDKShareKitTests/Content/SharePhotoTests.swift index 86a29bd4b..f0ab3e585 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/Content/SharePhotoTests.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/Content/SharePhotoTests.swift @@ -8,6 +8,7 @@ @testable import FBSDKShareKit +import FBSDKCoreKit import Photos import TestTools import XCTest diff --git a/FBSDKShareKit/FBSDKShareKitTests/Content/ShareVideoTests.swift b/FBSDKShareKit/FBSDKShareKitTests/Content/ShareVideoTests.swift index 336970670..5c71e7a5c 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/Content/ShareVideoTests.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/Content/ShareVideoTests.swift @@ -8,6 +8,7 @@ @testable import FBSDKShareKit +import FBSDKCoreKit import Photos import TestTools import XCTest diff --git a/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBSendButtonTests.swift b/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBSendButtonTests.swift index 81c3aaded..ac3783a25 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBSendButtonTests.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBSendButtonTests.swift @@ -8,6 +8,7 @@ @testable import FBSDKShareKit +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBShareButtonTests.swift b/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBShareButtonTests.swift index 050264f15..86d1e2831 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBShareButtonTests.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/UserInterface/FBShareButtonTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKShareKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/FBSDKShareKit/FBSDKShareKitTests/UserInterface/MessageDialogTests.swift b/FBSDKShareKit/FBSDKShareKitTests/UserInterface/MessageDialogTests.swift index 114cf84e0..40634aff1 100644 --- a/FBSDKShareKit/FBSDKShareKitTests/UserInterface/MessageDialogTests.swift +++ b/FBSDKShareKit/FBSDKShareKitTests/UserInterface/MessageDialogTests.swift @@ -7,6 +7,8 @@ */ @testable import FBSDKShareKit + +import FBSDKCoreKit import TestTools import XCTest diff --git a/TestTools/TestTools.xcodeproj/project.pbxproj b/TestTools/TestTools.xcodeproj/project.pbxproj index 5436325fa..d6c432848 100644 --- a/TestTools/TestTools.xcodeproj/project.pbxproj +++ b/TestTools/TestTools.xcodeproj/project.pbxproj @@ -33,7 +33,6 @@ BF1AFE1973B52493C7B6D03C /* SampleUserProfiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAD0C12E3DCAF88D1A6D0E0A /* SampleUserProfiles.swift */; }; C267A09733E0B5399A583086 /* TestSDKError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1261F972AA29EAF48DA1D6B /* TestSDKError.swift */; }; C975A94CFA4522D7A5194379 /* TestKeychainStoreFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEA859E1F31F30B29819BC2F /* TestKeychainStoreFactory.swift */; }; - CD78B55C79B11804946E08EE /* TestTools.h in Headers */ = {isa = PBXBuildFile; fileRef = CC38C544BAC3F3485C5F699F /* TestTools.h */; settings = {ATTRIBUTES = (Public, ); }; }; CDF18EF7B43D29D705F3FCDD /* TestAuthenticationTokenWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791B050D2D078864251AB3F2 /* TestAuthenticationTokenWallet.swift */; }; D8D8E4F13BCAEEF3BFEB564F /* TestURLHoster.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26F9D497DC3FEC7192A188F /* TestURLHoster.swift */; }; E9F7C901C033B4975EA0AB2A /* Fuzzer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03A8D4BE357D16D0721EE967 /* Fuzzer.swift */; }; @@ -100,7 +99,6 @@ BCFB16AD8A9E8D19987885E4 /* TestGraphRequestFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestGraphRequestFactory.swift; sourceTree = ""; }; C0C7B46D8CAABDBF309B458A /* TestAccessTokenWallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestAccessTokenWallet.swift; sourceTree = ""; }; C1261F972AA29EAF48DA1D6B /* TestSDKError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSDKError.swift; sourceTree = ""; }; - CC38C544BAC3F3485C5F699F /* TestTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestTools.h; sourceTree = ""; }; CEDC22C4008A0E09368CF757 /* SampleError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleError.swift; sourceTree = ""; }; D07160C9DDB965A64C22AE60 /* TestGraphRequestConnectionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestGraphRequestConnectionFactory.swift; sourceTree = ""; }; D44853480B9144B4E2A10493 /* TestInternalUtility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestInternalUtility.swift; sourceTree = ""; }; @@ -160,7 +158,6 @@ 8640C198FCE46662467AD22C /* TestSessionProvider.swift */, BCFA80AADB26410AC60714D8 /* TestSettings.swift */, 5EADCEC319126E782252276B /* TestSKAdNetworkReporter.swift */, - CC38C544BAC3F3485C5F699F /* TestTools.h */, B26F9D497DC3FEC7192A188F /* TestURLHoster.swift */, B965B179D2246C48C0EF89B6 /* TestURLOpener.swift */, E4BAFA46C11FE8AD599E3549 /* TestWindowFinder.swift */, @@ -200,24 +197,12 @@ }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ - 8DB9EAC958C8DBE41CFBE228 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - CD78B55C79B11804946E08EE /* TestTools.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - /* Begin PBXNativeTarget section */ 7EE1BFF550650C49854D563A /* TestTools */ = { isa = PBXNativeTarget; buildConfigurationList = 8484440B93FEF66A21A7D2E1 /* Build configuration list for PBXNativeTarget "TestTools" */; buildPhases = ( DC1ECA2D21D9A8B0E51DB831 /* Run Swiftlint */, - 8DB9EAC958C8DBE41CFBE228 /* Headers */, 514FB552E0988BBC0743E3FC /* Sources */, ); buildRules = ( diff --git a/TestTools/TestTools/SampleError.swift b/TestTools/TestTools/SampleError.swift index 045a62abe..a56e9e743 100644 --- a/TestTools/TestTools/SampleError.swift +++ b/TestTools/TestTools/SampleError.swift @@ -6,6 +6,8 @@ * LICENSE file in the root directory of this source tree. */ +import Foundation + public struct SampleError: Error, Equatable { private let uuid = UUID() diff --git a/TestTools/TestTools/TestBridgeAPIRequest.swift b/TestTools/TestTools/TestBridgeAPIRequest.swift index 0b484f203..98f799a8e 100644 --- a/TestTools/TestTools/TestBridgeAPIRequest.swift +++ b/TestTools/TestTools/TestBridgeAPIRequest.swift @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +import FBSDKCoreKit import Foundation @objcMembers diff --git a/TestTools/TestTools/TestBridgeAPIRequestOpener.swift b/TestTools/TestTools/TestBridgeAPIRequestOpener.swift index c32928ea5..709ce371a 100644 --- a/TestTools/TestTools/TestBridgeAPIRequestOpener.swift +++ b/TestTools/TestTools/TestBridgeAPIRequestOpener.swift @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +import FBSDKCoreKit import Foundation @objcMembers diff --git a/TestTools/TestTools/TestErrorFactory.swift b/TestTools/TestTools/TestErrorFactory.swift index eacee802e..1a1e8777c 100644 --- a/TestTools/TestTools/TestErrorFactory.swift +++ b/TestTools/TestTools/TestErrorFactory.swift @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +import FBSDKCoreKit import Foundation @objcMembers diff --git a/TestTools/TestTools/TestSettings.swift b/TestTools/TestTools/TestSettings.swift index 0d8f491f4..3a37d1020 100644 --- a/TestTools/TestTools/TestSettings.swift +++ b/TestTools/TestTools/TestSettings.swift @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +import FBSDKCoreKit import Foundation @objcMembers diff --git a/TestTools/TestTools/TestTools.h b/TestTools/TestTools/TestTools.h deleted file mode 100644 index 081fd39c3..000000000 --- a/TestTools/TestTools/TestTools.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE file in the root directory of this source tree. - */ - -@import FBSDKCoreKit; diff --git a/TestTools/project.yml b/TestTools/project.yml index e96f1f781..62df84f02 100644 --- a/TestTools/project.yml +++ b/TestTools/project.yml @@ -23,7 +23,6 @@ targets: platform: iOS sources: - path: TestTools - headerVisibility: public excludes: - Info.plist dependencies: