summaryrefslogtreecommitdiff
path: root/tests/format
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2020-04-28 19:23:31 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2020-04-29 16:24:59 +0900
commita311a14f4b0a649b5f872ab020885b0a1d6e09d1 (patch)
treec94ddb9ff24108b72d4e0c2e8902bf24d6702b95 /tests/format
parentb3556a3284708b904f20586d4636c31a91106809 (diff)
downloadbuildstream-a311a14f4b0a649b5f872ab020885b0a1d6e09d1.tar.gz
plugin.py/pluginfactory.py: Implementing BST_MIN_VERSION
The BST_MIN_VERSION guards assert that the BuildStream core which loaded the plugin is compatible with the plugin itself. This commit adds BST_MIN_VERSION to the base plugin.py with documentation informing Plugin authors how to set the minimum version, and also adds the assertions at plugin loading time in pluginfactory.py. This commit also: * Adds the BST_MIN_VERSION specification to all current core plugins * Adds the BST_MIN_VERSION specification to plugins used in test cases
Diffstat (limited to 'tests/format')
-rw-r--r--tests/format/project/plugin-allowed/plugins/foo.py3
-rw-r--r--tests/format/project/plugin-forbidden/forbidden-plugins/forbidden-plugin.py3
-rw-r--r--tests/format/project/plugin-no-load-ref/plugins/noloadref.py3
-rw-r--r--tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py3
4 files changed, 12 insertions, 0 deletions
diff --git a/tests/format/project/plugin-allowed/plugins/foo.py b/tests/format/project/plugin-allowed/plugins/foo.py
index bf884233c..76d9bfd3c 100644
--- a/tests/format/project/plugin-allowed/plugins/foo.py
+++ b/tests/format/project/plugin-allowed/plugins/foo.py
@@ -2,6 +2,9 @@ from buildstream import Element
class FooElement(Element):
+
+ BST_MIN_VERSION = "2.0"
+
def configure(self, config):
pass
diff --git a/tests/format/project/plugin-forbidden/forbidden-plugins/forbidden-plugin.py b/tests/format/project/plugin-forbidden/forbidden-plugins/forbidden-plugin.py
index bf884233c..76d9bfd3c 100644
--- a/tests/format/project/plugin-forbidden/forbidden-plugins/forbidden-plugin.py
+++ b/tests/format/project/plugin-forbidden/forbidden-plugins/forbidden-plugin.py
@@ -2,6 +2,9 @@ from buildstream import Element
class FooElement(Element):
+
+ BST_MIN_VERSION = "2.0"
+
def configure(self, config):
pass
diff --git a/tests/format/project/plugin-no-load-ref/plugins/noloadref.py b/tests/format/project/plugin-no-load-ref/plugins/noloadref.py
index e2fe0ac46..2b8fd0b51 100644
--- a/tests/format/project/plugin-no-load-ref/plugins/noloadref.py
+++ b/tests/format/project/plugin-no-load-ref/plugins/noloadref.py
@@ -6,6 +6,9 @@ from buildstream import Source
# Use this to test that the core behaves as expected with such plugins.
#
class NoLoadRefSource(Source):
+
+ BST_MIN_VERSION = "2.0"
+
def configure(self, node):
pass
diff --git a/tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py b/tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py
index db2895f8b..a03cb64ee 100644
--- a/tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py
+++ b/tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py
@@ -2,6 +2,9 @@ from buildstream import Source, SourceError
class PreflightErrorSource(Source):
+
+ BST_MIN_VERSION = "2.0"
+
def configure(self, node):
pass