Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ clean:

# the daemon against workers that are not plugin hosts at all (tests/fake-host speaks the same protocol and can be
# made to die on cue): placement, forwarding, ledger, replay, attribution, the storm bound; no jack, no plugin
test: test-protocol-lib test-sabotage-pool test-pin test-history test-proc test-own-host-probe-teardown test-planner test-transforms test-format-coverage test-describe test-relay test-alloc test-format test-daemon test-verbs-declared check-rendered check-generated check-schema test-probe-schema test-vocabulary test-probe test-contract test-consumer test-perturbation check-readme check-own-host-page check-no-pins check-ci-guards test-mod-host-json test-socket check-verb-table check-preset-schema test-install-schemas
test: test-protocol-lib test-sabotage-pool test-pin test-history test-proc test-own-host-probe-teardown test-planner test-transforms test-format-coverage test-describe test-relay test-alloc test-format test-daemon test-verbs-declared check-rendered check-generated check-schema test-probe-schema test-vocabulary test-probe test-contract test-consumer test-perturbation check-readme check-own-host-page check-no-pins check-ci-guards test-mod-host-json test-socket check-verb-table check-preset-schema test-install-schemas check-readme-facts
MOD_HOST_DIR=$(MOD_HOST_DIR) python3 tests/verbs_contract.py

# the protocol clients plugin-hostd-tests ships (tests/lib/), against a peer that frames by NUL, and their sabotage
Expand Down Expand Up @@ -470,6 +470,10 @@ check-generated: $(GEN)
check-readme:
python3 tests/readme_build.py

# the prose beside the generated protocol tables: still the daemon's and its workers' verified behavior today
check-readme-facts:
python3 tests/readme_facts.py

# the own-host page: its commands are few, and the reader that CI runs them with stops on any wrong reply
check-own-host-page:
python3 tests/own_host_page.py selftest
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ Verbs a worker answers, by instance

What a host knows of a strip and of a plugin's controls. For a CLAP instance the daemon routes them like mod-host's
instance verbs and passes the worker's reply through; the worker answers them from the plugin (`clap.track-info`,
`clap.remote-controls`, `clap.params`), except `param_info`: omx-clap-host 0.8.0 answers it `-511` for every parameter
(and `-103` for a symbol that is no parameter), because it holds no checked unit and scale for any of them. `-511` is
the stable answer to read as "no contract; fall back to the layout from `omx-clap-scan`"; the daemon passes it through
`clap.remote-controls`, `clap.params`), except `param_info`: omx-clap-host answers it from the param contract (`org.openmixer.param-contract/1`), and
`-511` for a parameter the worker holds no checked contract for (and `-103` for a symbol that is no parameter). `-511`
is the stable answer to read as "no contract; fall back to the layout from `omx-clap-scan`"; the daemon passes it through
and drops nothing. For an LV2 instance the daemon answers them itself, never forwarding them, so
mod-host learns none of them: `track_info` is kept and answered `resp 0`, an LV2 plugin has no remote pages, and
`param_info` answers `-511` until the daemon reads the bundle's port data. When a CLAP plugin changes its pages, its
Expand All @@ -255,7 +255,7 @@ played through its jack MIDI input with `connect`. omx-clap-host does not answer

`preset_list` and `preset_get` list a plugin's presets the way `remote_pages` and `remote_page_get` list its pages; the
key `preset_get` gives is the one `preset_load` takes. mod-host cannot list presets, so for an LV2 instance on mod-host
the daemon answers both `-515`. omx-clap-host does not list them yet (FreeMixer/omx-clap-core#95).
the daemon answers both `-515`. omx-clap-host lists them with `preset_list` and `preset_get`.

A plugin with a window or a surface of its own tells its host when the user takes hold of one of its knobs and lets go,
moves values by itself, and suggests a remote page. Its worker writes `param_gesture`, mod-host's `param_set` and
Expand Down
46 changes: 46 additions & 0 deletions tests/readme_facts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# The prose next to the generated protocol tables states only verified facts about what the daemon and its workers
# answer today. This checks the CLAP param_info sentence and the preset sentence: a stale version number, or the old "-511 for every
# parameter" claim, means the text has drifted from src/lv2.c and omx-clap-core's contract-based answer again.
import os, re, sys

ROOT = sys.argv[1] if len(sys.argv) > 1 else os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


def main():
readme = open(os.path.join(ROOT, "README.md")).read()
failed = 0

if re.search(r"omx-clap-host 0\.8\.0 answers it `-511` for every parameter", readme):
print("FAIL README.md still claims omx-clap-host 0.8.0 answers param_info -511 for every parameter "
"(it answers from org.openmixer.param-contract/1)")
failed += 1

if "org.openmixer.param-contract/1" not in readme:
print("FAIL README.md does not say param_info answers from org.openmixer.param-contract/1")
failed += 1

if not re.search(r"`-511` for a parameter the worker holds no checked contract for", readme):
print("FAIL README.md does not say -511 is only for a parameter with no checked contract")
failed += 1

if "omx-clap-host does not list them yet" in readme:
print("FAIL README.md still claims omx-clap-host does not list presets (preset_list and preset_get list them)")
failed += 1

if "omx-clap-host lists them with `preset_list` and `preset_get`" not in readme:
print("FAIL README.md does not say omx-clap-host lists presets with preset_list and preset_get")
failed += 1

# the LV2 sentence stays until #152: the daemon still answers -511 for every LV2 parameter
if "param_info` answers `-511` until the daemon reads the bundle's port data" not in readme:
print("FAIL README.md must still say LV2 param_info answers -511 until the daemon reads the bundle's port "
"data (true while #152 is open)")
failed += 1

if not failed:
print("ok README.md's CLAP param_info sentence matches org.openmixer.param-contract/1, the LV2 one unchanged")
return 1 if failed else 0


sys.exit(main())
Loading