Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.swift'
- '**.xcodeproj/**'
- '**.xctestplan'
- '.github/workflows/pull-request.yml'

env:
Expand Down Expand Up @@ -55,3 +56,26 @@ jobs:
CODE_SIGNING_REQUIRED=NO \
| xcbeautify --renderer github-actions || true

test:
name: Test
runs-on: macos-26
needs: build
timeout-minutes: 15

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Select Xcode version
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app

- name: Run tests
run: |
xcodebuild test \
-project "${{ env.APP_NAME }}.xcodeproj" \
-scheme "${{ env.SCHEME }}" \
-destination "platform=macOS" \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \
| xcbeautify --renderer github-actions || true

130 changes: 129 additions & 1 deletion BetterCapture.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@

/* Begin PBXBuildFile section */
6C5C123D2F3893FE0082CE23 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 6C0990E12F2BE0C200D48100 /* Sparkle */; };
6C7AABCC2F783CC3006496CE /* BetterCapture.xctestplan in Resources */ = {isa = PBXBuildFile; fileRef = 6C7AABCB2F783CC3006496CE /* BetterCapture.xctestplan */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
6C7AABC62F783B98006496CE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6C0990A72F2BE0C100D48100 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 6C0990AE2F2BE0C100D48100;
remoteInfo = BetterCapture;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
6C0990AF2F2BE0C100D48100 /* BetterCapture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BetterCapture.app; sourceTree = BUILT_PRODUCTS_DIR; };
6C7AABC22F783B98006496CE /* BetterCaptureTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BetterCaptureTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6C7AABCB2F783CC3006496CE /* BetterCapture.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = BetterCapture.xctestplan; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
Expand All @@ -33,6 +46,11 @@
path = BetterCapture;
sourceTree = "<group>";
};
6C7AABC32F783B98006496CE /* BetterCaptureTests */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = BetterCaptureTests;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -44,13 +62,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
6C7AABBF2F783B98006496CE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
6C0990A62F2BE0C100D48100 = {
isa = PBXGroup;
children = (
6C7AABCB2F783CC3006496CE /* BetterCapture.xctestplan */,
6C0990B12F2BE0C100D48100 /* BetterCapture */,
6C7AABC32F783B98006496CE /* BetterCaptureTests */,
6C0990B02F2BE0C100D48100 /* Products */,
);
sourceTree = "<group>";
Expand All @@ -59,6 +86,7 @@
isa = PBXGroup;
children = (
6C0990AF2F2BE0C100D48100 /* BetterCapture.app */,
6C7AABC22F783B98006496CE /* BetterCaptureTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -89,6 +117,29 @@
productReference = 6C0990AF2F2BE0C100D48100 /* BetterCapture.app */;
productType = "com.apple.product-type.application";
};
6C7AABC12F783B98006496CE /* BetterCaptureTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6C7AABCA2F783B98006496CE /* Build configuration list for PBXNativeTarget "BetterCaptureTests" */;
buildPhases = (
6C7AABBE2F783B98006496CE /* Sources */,
6C7AABBF2F783B98006496CE /* Frameworks */,
6C7AABC02F783B98006496CE /* Resources */,
);
buildRules = (
);
dependencies = (
6C7AABC72F783B98006496CE /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
6C7AABC32F783B98006496CE /* BetterCaptureTests */,
);
name = BetterCaptureTests;
packageProductDependencies = (
);
productName = BetterCaptureTests;
productReference = 6C7AABC22F783B98006496CE /* BetterCaptureTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -102,7 +153,11 @@
6C0990AE2F2BE0C100D48100 = {
CreatedOnToolsVersion = 26.0.1;
};
6C7AABC12F783B98006496CE = {
CreatedOnToolsVersion = 26.0.1;
TestTargetID = 6C0990AE2F2BE0C100D48100;
};
};
};
buildConfigurationList = 6C0990AA2F2BE0C100D48100 /* Build configuration list for PBXProject "BetterCapture" */;
developmentRegion = en;
Expand All @@ -122,12 +177,21 @@
projectRoot = "";
targets = (
6C0990AE2F2BE0C100D48100 /* BetterCapture */,
6C7AABC12F783B98006496CE /* BetterCaptureTests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
6C0990AD2F2BE0C100D48100 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6C7AABCC2F783CC3006496CE /* BetterCapture.xctestplan in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6C7AABC02F783B98006496CE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -144,9 +208,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
6C7AABBE2F783B98006496CE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */


/* Begin PBXTargetDependency section */
6C7AABC72F783B98006496CE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 6C0990AE2F2BE0C100D48100 /* BetterCapture */;
targetProxy = 6C7AABC62F783B98006496CE /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
6C0990CE2F2BE0C200D48100 /* Debug */ = {
Expand Down Expand Up @@ -345,6 +422,48 @@
};
name = Release;
};
6C7AABC82F783B98006496CE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DMX24B5FC3;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 15.2;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.sattlerjoshua.BetterCaptureTests;
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = NO;
SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BetterCapture.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/BetterCapture";
};
name = Debug;
};
6C7AABC92F783B98006496CE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DMX24B5FC3;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 15.2;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.sattlerjoshua.BetterCaptureTests;
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = NO;
SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BetterCapture.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/BetterCapture";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand All @@ -366,6 +485,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6C7AABCA2F783B98006496CE /* Build configuration list for PBXNativeTarget "BetterCaptureTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6C7AABC82F783B98006496CE /* Debug */,
6C7AABC92F783B98006496CE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,27 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:BetterCapture.xctestplan"
default = "YES">
</TestPlanReference>
<TestPlanReference
reference = "container:BetterCapture.xctestplan">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6C7AABC12F783B98006496CE"
BuildableName = "BetterCaptureTests.xctest"
BlueprintName = "BetterCaptureTests"
ReferencedContainer = "container:BetterCapture.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
24 changes: 24 additions & 0 deletions BetterCapture.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "D6A72634-1CDD-4C30-B6D7-ED35E89699ED",
"name" : "Configuration 1",
"options" : {

}
}
],
"defaultOptions" : {
"testTimeoutsEnabled" : true
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:BetterCapture.xcodeproj",
"identifier" : "6C7AABC12F783B98006496CE",
"name" : "BetterCaptureTests"
}
}
],
"version" : 1
}
2 changes: 1 addition & 1 deletion BetterCapture/BetterCaptureApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct MenuBarLabel: View {
let font = NSFont.monospacedDigitSystemFont(ofSize: 13, weight: .regular)
let attrs: [NSAttributedString.Key: Any] = [
.font: font,
.foregroundColor: NSColor.white,
.foregroundColor: NSColor.white
]

let referenceSize = (referenceText as NSString).size(withAttributes: attrs)
Expand Down
Loading
Loading