From 004fe2f787021678ebd1720b225e16db8f78dff9 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Sat, 26 Sep 2026 20:03:20 +0100 Subject: [PATCH] Configure FuelBoard XCTest target --- FuelBoard.xcodeproj/project.pbxproj | 194 +++++++++++++++++- .../xcshareddata/xcschemes/FuelBoard.xcscheme | 10 + .../FuelBoardSharedTests/FuelBoardTests.swift | 2 + .../FuelHistoryTests.swift | 2 + .../FuelBoardSharedTests/LiveChainTests.swift | 2 + 5 files changed, 201 insertions(+), 9 deletions(-) diff --git a/FuelBoard.xcodeproj/project.pbxproj b/FuelBoard.xcodeproj/project.pbxproj index 64fe475..4533b1c 100644 --- a/FuelBoard.xcodeproj/project.pbxproj +++ b/FuelBoard.xcodeproj/project.pbxproj @@ -7,6 +7,17 @@ objects = { /* Begin PBXBuildFile section */ + FBA000000000000000000001 /* DataRefreshMode.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000101 /* DataRefreshMode.swift */; }; + FBA000000000000000000002 /* FuelHistory.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000102 /* FuelHistory.swift */; }; + FBA000000000000000000003 /* FuelPriceProvider.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000103 /* FuelPriceProvider.swift */; }; + FBA000000000000000000004 /* FuelStore.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000104 /* FuelStore.swift */; }; + FBA000000000000000000005 /* MirrorFuelProvider.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000105 /* MirrorFuelProvider.swift */; }; + FBA000000000000000000006 /* SiriCheapestLookup.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000106 /* SiriCheapestLookup.swift */; }; + FBA000000000000000000007 /* WidgetLocationFetcher.swift in FuelBoardShared */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000107 /* WidgetLocationFetcher.swift */; }; + FBA000000000000000000008 /* FuelBoardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000108 /* FuelBoardTests.swift */; }; + FBA000000000000000000009 /* FuelHistoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBA000000000000000000109 /* FuelHistoryTests.swift */; }; + FBA00000000000000000000A /* LiveChainTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBA00000000000000000010A /* LiveChainTests.swift */; }; + FBA00000000000000000000B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBA00000000000000000010B /* XCTest.framework */; }; ADCE5B5A3033A32C008C131C /* FuelBoardWatch Watch App.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = ADCE5B4F3033A329008C131C /* FuelBoardWatch Watch App.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; ADCE5B623033A32D008C131C /* FuelBoardWatch Watch App Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = ADCE5B633033A32D008C131C /* FuelBoardWatch Watch App Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; BB0000000000000000000001 /* FuelBoardWidgets.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = BB0000000000000000000002 /* FuelBoardWidgets.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -73,6 +84,19 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + FBA000000000000000000100 /* FuelBoardSharedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FuelBoardSharedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FBA000000000000000000101 /* DataRefreshMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataRefreshMode.swift; sourceTree = ""; }; + FBA000000000000000000102 /* FuelHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FuelHistory.swift; sourceTree = ""; }; + FBA000000000000000000103 /* FuelPriceProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FuelPriceProvider.swift; sourceTree = ""; }; + FBA000000000000000000104 /* FuelStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FuelStore.swift; sourceTree = ""; }; + FBA000000000000000000105 /* MirrorFuelProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MirrorFuelProvider.swift; sourceTree = ""; }; + FBA000000000000000000106 /* SiriCheapestLookup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiriCheapestLookup.swift; sourceTree = ""; }; + FBA000000000000000000107 /* WidgetLocationFetcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetLocationFetcher.swift; sourceTree = ""; }; + FBA000000000000000000108 /* FuelBoardTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FuelBoardTests.swift; sourceTree = ""; }; + FBA000000000000000000109 /* FuelHistoryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FuelHistoryTests.swift; sourceTree = ""; }; + FBA00000000000000000010A /* LiveChainTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveChainTests.swift; sourceTree = ""; }; + FBA00000000000000000010B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = "System/Library/Frameworks/XCTest.framework"; sourceTree = SDKROOT; }; + AD22FCFF30682512009859D4 /* FuelBoardTips.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = FuelBoardTips.storekit; sourceTree = ""; }; ADCE5B4F3033A329008C131C /* FuelBoardWatch Watch App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "FuelBoardWatch Watch App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; ADCE5B633033A32D008C131C /* FuelBoardWatch Watch App Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "FuelBoardWatch Watch App Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; BB0000000000000000000002 /* FuelBoardWidgets.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FuelBoardWidgets.appex; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -108,6 +132,14 @@ /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ + FBA000000000000000000302 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FBA00000000000000000000B /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; ADCE5B4C3033A329008C131C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -139,9 +171,47 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + FBA000000000000000000200 = { + isa = PBXGroup; + children = ( + FBA000000000000000000201 /* Sources */, + FBA000000000000000000202 /* Tests */, + ); + name = FuelBoardTests; + path = FuelBoardTests; + sourceTree = ""; + }; + FBA000000000000000000201 = { + isa = PBXGroup; + children = ( + FBA000000000000000000101 /* DataRefreshMode.swift */, + FBA000000000000000000102 /* FuelHistory.swift */, + FBA000000000000000000103 /* FuelPriceProvider.swift */, + FBA000000000000000000104 /* FuelStore.swift */, + FBA000000000000000000105 /* MirrorFuelProvider.swift */, + FBA000000000000000000106 /* SiriCheapestLookup.swift */, + FBA000000000000000000107 /* WidgetLocationFetcher.swift */, + ); + name = Sources; + path = Sources/FuelBoardShared; + sourceTree = ""; + }; + FBA000000000000000000202 = { + isa = PBXGroup; + children = ( + FBA000000000000000000108 /* FuelBoardTests.swift */, + FBA000000000000000000109 /* FuelHistoryTests.swift */, + FBA00000000000000000010A /* LiveChainTests.swift */, + ); + name = Tests; + path = Tests/FuelBoardSharedTests; + sourceTree = ""; + }; BB000000000000000000000D = { isa = PBXGroup; children = ( + FBA000000000000000000200 /* FuelBoardTests */, + AD22FCFF30682512009859D4 /* FuelBoardTips.storekit */, BB0000000000000000000008 /* FuelBoard */, BB0000000000000000000009 /* FuelBoardWidgets */, BB000000000000000000000A /* Shared */, @@ -151,7 +221,7 @@ ); sourceTree = ""; }; - BB000000000000000000000E /* Products */ = { + BB000000000000000000000E = { isa = PBXGroup; children = ( BB0000000000000000000007 /* FuelBoard.app */, @@ -165,6 +235,23 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + FBA000000000000000000300 /* FuelBoardSharedTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FBA000000000000000000400 /* Build configuration list for PBXNativeTarget "FuelBoardSharedTests" */; + buildPhases = ( + FBA000000000000000000301 /* Sources */, + FBA000000000000000000302 /* Frameworks */, + FBA000000000000000000303 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FuelBoardSharedTests; + productName = FuelBoardSharedTests; + productReference = FBA000000000000000000100 /* FuelBoardSharedTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; ADCE5B4E3033A329008C131C /* FuelBoardWatch Watch App Extension */ = { isa = PBXNativeTarget; buildConfigurationList = ADCE5B593033A32B008C131C /* Build configuration list for PBXNativeTarget "FuelBoardWatch Watch App Extension" */; @@ -278,6 +365,11 @@ }; BB000000000000000000000F = { CreatedOnToolsVersion = 16.0; + SystemCapabilities = { + com.apple.InAppPurchase = { + enabled = 1; + }; + }; }; }; }; @@ -299,11 +391,19 @@ BB0000000000000000000005 /* FuelBoardWidgets */, ADCE5B673033A32D008C131C /* FuelBoardWatch Watch App */, ADCE5B4E3033A329008C131C /* FuelBoardWatch Watch App Extension */, + FBA000000000000000000300 /* FuelBoardSharedTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + FBA000000000000000000303 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; ADCE5B4D3033A329008C131C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -335,6 +435,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + FBA000000000000000000301 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FBA000000000000000000001 /* DataRefreshMode.swift in FuelBoardShared */, + FBA000000000000000000002 /* FuelHistory.swift in FuelBoardShared */, + FBA000000000000000000003 /* FuelPriceProvider.swift in FuelBoardShared */, + FBA000000000000000000004 /* FuelStore.swift in FuelBoardShared */, + FBA000000000000000000005 /* MirrorFuelProvider.swift in FuelBoardShared */, + FBA000000000000000000006 /* SiriCheapestLookup.swift in FuelBoardShared */, + FBA000000000000000000007 /* WidgetLocationFetcher.swift in FuelBoardShared */, + FBA000000000000000000008 /* FuelBoardTests.swift in Sources */, + FBA000000000000000000009 /* FuelHistoryTests.swift in Sources */, + FBA00000000000000000000A /* LiveChainTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; ADCE5B4B3033A329008C131C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -407,7 +524,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = Config/WatchApp.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -473,7 +590,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = Config/WatchApp.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -537,7 +654,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -602,7 +719,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -698,8 +815,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Config/App.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; GENERATE_INFOPLIST_FILE = NO; INFOPLIST_FILE = "Config/App-Info.plist"; @@ -710,6 +828,7 @@ MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.apt.fuelboard; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; @@ -721,8 +840,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Config/App.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; GENERATE_INFOPLIST_FILE = NO; INFOPLIST_FILE = "Config/App-Info.plist"; @@ -733,6 +853,7 @@ MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.apt.fuelboard; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; @@ -745,7 +866,7 @@ APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_ENTITLEMENTS = Config/Widget.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; GENERATE_INFOPLIST_FILE = NO; INFOPLIST_FILE = "Config/Widget-Info.plist"; @@ -770,7 +891,7 @@ APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_ENTITLEMENTS = Config/Widget.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_TEAM = F3BE6NE7U3; GENERATE_INFOPLIST_FILE = NO; INFOPLIST_FILE = "Config/Widget-Info.plist"; @@ -789,9 +910,64 @@ }; name = Release; }; + FBA000000000000000000401 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 22; + DEVELOPMENT_TEAM = F3BE6NE7U3; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = FuelBoardSharedTests; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.apt.fuelboard.sharedtests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + FBA000000000000000000402 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 22; + DEVELOPMENT_TEAM = F3BE6NE7U3; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = FuelBoardSharedTests; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.apt.fuelboard.sharedtests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + FBA000000000000000000400 /* Build configuration list for PBXNativeTarget "FuelBoardSharedTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FBA000000000000000000401 /* Debug */, + FBA000000000000000000402 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; ADCE5B593033A32B008C131C /* Build configuration list for PBXNativeTarget "FuelBoardWatch Watch App Extension" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/FuelBoard.xcodeproj/xcshareddata/xcschemes/FuelBoard.xcscheme b/FuelBoard.xcodeproj/xcshareddata/xcschemes/FuelBoard.xcscheme index e9fdbb1..7480d76 100644 --- a/FuelBoard.xcodeproj/xcshareddata/xcschemes/FuelBoard.xcscheme +++ b/FuelBoard.xcodeproj/xcshareddata/xcschemes/FuelBoard.xcscheme @@ -28,6 +28,16 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + diff --git a/FuelBoardTests/Tests/FuelBoardSharedTests/FuelBoardTests.swift b/FuelBoardTests/Tests/FuelBoardSharedTests/FuelBoardTests.swift index 835342e..774e445 100644 --- a/FuelBoardTests/Tests/FuelBoardSharedTests/FuelBoardTests.swift +++ b/FuelBoardTests/Tests/FuelBoardSharedTests/FuelBoardTests.swift @@ -1,5 +1,7 @@ import XCTest +#if SWIFT_PACKAGE @testable import FuelBoardShared +#endif // FuelBoard shared-logic tests. Run from FuelBoardTests/ with `swift test`. // Covers the pure logic that drives the app + widget: title sanitizer, price diff --git a/FuelBoardTests/Tests/FuelBoardSharedTests/FuelHistoryTests.swift b/FuelBoardTests/Tests/FuelBoardSharedTests/FuelHistoryTests.swift index 876fb7e..d97e54f 100644 --- a/FuelBoardTests/Tests/FuelBoardSharedTests/FuelHistoryTests.swift +++ b/FuelBoardTests/Tests/FuelBoardSharedTests/FuelHistoryTests.swift @@ -1,5 +1,7 @@ import XCTest +#if SWIFT_PACKAGE @testable import FuelBoardShared +#endif // FuelHistory — price-history store for the Favourites Trends graph. // Covers day math, slim day parsing, series building, delta rebasing and diff --git a/FuelBoardTests/Tests/FuelBoardSharedTests/LiveChainTests.swift b/FuelBoardTests/Tests/FuelBoardSharedTests/LiveChainTests.swift index 1614bb9..a5b9041 100644 --- a/FuelBoardTests/Tests/FuelBoardSharedTests/LiveChainTests.swift +++ b/FuelBoardTests/Tests/FuelBoardSharedTests/LiveChainTests.swift @@ -1,5 +1,7 @@ import XCTest +#if SWIFT_PACKAGE @testable import FuelBoardShared +#endif /// P0 live chain: GitHub mirror FIRST everywhere → [dev-only LAN relay] → /// (app: bundled dump in ContentView's catch, widget: cache → placeholder).