Add build-and-test suite (in-app self-test + publish gate); fix release-zip missing sounds
The test suite, modelled on Andre's Sensor Readout (an in-app self-test + a build script), runnable as one step before every publish. Part 1 - in-app multi-step self-test (SelfTest.cs), run by --selftest: audio round-trip (PCM + Opus over localhost, dedicated test port so it never clashes with a running instance), encryption right/wrong-password + fingerprint, packet framing + malformed rejection, client<->server wire-format compatibility, settings save/reload, profile save/reload (temp folder), diagnostics-report privacy (never leaks a password), and bundled-resources present. Each step is timed and reported PASS/FAIL/SKIP; exit 0 only if nothing failed. Replaces the old single-shot --selftest. RunDiagnostics refactored to expose BuildDiagnosticsReport(AppConfig) for the privacy step. Part 2 - run-tests.ps1: builds, then checks the package (sounds, readme, native opus, framework-dependent, dll version == csproj), the About-box changelog, the client/server wire contract (relay magic/version/port still match RemPacket), the CLI surface, and runs --selftest. build-release.ps1 now runs this gate first and aborts the release if it fails. Bug caught + fixed: the published release zip carried ZERO cue sounds (startup sound + connect/disconnect/etc.) - MSBuild's incremental Content-copy marker skipped sounds\ on a fresh publish. Added an AfterTargets=Publish copy in the csproj that lands every cue WAV in the published sounds\ folder regardless of the marker. Verified: a staging publish now contains all 9 cue WAVs. Manual/help: --selftest description updated (readme.html + MANUAL.md). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
05b218825d
commit
141c5e8ce1
@@ -100,6 +100,24 @@ if (Test-Path $syncScript) {
|
||||
Write-Host "Note: sync-manual.py not found - skipping MANUAL.md sync." -ForegroundColor DarkGray
|
||||
}
|
||||
|
||||
# Gate: build RemSound and run the full test suite (run-tests.ps1) before packaging anything. A
|
||||
# failing gate means no release - these are the same checks that would have caught the v3.9
|
||||
# missing-cue-sounds bug. run-tests publishes and tests its OWN throwaway copy, so it never runs
|
||||
# the app against (and never pollutes) the clean staging folder built below.
|
||||
$gate = Join-Path $repo 'run-tests.ps1'
|
||||
if (Test-Path $gate) {
|
||||
Write-Host ""
|
||||
Write-Host "Running the build-and-test gate (run-tests.ps1)..." -ForegroundColor Cyan
|
||||
& $gate
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host ""
|
||||
Write-Host "RELEASE ABORTED - the build-and-test gate failed. Fix the failures above and re-run." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Host "WARNING: run-tests.ps1 not found - packaging WITHOUT the test gate." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Anything matching these must NEVER appear in a release. Folders by name; files by
|
||||
# extension / exact name. RemSound.deps.json and RemSound.runtimeconfig.json are
|
||||
# legitimate app files and are deliberately NOT matched (different names).
|
||||
|
||||
Reference in New Issue
Block a user