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
3 changes: 3 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- '.swiftlint.yml'
- '**/*.swift'

permissions:
contents: read

jobs:
SwiftLint:
runs-on: ubuntu-latest
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Unit Tests

on:
pull_request:
paths:
- '.github/workflows/tests.yml'
- '**/*.swift'

permissions:
contents: read

jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Run unit tests
run: |
xcodebuild test \
-project "PPPC Utility.xcodeproj" \
-scheme "PPPC Utility" \
-destination "platform=macOS" \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ import XCTest

class TCCProfileImporterTests: XCTestCase {

func testBrokenSignedTCCProfile() {
func testMalformedTCCProfile() {
let tccProfileImporter = TCCProfileImporter()

let resourceURL = getResourceProfile(fileName: "TestTCCProfileSigned-Broken")

tccProfileImporter.decodeTCCProfile(fileUrl: resourceURL) { tccProfileResult in
switch tccProfileResult {
case .success:
XCTFail("Broken Signed Profile, it shouldn't be success")
XCTFail("Malformed profile should not succeed")
case .failure(let tccProfileError):
XCTAssertTrue(tccProfileError.localizedDescription.contains("The given data was not a valid property list."))
if case TCCProfileImportError.invalidProfileFile = tccProfileError { } else {
XCTFail("Expected invalidProfileFile error, got \(tccProfileError)")
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Source/View Controllers/TCCProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// swiftlint:disable file_length

import Cocoa
import OSLog
Expand Down
Loading