Also fixes unit test infrastructure: create shared scheme including MusicTests, fix TEST_HOST path (Mumu.app), add PRODUCT_MODULE_NAME=Music, add get-task-allow entitlement, and skip NSOpenPanel in test runs.feat/music-streaming
parent
7024be1cba
commit
124a48a07c
@ -0,0 +1,128 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<Scheme |
||||||
|
LastUpgradeVersion = "1600" |
||||||
|
version = "1.7"> |
||||||
|
<BuildAction |
||||||
|
parallelizeBuildables = "YES" |
||||||
|
buildImplicitDependencies = "YES"> |
||||||
|
<BuildActionEntries> |
||||||
|
<BuildActionEntry |
||||||
|
buildForTesting = "YES" |
||||||
|
buildForRunning = "YES" |
||||||
|
buildForProfiling = "YES" |
||||||
|
buildForArchiving = "YES" |
||||||
|
buildForAnalyzing = "YES"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2C8C2FC2448700F95A24" |
||||||
|
BuildableName = "Mumu.app" |
||||||
|
BlueprintName = "Music" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildActionEntry> |
||||||
|
<BuildActionEntry |
||||||
|
buildForTesting = "YES" |
||||||
|
buildForRunning = "NO" |
||||||
|
buildForProfiling = "NO" |
||||||
|
buildForArchiving = "NO" |
||||||
|
buildForAnalyzing = "NO"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2C992FC2448800F95A24" |
||||||
|
BuildableName = "MusicTests.xctest" |
||||||
|
BlueprintName = "MusicTests" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildActionEntry> |
||||||
|
<BuildActionEntry |
||||||
|
buildForTesting = "YES" |
||||||
|
buildForRunning = "NO" |
||||||
|
buildForProfiling = "NO" |
||||||
|
buildForArchiving = "NO" |
||||||
|
buildForAnalyzing = "NO"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2CA32FC2448800F95A24" |
||||||
|
BuildableName = "MusicUITests.xctest" |
||||||
|
BlueprintName = "MusicUITests" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildActionEntry> |
||||||
|
</BuildActionEntries> |
||||||
|
</BuildAction> |
||||||
|
<TestAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"> |
||||||
|
<Testables> |
||||||
|
<TestableReference |
||||||
|
skipped = "NO" |
||||||
|
parallelizable = "NO"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2C992FC2448800F95A24" |
||||||
|
BuildableName = "MusicTests.xctest" |
||||||
|
BlueprintName = "MusicTests" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</TestableReference> |
||||||
|
<TestableReference |
||||||
|
skipped = "NO" |
||||||
|
parallelizable = "NO"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2CA32FC2448800F95A24" |
||||||
|
BuildableName = "MusicUITests.xctest" |
||||||
|
BlueprintName = "MusicUITests" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</TestableReference> |
||||||
|
</Testables> |
||||||
|
</TestAction> |
||||||
|
<LaunchAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
launchStyle = "0" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
ignoresPersistentStateOnLaunch = "NO" |
||||||
|
debugDocumentVersioning = "YES" |
||||||
|
debugServiceExtension = "internal" |
||||||
|
allowLocationSimulation = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2C8C2FC2448700F95A24" |
||||||
|
BuildableName = "Mumu.app" |
||||||
|
BlueprintName = "Music" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
</LaunchAction> |
||||||
|
<ProfileAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES" |
||||||
|
savedToolIdentifier = "" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
debugDocumentVersioning = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "C46B2C8C2FC2448700F95A24" |
||||||
|
BuildableName = "Mumu.app" |
||||||
|
BlueprintName = "Music" |
||||||
|
ReferencedContainer = "container:Music.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
</ProfileAction> |
||||||
|
<AnalyzeAction |
||||||
|
buildConfiguration = "Debug"> |
||||||
|
</AnalyzeAction> |
||||||
|
<ArchiveAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
revealArchiveInOrganizer = "YES"> |
||||||
|
</ArchiveAction> |
||||||
|
</Scheme> |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
import Foundation |
||||||
|
import GRDB |
||||||
|
|
||||||
|
nonisolated struct SmartPlaylist: Codable, Identifiable, Equatable, Hashable, Sendable { |
||||||
|
var id: Int64? |
||||||
|
var name: String |
||||||
|
var searchQuery: String |
||||||
|
var createdAt: Date |
||||||
|
} |
||||||
|
|
||||||
|
nonisolated extension SmartPlaylist: FetchableRecord, MutablePersistableRecord { |
||||||
|
static let databaseTableName = "smart_playlists" |
||||||
|
|
||||||
|
mutating func didInsert(_ inserted: InsertionSuccess) { |
||||||
|
id = inserted.rowID |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
extension SmartPlaylist: PlaylistRepresentable { |
||||||
|
var isSmartPlaylist: Bool { true } |
||||||
|
} |
||||||
|
|
||||||
|
#if DEBUG |
||||||
|
extension SmartPlaylist { |
||||||
|
static func fixture( |
||||||
|
id: Int64? = nil, |
||||||
|
name: String = "Test Smart Playlist", |
||||||
|
searchQuery: String = "test query", |
||||||
|
createdAt: Date = Date() |
||||||
|
) -> SmartPlaylist { |
||||||
|
SmartPlaylist(id: id, name: name, searchQuery: searchQuery, createdAt: createdAt) |
||||||
|
} |
||||||
|
} |
||||||
|
#endif |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
import Foundation |
||||||
|
import Testing |
||||||
|
@testable import Music |
||||||
|
|
||||||
|
struct SmartPlaylistTests { |
||||||
|
// Creates a SmartPlaylist in memory and verifies its properties. |
||||||
|
@Test func smartPlaylistProperties() throws { |
||||||
|
let sp = SmartPlaylist( |
||||||
|
id: nil, |
||||||
|
name: "Miles Davis", |
||||||
|
searchQuery: "miles davis", |
||||||
|
createdAt: Date() |
||||||
|
) |
||||||
|
#expect(sp.name == "Miles Davis") |
||||||
|
#expect(sp.searchQuery == "miles davis") |
||||||
|
#expect(sp.isSmartPlaylist == true) |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue