summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-10-01 14:05:03 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-10-06 14:48:26 +0900
commit4b2e56f5d374bce97270c68f1b3d7fe8922dee1e (patch)
tree254ab4b4eb230de6da37d8f4eb087992de85f33d
parent16e2966dacb716456bb9f105a9c05c4dea024c72 (diff)
downloadbuildstream-4b2e56f5d374bce97270c68f1b3d7fe8922dee1e.tar.gz
tests/format/junctions.py: Test that we can use a link to address which subproject to override
-rw-r--r--tests/format/junctions.py9
-rw-r--r--tests/format/junctions/overrides/subproject-with-overridden-link.bst8
-rw-r--r--tests/format/junctions/overrides/subproject/subsubproject-link.bst4
-rw-r--r--tests/format/junctions/overrides/target-overridden-subsubproject-link.bst8
4 files changed, 28 insertions, 1 deletions
diff --git a/tests/format/junctions.py b/tests/format/junctions.py
index f5858f7e2..600dc4ce1 100644
--- a/tests/format/junctions.py
+++ b/tests/format/junctions.py
@@ -400,12 +400,19 @@ def test_full_path_not_found(cli, tmpdir, datafiles, target, provenance):
[
# Test that we can override a subproject junction of a subproject
("target-overridden-subsubproject.bst", "subsubsub.txt"),
+ # Test that we can override a subproject junction of a subproject, when that junction is a link
+ ("target-overridden-subsubproject-link.bst", "subsubsub.txt"),
# Test that we can override a subproject junction of a subproject's subproject
("target-overridden-subsubsubproject.bst", "surprise.txt"),
# Test that we can override a subproject junction with a deep subproject path
("target-overridden-with-deepsubproject.bst", "deepsurprise.txt"),
],
- ids=["override-subproject", "override-subsubproject", "override-subproject-with-subsubproject"],
+ ids=[
+ "override-subproject",
+ "override-subproject-link",
+ "override-subsubproject",
+ "override-subproject-with-subsubproject",
+ ],
)
def test_overrides(cli, tmpdir, datafiles, target, expected):
project = os.path.join(str(datafiles), "overrides")
diff --git a/tests/format/junctions/overrides/subproject-with-overridden-link.bst b/tests/format/junctions/overrides/subproject-with-overridden-link.bst
new file mode 100644
index 000000000..7688e882a
--- /dev/null
+++ b/tests/format/junctions/overrides/subproject-with-overridden-link.bst
@@ -0,0 +1,8 @@
+kind: junction
+sources:
+- kind: local
+ path: subproject
+
+config:
+ overrides:
+ subsubproject-link.bst: overridden-subsubproject.bst
diff --git a/tests/format/junctions/overrides/subproject/subsubproject-link.bst b/tests/format/junctions/overrides/subproject/subsubproject-link.bst
new file mode 100644
index 000000000..246a5e41c
--- /dev/null
+++ b/tests/format/junctions/overrides/subproject/subsubproject-link.bst
@@ -0,0 +1,4 @@
+kind: link
+
+config:
+ target: subsubproject.bst
diff --git a/tests/format/junctions/overrides/target-overridden-subsubproject-link.bst b/tests/format/junctions/overrides/target-overridden-subsubproject-link.bst
new file mode 100644
index 000000000..d81d39a2a
--- /dev/null
+++ b/tests/format/junctions/overrides/target-overridden-subsubproject-link.bst
@@ -0,0 +1,8 @@
+kind: stack
+
+# Similar test as target-overridden-subsubproject.bst, but we
+# test that this works equally if we are referring to a subsubproject
+# which is in fact a link.
+#
+depends:
+- subproject-with-overridden-link.bst:subsubproject-link.bst:target.bst