mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
🚛 Moved tests around, added Feature, UI tests
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -29,12 +29,24 @@
|
|||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
<Testables>
|
<Testables>
|
||||||
<TestableReference
|
<TestableReference
|
||||||
skipped = "NO">
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
||||||
BuildableName = "phpmon-tests.xctest"
|
BuildableName = "Unit Tests.xctest"
|
||||||
BlueprintName = "phpmon-tests"
|
BlueprintName = "Unit Tests"
|
||||||
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "C471E7BB28F9B90F0021E251"
|
||||||
|
BuildableName = "UI Tests.xctest"
|
||||||
|
BlueprintName = "UI Tests"
|
||||||
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</TestableReference>
|
</TestableReference>
|
||||||
|
@ -39,8 +39,30 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
||||||
BuildableName = "phpmon-tests.xctest"
|
BuildableName = "Unit Tests.xctest"
|
||||||
BlueprintName = "phpmon-tests"
|
BlueprintName = "Unit Tests"
|
||||||
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "C471E7AC28F9B4940021E251"
|
||||||
|
BuildableName = "Feature Tests.xctest"
|
||||||
|
BlueprintName = "Feature Tests"
|
||||||
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "C471E7BB28F9B90F0021E251"
|
||||||
|
BuildableName = "UI Tests.xctest"
|
||||||
|
BlueprintName = "UI Tests"
|
||||||
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</TestableReference>
|
</TestableReference>
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
||||||
BuildableName = "phpmon-tests.xctest"
|
BuildableName = "Unit Tests.xctest"
|
||||||
BlueprintName = "phpmon-tests"
|
BlueprintName = "Unit Tests"
|
||||||
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</TestableReference>
|
</TestableReference>
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -42,6 +42,11 @@ extension String {
|
|||||||
return count
|
return count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func matches(pattern: String) -> Bool {
|
||||||
|
let pred = NSPredicate(format: "self LIKE %@", pattern)
|
||||||
|
return !NSArray(object: self).filtered(using: pred).isEmpty
|
||||||
|
}
|
||||||
|
|
||||||
subscript(r: Range<String.Index>) -> String {
|
subscript(r: Range<String.Index>) -> String {
|
||||||
let start = r.lowerBound
|
let start = r.lowerBound
|
||||||
let end = r.upperBound
|
let end = r.upperBound
|
||||||
@ -98,5 +103,4 @@ extension String {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
logger.verbosity = .performance
|
logger.verbosity = .performance
|
||||||
|
|
||||||
// Use a "working" test configuration
|
if let profile = CommandLine.arguments.first(where: { $0.matches(pattern: "--configuration:*") }) {
|
||||||
TestableConfigurations.working.apply()
|
Self.initializeTestingProfile(profile.replacingOccurrences(of: "--configuration:", with: ""))
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if CommandLine.arguments.contains("--v") {
|
if CommandLine.arguments.contains("--v") {
|
||||||
@ -86,6 +87,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
|||||||
self.phpEnvironment = PhpEnv.shared
|
self.phpEnvironment = PhpEnv.shared
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static func initializeTestingProfile(_ profile: String) {
|
||||||
|
Log.info("The profile `\(profile)` is being requested...")
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
|
|||||||
/**
|
/**
|
||||||
The status bar item with variable length.
|
The status bar item with variable length.
|
||||||
*/
|
*/
|
||||||
@MainActor let statusItem = NSStatusBar.system.statusItem(
|
let statusItem = NSStatusBar.system.statusItem(
|
||||||
withLength: NSStatusItem.variableLength
|
withLength: NSStatusItem.variableLength
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,10 +41,25 @@
|
|||||||
},
|
},
|
||||||
"testTargets" : [
|
"testTargets" : [
|
||||||
{
|
{
|
||||||
|
"parallelizable" : true,
|
||||||
"target" : {
|
"target" : {
|
||||||
"containerPath" : "container:PHP Monitor.xcodeproj",
|
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||||
"identifier" : "C4F7807825D7F84B000DBC97",
|
"identifier" : "C4F7807825D7F84B000DBC97",
|
||||||
"name" : "phpmon-tests"
|
"name" : "Unit Tests"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"target" : {
|
||||||
|
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||||
|
"identifier" : "C471E7AC28F9B4940021E251",
|
||||||
|
"name" : "Feature Tests"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"target" : {
|
||||||
|
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||||
|
"identifier" : "C471E7BB28F9B90F0021E251",
|
||||||
|
"name" : "UI Tests"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
11
tests/feature/EmptyTest.swift
Normal file
11
tests/feature/EmptyTest.swift
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
//
|
||||||
|
// Feature_Tests.swift
|
||||||
|
// Feature Tests
|
||||||
|
//
|
||||||
|
// Created by Nico Verbruggen on 14/10/2022.
|
||||||
|
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
final class Feature_Tests: XCTestCase {}
|
35
tests/ui/UI_Tests.swift
Normal file
35
tests/ui/UI_Tests.swift
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
//
|
||||||
|
// UI_Tests.swift
|
||||||
|
// UI Tests
|
||||||
|
//
|
||||||
|
// Created by Nico Verbruggen on 14/10/2022.
|
||||||
|
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
final class UI_Tests: XCTestCase {
|
||||||
|
|
||||||
|
override func setUpWithError() throws {
|
||||||
|
continueAfterFailure = false
|
||||||
|
TestableConfigurations.broken.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
override func tearDownWithError() throws {
|
||||||
|
}
|
||||||
|
|
||||||
|
func testExample() throws {
|
||||||
|
// UI tests must launch the application that they test.
|
||||||
|
let app = XCUIApplication()
|
||||||
|
app.launchArguments = ["--configuration:broken"]
|
||||||
|
app.launch()
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
func testLaunchPerformance() throws {
|
||||||
|
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||||
|
XCUIApplication().launch()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
Reference in New Issue
Block a user