Testing Plugins

From MOD Wiki
Revision as of 13:15, 3 September 2018 by Jkbd (talk | contribs) (How to validate you plugin data.)
Jump to navigation Jump to search

WARNING: This page is currently being written, please check in later!

Error checking

Using SDK, needs py3lilv out of scope of this, see lilvlib for debian and osx

Plugin Data Validation

With RDF data it is possible to check the syntax and semantics. Syntax means, for example, you have not written a comma where ought to be a semicolon. Valid semantic means, for example, there is no AudioPort which is InputPort and OutputPort at the same time.

Preparation

Assuming you have installed sord_validate with your system package manager. On Arch Linux the package is called lv2.

We clone the upstream LV2 repository:

$ cd ~/Downloads
$ git clone http://lv2plug.in/git/cgit.cgi/lv2.git/
$ cd lv2

The reason is linux distribution are probably not up to date. We don't want to waste time with errors that are fixed upstream!

First let's check the release itself is not broken. The following should give no errors:

$ sord_validate $(find . -name '*.ttl')
Found 0 errors among 88 files (checked 1834 restrictions)

Second we need to have the definitions of the MOD extentions (which are documented at [1] and [2]).

$ cd ~/Downloads
$ mkdir ns-mod-ttl
$ cd ns-mod-ttl
$ wget http://moddevices.com/ns/mod/mod.doap.ttl
$ wget http://moddevices.com/ns/mod/mod.ttl
$ wget http://moddevices.com/ns/modgui/modgui.ttl
$ wget http://moddevices.com/ns/modgui/modgui.doap.ttl

Let's also check if the set union of the two is still valid:

$ sord_validate $(find ~/Downloads/lv2/ -name '*.ttl') $(find ~/Downloads/ns-mod-ttl/ -name '*.ttl')
Found 0 errors among 92 files (checked 1889 restrictions)

Now we are prepared.

Validate Your Plugin

What sord_validate does is, reading in the whole world of triples and proving that there are no conflicts with the rules. The rules are stated in the definitions you downloaded above.

If you can list your created Turtle files like this

$ find ~/.lv2/mybundle.lv2 -name '*.ttl'
/home/username/.lv2/mybundle.lv2/manifest.ttl
/home/username/.lv2/mybundle.lv2/seealso.ttl
...

then you can validate them by adding this command in the back:

$ sord_validate $(find ~/Downloads/lv2/ -name '*.ttl') $(find ~/Downloads/ns-mod-ttl/ -name '*.ttl') $(find ~/.lv2/mybundle.lv2 -name '*.ttl')

The result should be 0 errors. That's it.

Stress tests

lv2bm the other inf,denormal tool

Does it load on MOD?

mod-host trick