1.0.0 release

This commit is contained in:
2026-06-01 18:27:40 -07:00
parent b1ab0f102c
commit 1f20fcab20
1151 changed files with 230703 additions and 14 deletions
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTD/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kind</key>
<string>Xcode.IDEKit.TextSubstitutionFileTemplateKind</string>
<key>Platforms</key>
<array>
<string>com.apple.platform.macosx</string>
<string>com.apple.platform.iphoneos</string>
</array>
<key>Description</key>
<string>A Swift Testing @Suite that exercises a Generator across an engine block. Uses makeTestEngine / makeSynthGraph / advanceBlock helpers (live in Tests/LyrebirdTests/TestHelpers.swift). Includes finite-output + reset-state starter tests.</string>
<key>Summary</key>
<string>Lyrebird Generator Test Suite (@Suite + @Test)</string>
<key>SortOrder</key>
<string>24</string>
<key>AllowedTypes</key>
<array>
<string>public.swift-source</string>
</array>
<key>DefaultCompletionName</key>
<string>MyGeneratorTests</string>
<key>MainTemplateFile</key>
<string>___FILEBASENAME___.swift</string>
<key>Options</key>
<array>
<dict>
<key>Identifier</key>
<string>productName</string>
<key>Required</key>
<true/>
<key>Name</key>
<string>Test suite name:</string>
<key>Description</key>
<string>Name of the test suite type (also used as the file name). Convention: &lt;Type&gt;Tests.</string>
<key>Type</key>
<string>text</string>
<key>Default</key>
<string>MyGeneratorTests</string>
</dict>
</array>
</dict>
</plist>
@@ -0,0 +1,55 @@
//___FILEHEADER___
import Testing
@testable @_spi(LyrebirdExtensions) import LyrebirdSynth
// MARK: - ___FILEBASENAMEASIDENTIFIER___
/// Test suite for ___FILEBASENAMEASIDENTIFIER___'s subject Generator.
///
/// Add @Test methods for: parameter ranges, edge cases (zero / negative freq,
/// out-of-range mul/add, exhausted state, reset), block-size correctness,
/// channel-count claims (`outputChannelCount`), and any RT-safety invariants.
///
/// `makeTestEngine`, `makeSynthGraph`, and `advanceBlock` live in
/// `Tests/LyrebirdTests/TestHelpers.swift` and are intentionally module-internal
/// — this file only compiles when dropped under `Tests/LyrebirdTests/`.
@Suite("___FILEBASENAMEASIDENTIFIER___")
struct ___FILEBASENAMEASIDENTIFIER___ {
/// Subject under test produces finite output for a single block.
@Test func outputIsFinite() throws {
let engine = makeTestEngine(blockSize: 64)
try engine.start()
defer { engine.stop() }
// Replace OscSin.Audio with the Generator you are testing.
let gen = OscSin.Audio(freq: 440.0)
let g = makeSynthGraph(engine: engine)
let out = gen.calculatedSamples(graph: g, count: 64)
let samples = Array((out.first ?? []).prefix(64))
#expect(samples.count == 64)
#expect(samples.allSatisfy { $0.isFinite })
}
/// Subject under test advances state across blocks — output of block 2
/// differs from output of block 1 for a non-DC signal.
@Test func stateAdvancesAcrossBlocks() throws {
let engine = makeTestEngine(blockSize: 64)
try engine.start()
defer { engine.stop() }
let gen = OscSin.Audio(freq: 440.0)
let g1 = makeSynthGraph(engine: engine)
let block1 = Array((gen.calculatedSamples(graph: g1, count: 64).first ?? []).prefix(64))
advanceBlock(engine)
let g2 = makeSynthGraph(engine: engine)
let block2 = Array((gen.calculatedSamples(graph: g2, count: 64).first ?? []).prefix(64))
#expect(block1 != block2, "Generator should advance state between blocks")
}
}