Repository navigation
9.5: runtime tests for tap.python, in Max - #50
Merged
Merged
Conversation
Seven test patchers, generated by make_patchers.py with fixtures in runtime-tests/python/: - tap.python.load, the first patcher a fresh Max opens: Max finds the object through init/; with no argument default.py's bang outputs the gain; euclid's list, an @Attribute argument applied, scale's array as a list, note_name's two values right to left, the name as a symbol; - tap.python.outputs: every row of the output table, one method of maxtest_outputs each — what cannot be output (past 64 bits, a dict, a nested list) reported and nothing output; - tap.python.messages: an attribute set and read back, get<attr> from the dumpout, a method, the anything forwarder (int and symbol included), a class without anything not understanding; - tap.python.reload: a save that widens a tuple return hint adds an outlet before the dumpout, which takes a cord and carries its value while the others keep theirs; narrowing removes it with its cord; a broken save is reported once and outputs nothing until fixed; - tap.python.shared: one file for a tap.python~ and a tap.python, saved: both follow, and each kind says once what it owes (mode reserved by one, dumpout by the other); - tap.python.threads: a metro every 5 ms, every output checked against its input, on the main thread, the scheduler thread (Overdrive) and the audio thread (Scheduler in Audio Interrupt); Overdrive and Audio Interrupt put back as they were; - tap.python.faults: sys.exit() and an exception reported, the object still answering. The soak gains a tap.python answering a metro every 10 ms while its file is saved and reloaded every second: every output against its input, every message answered. run.py: Restore Windows on Launch off for the run and Max's crash-recovery workspaces aside, its preference files put back afterwards; tap.python.load opened first, so that init/ must find it; the package's init/ lines required before a run; a warning if anything touches tap.python's hand-written reference page. Checks are as [tosymbol] writes an output (Test.output_is()), held in a [zl.reg]: a missing output fails, as the harness records an assertion that never answers. All 21 runtime tests pass in Max 9.1.5 on macOS, the load test first; a one-minute soak passes with the new checks. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019rVV9SkjkWmiBXFMT4whkz
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019rVV9SkjkWmiBXFMT4whkz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan item 9.5 (docs/TAP-PYTHON-PLAN.md):
tap.pythontested in a real Max, through the max-test harness. The patchers are generated bymake_patchers.py, with the classes they load inruntime-tests/python/.The tests
tap.python.load: the first patcher a fresh Max opens, so Max has to find the object throughinit/. Checks:default.py's bang outputs the gain;@steps 5argument applies;tap.python.outputs: every row of the output table, one method ofmaxtest_outputseach. The values an outlet can't carry (past 64 bits, a dict, a nested list) are reported and nothing is output.tap.python.messages:get<attr>from the dumpout;anythingforwarder, includingintandsymbol;anythingsaying it doesn't understand.tap.python.reload:tap.python.shared: one file used by atap.python~and atap.python, then saved. Both objects follow the save, and each kind reports its own reserved name once:modefortap.python~,dumpoutfortap.python.tap.python.threads: ametroevery 5 ms, with every output checked against its input, on three threads:The test puts both settings back as they were.
tap.python.faults:sys.exit()and an exception are reported, and the object still answers.The soak gains a
tap.pythonanswering ametroevery 10 ms while its file is saved and reloaded every second. Every output is checked against its input, and every message must be answered.The runner
tap.python.loadalways opens first.init/check: the package'sinit/mapping lines are required before a run starts.tap.python's hand-written page.How outputs are checked
Test.output_is()turns the output into one symbol with[tosymbol]and holds it in a[zl.reg]. At check time a quoted[sel "…"]compares it.symbol Ckeeps the wordsymbol, and floats have four decimals (0.5000).Verified (macOS, Max 9.1.5)
tap.pythonanswered every message of a 10 ms metro correctly for the whole hour, while its file was saved and reloaded every second.🤖 Generated with Claude Code
https://claude.ai/code/session_019rVV9SkjkWmiBXFMT4whkz