feat: add comprehensive end-to-end test suite
This commit is contained in:
committed by
Loic Coenen (aider)
parent
af7588b832
commit
18eb27e9c8
29
e2e/test_status_fifo_level.ts
Normal file
29
e2e/test_status_fifo_level.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { setupTest, startEngine, openCmdFifo, wait, ensureGenTone, execSync, readStatusNonBlock, teardownTest } from './test_utils';
|
||||
import * as globals from "./test_globals";
|
||||
|
||||
export async function testStatusFifoLevelLine(): Promise<void> {
|
||||
console.log("\nTest: STATUS FIFO LEVEL LINE AFTER TONE");
|
||||
const engine = await startEngine();
|
||||
openCmdFifo();
|
||||
await wait(500);
|
||||
|
||||
// Play tone directly (not through TUI)
|
||||
ensureGenTone();
|
||||
execSync(`${globals.GEN_TONE_BIN} 1.0 "looper:ch0in"`, { timeout: 5000 });
|
||||
|
||||
// Wait for engine to write status
|
||||
await wait(2000);
|
||||
|
||||
// Read status FIFO directly
|
||||
const data = readStatusNonBlock();
|
||||
const hasLevel = data.includes("LEVEL=");
|
||||
console.log(" Status FIFO data:", data.slice(0, 500));
|
||||
if (hasLevel) {
|
||||
console.log(" PASS: LEVEL line found in status FIFO");
|
||||
} else {
|
||||
console.log(" FAIL: No LEVEL line in status FIFO. Check engine RMS computation.");
|
||||
engine.kill(); teardownTest();
|
||||
throw new Error("Level line missing from status FIFO");
|
||||
}
|
||||
engine.kill(); teardownTest();
|
||||
}
|
||||
Reference in New Issue
Block a user