summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-09-03 13:28:40 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-09-18 12:38:49 +0900
commit7912ea10e6d47344dedbb1f15cd51a63ebe6824b (patch)
tree8ce236f2f823d46bdb0bef4b5085426efaff96a1
parent37c49e34862a0d89dc30f52fcf05bfe249c207d8 (diff)
downloadbuildstream-7912ea10e6d47344dedbb1f15cd51a63ebe6824b.tar.gz
tests/format/dependencies.py: Test merging of multiple dependencies
Test that when the same dependency is added as a build and runtime dependency separately, they end up being the same dependency which is both a build & runtime dependency in the loaded build graph.
-rw-r--r--tests/format/dependencies.py18
-rw-r--r--tests/format/dependencies2/merge-separate-lists.bst8
-rw-r--r--tests/format/dependencies2/merge-single-list.bst8
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/format/dependencies.py b/tests/format/dependencies.py
index 393f806ad..7f5de8684 100644
--- a/tests/format/dependencies.py
+++ b/tests/format/dependencies.py
@@ -232,3 +232,21 @@ def test_no_recurse(cli, datafiles):
"dep-two.bst",
"target.bst",
]
+
+
+@pytest.mark.datafiles(DATA_DIR)
+@pytest.mark.parametrize(
+ "target", ["merge-separate-lists.bst", "merge-single-list.bst",], ids=["separate-lists", "single-list"],
+)
+def test_merge(cli, datafiles, target):
+ project = os.path.join(str(datafiles), "dependencies2")
+
+ # Test both build and run scopes, showing that the two dependencies
+ # have been merged and the run-build.bst is both a runtime and build
+ # time dependency, and is not loaded twice into the build graph.
+ #
+ element_list = cli.get_pipeline(project, [target], scope="build")
+ assert element_list == ["run-build.bst"]
+
+ element_list = cli.get_pipeline(project, [target], scope="run")
+ assert element_list == ["run-build.bst", target]
diff --git a/tests/format/dependencies2/merge-separate-lists.bst b/tests/format/dependencies2/merge-separate-lists.bst
new file mode 100644
index 000000000..5be04d7a1
--- /dev/null
+++ b/tests/format/dependencies2/merge-separate-lists.bst
@@ -0,0 +1,8 @@
+kind: autotools
+description: Depend on the same element twice, as a build and as a runtime dependency
+
+build-depends:
+- run-build.bst
+
+runtime-depends:
+- run-build.bst
diff --git a/tests/format/dependencies2/merge-single-list.bst b/tests/format/dependencies2/merge-single-list.bst
new file mode 100644
index 000000000..4fd46e695
--- /dev/null
+++ b/tests/format/dependencies2/merge-single-list.bst
@@ -0,0 +1,8 @@
+kind: autotools
+description: Depend on the same element twice, as a build and as a runtime dependency
+
+depends:
+- filename: run-build.bst
+ type: runtime
+- filename: run-build.bst
+ type: build