From df8debb38680ef77e0399c45bef1997794ede0ac Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 7 Nov 2022 16:46:32 -0600 Subject: [PATCH] Adds AltTests test target # Conflicts: # AltStore.xcodeproj/project.pbxproj --- AltStore.xcodeproj/project.pbxproj | 159 +++++++++++++++++- .../xcshareddata/xcschemes/AltStore.xcscheme | 11 ++ .../xcshareddata/xcschemes/AltTests.xcscheme | 53 ++++++ AltTests/AltTests.swift | 22 +++ AltTests/TestErrors.swift | 7 + 5 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 AltStore.xcodeproj/xcshareddata/xcschemes/AltTests.xcscheme create mode 100644 AltTests/AltTests.swift create mode 100644 AltTests/TestErrors.swift diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index efcafa95..92fbec76 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -358,11 +358,14 @@ D55E163728776CB700A627A1 /* ComplicationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55E163528776CB000A627A1 /* ComplicationView.swift */; }; D5708417292448DA00D42D34 /* OperatingSystemVersion+Comparable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5708416292448DA00D42D34 /* OperatingSystemVersion+Comparable.swift */; }; D570841A2924680D00D42D34 /* OperatingSystemVersion+Comparable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5708416292448DA00D42D34 /* OperatingSystemVersion+Comparable.swift */; }; + D561B2EB28EF5A4F006752E4 /* AltSign-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = D561B2EA28EF5A4F006752E4 /* AltSign-Dynamic */; }; + D561B2ED28EF5A4F006752E4 /* AltSign-Dynamic in Embed Frameworks */ = {isa = PBXBuildFile; productRef = D561B2EA28EF5A4F006752E4 /* AltSign-Dynamic */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; D57DF638271E32F000677701 /* PatchApp.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D57DF637271E32F000677701 /* PatchApp.storyboard */; }; D57DF63F271E51E400677701 /* ALTAppPatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = D57DF63E271E51E400677701 /* ALTAppPatcher.m */; }; D57F2C9126E0070200B9FA39 /* EnableJITOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57F2C9026E0070200B9FA39 /* EnableJITOperation.swift */; }; D57F2C9426E01BC700B9FA39 /* UIDevice+Vibration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57F2C9326E01BC700B9FA39 /* UIDevice+Vibration.swift */; }; D57FE84428C7DB7100216002 /* ErrorLogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57FE84328C7DB7100216002 /* ErrorLogViewController.swift */; }; + D586D39B28EF58B0000E101F /* AltTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D586D39A28EF58B0000E101F /* AltTests.swift */; }; D58916FE28C7C55C00E39C8B /* LoggedError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58916FD28C7C55C00E39C8B /* LoggedError.swift */; }; D58D5F2E26DFE68E00E55E38 /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = D58D5F2D26DFE68E00E55E38 /* LaunchAtLogin */; }; D593F1942717749A006E82DE /* PatchAppOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D593F1932717749A006E82DE /* PatchAppOperation.swift */; }; @@ -375,6 +378,7 @@ D5E1E7C128077DE90016FC96 /* FetchTrustedSourcesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E1E7C028077DE90016FC96 /* FetchTrustedSourcesOperation.swift */; }; D5E3FB9828FDFAD90034B72C /* NSError+AltStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF6C336124197D700034FD24 /* NSError+AltStore.swift */; }; D5F2F6A92720B7C20081CCF5 /* PatchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F2F6A82720B7C20081CCF5 /* PatchViewController.swift */; }; + D5F5AF2E28FDD2EC00C938F5 /* TestErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F5AF2D28FDD2EC00C938F5 /* TestErrors.swift */; }; D5F5AF7D28ECEA990067C736 /* ErrorDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F5AF7C28ECEA990067C736 /* ErrorDetailsViewController.swift */; }; D5F99A1828D11DB500476A16 /* AltStore10ToAltStore11.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = D5F99A1728D11DB500476A16 /* AltStore10ToAltStore11.xcmappingmodel */; }; D5F99A1A28D12B1400476A16 /* StoreApp10ToStoreApp11Policy.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F99A1928D12B1400476A16 /* StoreApp10ToStoreApp11Policy.swift */; }; @@ -416,6 +420,13 @@ remoteGlobalIDString = BFF7C903257844C900E55F36; remoteInfo = AltXPC; }; + D586D39C28EF58B0000E101F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFD247622284B9A500981D42 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BFD247692284B9A500981D42; + remoteInfo = AltStore; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -475,6 +486,17 @@ name = "Embed XPC Services"; runOnlyForDeploymentPostprocessing = 0; }; + D561B2EC28EF5A4F006752E4 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + D561B2ED28EF5A4F006752E4 /* AltSign-Dynamic in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -844,6 +866,8 @@ D57F2C9026E0070200B9FA39 /* EnableJITOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnableJITOperation.swift; sourceTree = ""; }; D57F2C9326E01BC700B9FA39 /* UIDevice+Vibration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIDevice+Vibration.swift"; sourceTree = ""; }; D57FE84328C7DB7100216002 /* ErrorLogViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorLogViewController.swift; sourceTree = ""; }; + D586D39828EF58B0000E101F /* AltTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AltTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + D586D39A28EF58B0000E101F /* AltTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AltTests.swift; sourceTree = ""; }; D58916FD28C7C55C00E39C8B /* LoggedError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggedError.swift; sourceTree = ""; }; D593F1932717749A006E82DE /* PatchAppOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PatchAppOperation.swift; sourceTree = ""; }; D5CA0C4A280E141900469595 /* ManagedPatron.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManagedPatron.swift; sourceTree = ""; }; @@ -854,6 +878,7 @@ D5DB145828F9DC1000A8F606 /* ALTLocalizedError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ALTLocalizedError.swift; sourceTree = ""; }; D5E1E7C028077DE90016FC96 /* FetchTrustedSourcesOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchTrustedSourcesOperation.swift; sourceTree = ""; }; D5F2F6A82720B7C20081CCF5 /* PatchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PatchViewController.swift; sourceTree = ""; }; + D5F5AF2D28FDD2EC00C938F5 /* TestErrors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestErrors.swift; sourceTree = ""; }; D5F5AF7C28ECEA990067C736 /* ErrorDetailsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorDetailsViewController.swift; sourceTree = ""; }; D5F99A1728D11DB500476A16 /* AltStore10ToAltStore11.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; path = AltStore10ToAltStore11.xcmappingmodel; sourceTree = ""; }; D5F99A1928D12B1400476A16 /* StoreApp10ToStoreApp11Policy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreApp10ToStoreApp11Policy.swift; sourceTree = ""; }; @@ -944,6 +969,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D586D39528EF58B0000E101F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D561B2EB28EF5A4F006752E4 /* AltSign-Dynamic in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -1531,6 +1564,7 @@ BF18BFE824857D7900DD5981 /* AltDaemon */, BF98916C250AABF3002ACF50 /* AltWidget */, BFF7C905257844C900E55F36 /* AltXPC */, + D586D39928EF58B0000E101F /* AltTests */, BFD247852284BB3300981D42 /* Frameworks */, BFD2476B2284B9A500981D42 /* Products */, 4460E048E3AC1C9708C4FA33 /* Pods */, @@ -1549,6 +1583,7 @@ BF66EE7E2501AE50007EE018 /* AltStoreCore.framework */, BF989167250AABF3002ACF50 /* AltWidgetExtension.appex */, BFF7C904257844C900E55F36 /* AltXPC.xpc */, + D586D39828EF58B0000E101F /* AltTests.xctest */, ); name = Products; sourceTree = ""; @@ -1816,6 +1851,15 @@ path = XPC; sourceTree = ""; }; + D586D39928EF58B0000E101F /* AltTests */ = { + isa = PBXGroup; + children = ( + D586D39A28EF58B0000E101F /* AltTests.swift */, + D5F5AF2D28FDD2EC00C938F5 /* TestErrors.swift */, + ); + path = AltTests; + sourceTree = ""; + }; D589170128C7D93500E39C8B /* Error Log */ = { isa = PBXGroup; children = ( @@ -2083,13 +2127,35 @@ productReference = BFF7C904257844C900E55F36 /* AltXPC.xpc */; productType = "com.apple.product-type.xpc-service"; }; + D586D39728EF58B0000E101F /* AltTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D586D3A028EF58B0000E101F /* Build configuration list for PBXNativeTarget "AltTests" */; + buildPhases = ( + D586D39428EF58B0000E101F /* Sources */, + D586D39528EF58B0000E101F /* Frameworks */, + D586D39628EF58B0000E101F /* Resources */, + D561B2EC28EF5A4F006752E4 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + D586D39D28EF58B0000E101F /* PBXTargetDependency */, + ); + name = AltTests; + packageProductDependencies = ( + D561B2EA28EF5A4F006752E4 /* AltSign-Dynamic */, + ); + productName = AltTests; + productReference = D586D39828EF58B0000E101F /* AltTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BFD247622284B9A500981D42 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1200; + LastSwiftUpdateCheck = 1400; LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Riley Testut"; TargetAttributes = { @@ -2142,6 +2208,10 @@ CreatedOnToolsVersion = 12.3; LastSwiftMigration = 1230; }; + D586D39728EF58B0000E101F = { + CreatedOnToolsVersion = 14.0.1; + TestTargetID = BFD247692284B9A500981D42; + }; }; }; buildConfigurationList = BFD247652284B9A500981D42 /* Build configuration list for PBXProject "AltStore" */; @@ -2169,6 +2239,7 @@ BF66EE7D2501AE50007EE018 /* AltStoreCore */, BF989166250AABF3002ACF50 /* AltWidgetExtension */, BFF7C903257844C900E55F36 /* AltXPC */, + D586D39728EF58B0000E101F /* AltTests */, ); }; /* End PBXProject section */ @@ -2245,6 +2316,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D586D39628EF58B0000E101F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -2726,6 +2804,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D586D39428EF58B0000E101F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D586D39B28EF58B0000E101F /* AltTests.swift in Sources */, + D5F5AF2E28FDD2EC00C938F5 /* TestErrors.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -2754,6 +2841,11 @@ target = BFF7C903257844C900E55F36 /* AltXPC */; targetProxy = BFF7C90D257844C900E55F36 /* PBXContainerItemProxy */; }; + D586D39D28EF58B0000E101F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BFD247692284B9A500981D42 /* AltStore */; + targetProxy = D586D39C28EF58B0000E101F /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -3546,6 +3638,58 @@ }; name = Release; }; + D586D39E28EF58B0000E101F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 6XVY5G3U44; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.AltTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AltStore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/AltStore"; + }; + name = Debug; + }; + D586D39F28EF58B0000E101F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 6XVY5G3U44; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.AltTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AltStore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/AltStore"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -3639,6 +3783,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D586D3A028EF58B0000E101F /* Build configuration list for PBXNativeTarget "AltTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D586D39E28EF58B0000E101F /* Debug */, + D586D39F28EF58B0000E101F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ @@ -3665,6 +3818,10 @@ isa = XCSwiftPackageProductDependency; productName = "AltSign-Static"; }; + D561B2EA28EF5A4F006752E4 /* AltSign-Dynamic */ = { + isa = XCSwiftPackageProductDependency; + productName = "AltSign-Dynamic"; + }; D58D5F2D26DFE68E00E55E38 /* LaunchAtLogin */ = { isa = XCSwiftPackageProductDependency; package = D58D5F2C26DFE68E00E55E38 /* XCRemoteSwiftPackageReference "LaunchAtLogin" */; diff --git a/AltStore.xcodeproj/xcshareddata/xcschemes/AltStore.xcscheme b/AltStore.xcodeproj/xcshareddata/xcschemes/AltStore.xcscheme index cdc3f471..6ed9166a 100644 --- a/AltStore.xcodeproj/xcshareddata/xcschemes/AltStore.xcscheme +++ b/AltStore.xcodeproj/xcshareddata/xcschemes/AltStore.xcscheme @@ -28,6 +28,17 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AltTests/AltTests.swift b/AltTests/AltTests.swift new file mode 100644 index 00000000..9fc9bcc8 --- /dev/null +++ b/AltTests/AltTests.swift @@ -0,0 +1,22 @@ +// +// AltTests.swift +// AltTests +// +// Created by Riley Testut on 10/6/22. +// Copyright © 2022 Riley Testut. All rights reserved. +// + +import XCTest + +final class AltTests: XCTestCase +{ + override func setUpWithError() throws + { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws + { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } +} diff --git a/AltTests/TestErrors.swift b/AltTests/TestErrors.swift new file mode 100644 index 00000000..80386c51 --- /dev/null +++ b/AltTests/TestErrors.swift @@ -0,0 +1,7 @@ +// +// TestErrors.swift +// AltTests +// +// Created by Riley Testut on 10/17/22. +// Copyright © 2022 Riley Testut. All rights reserved. +//