summaryrefslogtreecommitdiff
path: root/tests/internals/pluginfactory
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-11 17:27:14 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-16 18:35:21 -0500
commit99ea157ae4d22220ff3c529e12c19fe47369c4df (patch)
tree486bb971f3e4d59d9b9848e195c7bc9f10d4532d /tests/internals/pluginfactory
parent3324490e0669ba15a8b1d54051ff4b387e28b27a (diff)
downloadbuildstream-99ea157ae4d22220ff3c529e12c19fe47369c4df.tar.gz
tests: Migrate plugin factory test to internals directory
Diffstat (limited to 'tests/internals/pluginfactory')
-rw-r--r--tests/internals/pluginfactory/anotherelement/__init__.py0
-rw-r--r--tests/internals/pluginfactory/anotherelement/foo.py9
-rw-r--r--tests/internals/pluginfactory/anothersource/__init__.py0
-rw-r--r--tests/internals/pluginfactory/anothersource/foo.py9
-rw-r--r--tests/internals/pluginfactory/badsetup/__init__.py0
-rw-r--r--tests/internals/pluginfactory/badsetup/foo.py6
-rw-r--r--tests/internals/pluginfactory/badversionelement/__init__.py0
-rw-r--r--tests/internals/pluginfactory/badversionelement/foo.py11
-rw-r--r--tests/internals/pluginfactory/badversionsource/__init__.py0
-rw-r--r--tests/internals/pluginfactory/badversionsource/foo.py11
-rw-r--r--tests/internals/pluginfactory/customelement/__init__.py0
-rw-r--r--tests/internals/pluginfactory/customelement/foo.py9
-rw-r--r--tests/internals/pluginfactory/customsource/__init__.py0
-rw-r--r--tests/internals/pluginfactory/customsource/foo.py9
-rw-r--r--tests/internals/pluginfactory/nosetup/__init__.py0
-rw-r--r--tests/internals/pluginfactory/nosetup/foo.py8
-rw-r--r--tests/internals/pluginfactory/notatype/__init__.py0
-rw-r--r--tests/internals/pluginfactory/notatype/foo.py6
-rw-r--r--tests/internals/pluginfactory/wrongtype/__init__.py0
-rw-r--r--tests/internals/pluginfactory/wrongtype/foo.py12
20 files changed, 90 insertions, 0 deletions
diff --git a/tests/internals/pluginfactory/anotherelement/__init__.py b/tests/internals/pluginfactory/anotherelement/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/anotherelement/__init__.py
diff --git a/tests/internals/pluginfactory/anotherelement/foo.py b/tests/internals/pluginfactory/anotherelement/foo.py
new file mode 100644
index 000000000..2e067a94f
--- /dev/null
+++ b/tests/internals/pluginfactory/anotherelement/foo.py
@@ -0,0 +1,9 @@
+from buildstream import Element
+
+
+class AnotherFooElement(Element):
+ pass
+
+
+def setup():
+ return AnotherFooElement
diff --git a/tests/internals/pluginfactory/anothersource/__init__.py b/tests/internals/pluginfactory/anothersource/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/anothersource/__init__.py
diff --git a/tests/internals/pluginfactory/anothersource/foo.py b/tests/internals/pluginfactory/anothersource/foo.py
new file mode 100644
index 000000000..4675b965f
--- /dev/null
+++ b/tests/internals/pluginfactory/anothersource/foo.py
@@ -0,0 +1,9 @@
+from buildstream import Source
+
+
+class AnotherFooSource(Source):
+ pass
+
+
+def setup():
+ return AnotherFooSource
diff --git a/tests/internals/pluginfactory/badsetup/__init__.py b/tests/internals/pluginfactory/badsetup/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/badsetup/__init__.py
diff --git a/tests/internals/pluginfactory/badsetup/foo.py b/tests/internals/pluginfactory/badsetup/foo.py
new file mode 100644
index 000000000..145f2577b
--- /dev/null
+++ b/tests/internals/pluginfactory/badsetup/foo.py
@@ -0,0 +1,6 @@
+# A plugin is supposed to define a setup function
+# which returns the type that the plugin provides
+#
+# This plugin provides a setup() symbol that is
+# not even a function
+setup = 5
diff --git a/tests/internals/pluginfactory/badversionelement/__init__.py b/tests/internals/pluginfactory/badversionelement/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/badversionelement/__init__.py
diff --git a/tests/internals/pluginfactory/badversionelement/foo.py b/tests/internals/pluginfactory/badversionelement/foo.py
new file mode 100644
index 000000000..2a8b12abe
--- /dev/null
+++ b/tests/internals/pluginfactory/badversionelement/foo.py
@@ -0,0 +1,11 @@
+from buildstream import Element
+
+
+class FooElement(Element):
+
+ # We have a little while until we have to manually modify this
+ BST_REQUIRED_VERSION_MAJOR = 5000
+
+
+def setup():
+ return FooElement
diff --git a/tests/internals/pluginfactory/badversionsource/__init__.py b/tests/internals/pluginfactory/badversionsource/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/badversionsource/__init__.py
diff --git a/tests/internals/pluginfactory/badversionsource/foo.py b/tests/internals/pluginfactory/badversionsource/foo.py
new file mode 100644
index 000000000..23333a9d8
--- /dev/null
+++ b/tests/internals/pluginfactory/badversionsource/foo.py
@@ -0,0 +1,11 @@
+from buildstream import Source
+
+
+class FooSource(Source):
+
+ # We have a little while until we have to manually modify this
+ BST_REQUIRED_VERSION_MAJOR = 5000
+
+
+def setup():
+ return FooSource
diff --git a/tests/internals/pluginfactory/customelement/__init__.py b/tests/internals/pluginfactory/customelement/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/customelement/__init__.py
diff --git a/tests/internals/pluginfactory/customelement/foo.py b/tests/internals/pluginfactory/customelement/foo.py
new file mode 100644
index 000000000..260de8b27
--- /dev/null
+++ b/tests/internals/pluginfactory/customelement/foo.py
@@ -0,0 +1,9 @@
+from buildstream import Element
+
+
+class FooElement(Element):
+ pass
+
+
+def setup():
+ return FooElement
diff --git a/tests/internals/pluginfactory/customsource/__init__.py b/tests/internals/pluginfactory/customsource/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/customsource/__init__.py
diff --git a/tests/internals/pluginfactory/customsource/foo.py b/tests/internals/pluginfactory/customsource/foo.py
new file mode 100644
index 000000000..de78a00ce
--- /dev/null
+++ b/tests/internals/pluginfactory/customsource/foo.py
@@ -0,0 +1,9 @@
+from buildstream import Source
+
+
+class FooSource(Source):
+ pass
+
+
+def setup():
+ return FooSource
diff --git a/tests/internals/pluginfactory/nosetup/__init__.py b/tests/internals/pluginfactory/nosetup/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/nosetup/__init__.py
diff --git a/tests/internals/pluginfactory/nosetup/foo.py b/tests/internals/pluginfactory/nosetup/foo.py
new file mode 100644
index 000000000..0b5a4fa7e
--- /dev/null
+++ b/tests/internals/pluginfactory/nosetup/foo.py
@@ -0,0 +1,8 @@
+# A plugin is supposed to define a setup function
+# which returns the type that the plugin provides
+#
+# This plugin fails to do so
+
+
+def useless():
+ print("Hello World")
diff --git a/tests/internals/pluginfactory/notatype/__init__.py b/tests/internals/pluginfactory/notatype/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/notatype/__init__.py
diff --git a/tests/internals/pluginfactory/notatype/foo.py b/tests/internals/pluginfactory/notatype/foo.py
new file mode 100644
index 000000000..311a4fb32
--- /dev/null
+++ b/tests/internals/pluginfactory/notatype/foo.py
@@ -0,0 +1,6 @@
+# Plugins are supposed to return a subclass type
+# of Source or Element, depending on plugin type.
+
+
+def setup():
+ return 5
diff --git a/tests/internals/pluginfactory/wrongtype/__init__.py b/tests/internals/pluginfactory/wrongtype/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/internals/pluginfactory/wrongtype/__init__.py
diff --git a/tests/internals/pluginfactory/wrongtype/foo.py b/tests/internals/pluginfactory/wrongtype/foo.py
new file mode 100644
index 000000000..3fe9a1a62
--- /dev/null
+++ b/tests/internals/pluginfactory/wrongtype/foo.py
@@ -0,0 +1,12 @@
+# Plugins are supposed to return a subclass type
+# of Source or Element, depending on plugin type.
+#
+# This one fails the requirement
+
+
+class Foo():
+ pass
+
+
+def setup():
+ return Foo