Difference between revisions of "Testing Plugins"
(How to validate you plugin data.) |
|||
Line 6: | Line 6: | ||
out of scope of this, see lilvlib for debian and osx | out of scope of this, see lilvlib for debian and osx | ||
− | == | + | == Plugin Data Validation == |
− | sord_validate | + | 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 <code>AudioPort</code> which is <code>InputPort</code> and <code>OutputPort</code> at the same time. | ||
+ | |||
+ | === Preparation === | ||
+ | |||
+ | Assuming you have installed <code>sord_validate</code> with your system package manager. On Arch Linux the package is called <code>lv2</code>. | ||
+ | |||
+ | We clone the upstream LV2 repository: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ cd ~/Downloads | ||
+ | $ git clone http://lv2plug.in/git/cgit.cgi/lv2.git/ | ||
+ | $ cd lv2 | ||
+ | </syntaxhighlight> | ||
+ | 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: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ sord_validate $(find . -name '*.ttl') | ||
+ | Found 0 errors among 88 files (checked 1834 restrictions) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Second we need to have the definitions of the MOD extentions (which are documented at [http://moddevices.com/ns/mod/] and [http://moddevices.com/ns/modgui/]). | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ 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 | ||
+ | </syntaxhighlight> | ||
+ | Let's also check if the set union of the two is still valid: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ sord_validate $(find ~/Downloads/lv2/ -name '*.ttl') $(find ~/Downloads/ns-mod-ttl/ -name '*.ttl') | ||
+ | Found 0 errors among 92 files (checked 1889 restrictions) | ||
+ | </syntaxhighlight> | ||
+ | Now we are prepared. | ||
+ | |||
+ | === Validate Your Plugin === | ||
+ | |||
+ | What <code>sord_validate</code> 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 | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ find ~/.lv2/mybundle.lv2 -name '*.ttl' | ||
+ | /home/username/.lv2/mybundle.lv2/manifest.ttl | ||
+ | /home/username/.lv2/mybundle.lv2/seealso.ttl | ||
+ | ... | ||
+ | </syntaxhighlight> | ||
+ | then you can validate them by adding this command in the back: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ sord_validate $(find ~/Downloads/lv2/ -name '*.ttl') $(find ~/Downloads/ns-mod-ttl/ -name '*.ttl') $(find ~/.lv2/mybundle.lv2 -name '*.ttl') | ||
+ | </syntaxhighlight> | ||
+ | The result should be 0 errors. That's it. | ||
== Stress tests == | == Stress tests == |
Revision as of 13:15, 3 September 2018
WARNING: This page is currently being written, please check in later!
Contents
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