aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-04-26 15:19:56 +0200
committerDavid Robillard <d@drobilla.net>2020-04-26 15:19:56 +0200
commit3f6602ff5569b8c7ff8521c34992d99030a1bb8d (patch)
tree3761c0d524347b8f95bc75ae824234e9dde6871d
parentbd6a2fd6a7cca2655df9e3ade341ae5fc4e11805 (diff)
downloadlv2-3f6602ff5569b8c7ff8521c34992d99030a1bb8d.tar.xz
Add tests for specification manifests
-rw-r--r--wscript27
1 files changed, 27 insertions, 0 deletions
diff --git a/wscript b/wscript
index 9cc1c14..7d4fd15 100644
--- a/wscript
+++ b/wscript
@@ -471,6 +471,10 @@ def test_vocabularies(check, specs, files):
rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#')
+ # Check if this is a stable LV2 release to enable additional tests
+ version_tuple = tuple(map(int, VERSION.split(".")))
+ is_stable = version_tuple[1] % 2 == 0 and version_tuple[2] % 2 == 0
+
# Check that extended documentation is not in main specification file
for spec in specs:
path = str(spec.abspath())
@@ -490,6 +494,29 @@ def test_vocabularies(check, specs, files):
check(lambda: not has_statement(None, lv2.documentation, None),
name = name + ".ttl does not contain lv2:documentation")
+ # Check specification manifests
+ for spec in specs:
+ path = str(spec.abspath())
+ manifest_path = os.path.join(path, 'manifest.ttl')
+ manifest_model = rdflib.ConjunctiveGraph()
+ manifest_model.parse(manifest_path, format='n3')
+
+ uri = manifest_model.value(None, rdf.type, lv2.Specification)
+ minor = manifest_model.value(uri, lv2.minorVersion, None)
+ micro = manifest_model.value(uri, lv2.microVersion, None)
+ check(lambda: uri is not None,
+ name = manifest_path + " has a lv2:Specification")
+ check(lambda: minor is not None,
+ name = manifest_path + " has a lv2:minorVersion")
+ check(lambda: micro is not None,
+ name = manifest_path + " has a lv2:microVersion")
+
+ if is_stable:
+ check(lambda: int(minor) > 0,
+ name = manifest_path + " has even non-zero minor version")
+ check(lambda: int(micro) % 2 == 0,
+ name = manifest_path + " has even micro version")
+
# Load everything into one big model
model = rdflib.ConjunctiveGraph()
for f in files: