diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-07-13 23:01:53 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-07-15 12:53:55 +0900 |
commit | b3d09d6f79b7faa11298c1e65740a3087f3dc602 (patch) | |
tree | fbe5ed3edba555261c36cccb88ad7961395569e5 | |
parent | 0f61dad4902adddad14a21754dc4591c70229d01 (diff) | |
download | buildstream-b3d09d6f79b7faa11298c1e65740a3087f3dc602.tar.gz |
tests/format/link.py: Added test for including files across linked junction boundariestristan/fix-juncle-include-link
15 files changed, 62 insertions, 0 deletions
diff --git a/tests/format/link.py b/tests/format/link.py index e2c9e0b84..88b5569b0 100644 --- a/tests/format/link.py +++ b/tests/format/link.py @@ -5,6 +5,7 @@ import os import pytest +from buildstream import _yaml from buildstream.testing import cli # pylint: disable=unused-import from buildstream.exceptions import ErrorDomain, LoadErrorReason @@ -149,3 +150,19 @@ def test_link_invalid_config(cli, tmpdir, datafiles, target, expected_error, exp project = os.path.join(str(datafiles), "invalid") result = cli.run(project=project, args=["show", target]) result.assert_main_error(expected_error, expected_reason) + + +# +# Test including files across the boundry a link to a subproject's junction +# +@pytest.mark.datafiles(DATA_DIR) +def test_cross_link_junction_include(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), "cross-link-junction-include") + + # Show the variables and parse our test variable from the subsubproject + result = cli.run(project=project, args=["show", "--format", "%{vars}", "target.bst"]) + result.assert_success() + + # Read back some of our project defaults from the env + variables = _yaml.load_data(result.output) + assert variables.get_str("test") == "the test" diff --git a/tests/format/link/cross-link-junction-include/project.conf b/tests/format/link/cross-link-junction-include/project.conf new file mode 100644 index 000000000..27d789520 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/project.conf @@ -0,0 +1,4 @@ +name: test +min-version: 2.0 + +(@): subsubproject.bst:file.yml diff --git a/tests/format/link/cross-link-junction-include/subproject.bst b/tests/format/link/cross-link-junction-include/subproject.bst new file mode 100644 index 000000000..c88189cb0 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: subproject diff --git a/tests/format/link/cross-link-junction-include/subproject/project.conf b/tests/format/link/cross-link-junction-include/subproject/project.conf new file mode 100644 index 000000000..39a53e2ab --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/project.conf @@ -0,0 +1,2 @@ +name: subtest +min-version: 2.0 diff --git a/tests/format/link/cross-link-junction-include/subproject/sub.txt b/tests/format/link/cross-link-junction-include/subproject/sub.txt new file mode 100644 index 000000000..f73f3093f --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/sub.txt @@ -0,0 +1 @@ +file diff --git a/tests/format/link/cross-link-junction-include/subproject/subsubproject.bst b/tests/format/link/cross-link-junction-include/subproject/subsubproject.bst new file mode 100644 index 000000000..f535ab0e0 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subsubproject.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: subsubproject diff --git a/tests/format/link/cross-link-junction-include/subproject/subsubproject/file.yml b/tests/format/link/cross-link-junction-include/subproject/subsubproject/file.yml new file mode 100644 index 000000000..10d83ddd5 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subsubproject/file.yml @@ -0,0 +1,2 @@ +variables: + test: the test diff --git a/tests/format/link/cross-link-junction-include/subproject/subsubproject/project.conf b/tests/format/link/cross-link-junction-include/subproject/subsubproject/project.conf new file mode 100644 index 000000000..d11bcbb30 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subsubproject/project.conf @@ -0,0 +1,2 @@ +name: subsubtest +min-version: 2.0 diff --git a/tests/format/link/cross-link-junction-include/subproject/subsubproject/subsub.txt b/tests/format/link/cross-link-junction-include/subproject/subsubproject/subsub.txt new file mode 100644 index 000000000..f73f3093f --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subsubproject/subsub.txt @@ -0,0 +1 @@ +file diff --git a/tests/format/link/cross-link-junction-include/subproject/subsubproject/subtarget.bst b/tests/format/link/cross-link-junction-include/subproject/subsubproject/subtarget.bst new file mode 100644 index 000000000..b6fea5b2a --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subsubproject/subtarget.bst @@ -0,0 +1,4 @@ +kind: stack + +depends: +- subsubsubproject.bst:target.bst diff --git a/tests/format/link/cross-link-junction-include/subproject/subsubproject/target.bst b/tests/format/link/cross-link-junction-include/subproject/subsubproject/target.bst new file mode 100644 index 000000000..afafac601 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subsubproject/target.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: subsub.txt diff --git a/tests/format/link/cross-link-junction-include/subproject/subtarget.bst b/tests/format/link/cross-link-junction-include/subproject/subtarget.bst new file mode 100644 index 000000000..c4549b373 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/subtarget.bst @@ -0,0 +1,4 @@ +kind: stack + +depends: +- subsubproject.bst:target.bst diff --git a/tests/format/link/cross-link-junction-include/subproject/target.bst b/tests/format/link/cross-link-junction-include/subproject/target.bst new file mode 100644 index 000000000..e24d9bbb4 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subproject/target.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: sub.txt diff --git a/tests/format/link/cross-link-junction-include/subsubproject.bst b/tests/format/link/cross-link-junction-include/subsubproject.bst new file mode 100644 index 000000000..5246bfea0 --- /dev/null +++ b/tests/format/link/cross-link-junction-include/subsubproject.bst @@ -0,0 +1,4 @@ +kind: link + +config: + target: subproject.bst:subsubproject.bst diff --git a/tests/format/link/cross-link-junction-include/target.bst b/tests/format/link/cross-link-junction-include/target.bst new file mode 100644 index 000000000..32bbc75bc --- /dev/null +++ b/tests/format/link/cross-link-junction-include/target.bst @@ -0,0 +1,5 @@ +kind: stack + +depends: +- subproject.bst:target.bst +- subproject.bst:subtarget.bst |