summaryrefslogtreecommitdiff
path: root/tests/loader
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-08-10 08:06:06 +0200
committerJürg Billeter <j@bitron.ch>2017-08-10 08:06:06 +0200
commit8260d0f5086bce840b1cb52c1675ac6038dc7224 (patch)
treed3bbb9c2ff860c1422a2744c8c194911983e4b6b /tests/loader
parentdb49248dcc3480eb9f89cea84e6000cea763cbf2 (diff)
downloadbuildstream-8260d0f5086bce840b1cb52c1675ac6038dc7224.tar.gz
tests/loader: Test dependency type 'all'
Diffstat (limited to 'tests/loader')
-rw-r--r--tests/loader/dependencies.py17
-rw-r--r--tests/loader/dependencies/elements/alldep.bst5
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/loader/dependencies.py b/tests/loader/dependencies.py
index 058e46603..d4f9956c1 100644
--- a/tests/loader/dependencies.py
+++ b/tests/loader/dependencies.py
@@ -169,3 +169,20 @@ def test_build_runtime_dependency(datafiles):
assert(isinstance(firstdep, MetaElement))
firstbuilddep = element.build_dependencies[0]
assert(firstdep == firstbuilddep)
+
+
+@pytest.mark.datafiles(DATA_DIR)
+def test_all_dependency(datafiles):
+ basedir = os.path.join(datafiles.dirname, datafiles.basename)
+ loader = Loader(basedir, 'elements/alldep.bst', None, None, None, [])
+ element = loader.load()
+
+ assert(isinstance(element, MetaElement))
+ assert(element.kind == 'pony')
+
+ assert(len(element.dependencies) == 1)
+ assert(len(element.build_dependencies) == 1)
+ firstdep = element.dependencies[0]
+ assert(isinstance(firstdep, MetaElement))
+ firstbuilddep = element.build_dependencies[0]
+ assert(firstdep == firstbuilddep)
diff --git a/tests/loader/dependencies/elements/alldep.bst b/tests/loader/dependencies/elements/alldep.bst
new file mode 100644
index 000000000..c61c7ea15
--- /dev/null
+++ b/tests/loader/dependencies/elements/alldep.bst
@@ -0,0 +1,5 @@
+kind: pony
+description: This element has a dependency with type 'all'
+depends:
+ - filename: elements/firstdep.bst
+ type: all