diff options
author | James Ennis <james.ennis@codethink.com> | 2018-11-30 17:14:04 +0000 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2018-12-03 13:21:05 +0000 |
commit | d0f9c7241fc0f22bf225ebf1e34e88b1e96ec5eb (patch) | |
tree | b77a55f0f6a51407fc46a33bb1cf7769bf2a1ad5 | |
parent | 6fcfa4524a83261746718a4e3f61fb5348bb06d7 (diff) | |
download | buildstream-d0f9c7241fc0f22bf225ebf1e34e88b1e96ec5eb.tar.gz |
tests/loader/junctions.py: Test that we can build a junction that is referred differently, twice.jonathan/fix-identical-element
Test required to close #795 - We should be able to build a project which refers
to the same junction twice, but with two different filenames.
17 files changed, 69 insertions, 0 deletions
diff --git a/tests/loader/junctions.py b/tests/loader/junctions.py index a02961fb5..d55d10b3d 100644 --- a/tests/loader/junctions.py +++ b/tests/loader/junctions.py @@ -48,6 +48,16 @@ def test_simple_build(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +def test_build_of_same_junction_used_twice(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'inconsistent-names') + + # Check we can build a project that contains the same junction + # that is used twice, but named differently + result = cli.run(project=project, args=['build', 'target.bst']) + assert result.exit_code == 0 + + +@pytest.mark.datafiles(DATA_DIR) def test_nested_simple(cli, tmpdir, datafiles): foo = os.path.join(str(datafiles), 'foo') copy_subprojects(foo, datafiles, ['base']) diff --git a/tests/loader/junctions/inconsistent-names/elements/junction-A.bst b/tests/loader/junctions/inconsistent-names/elements/junction-A.bst new file mode 100644 index 000000000..74079f990 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/elements/junction-A.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: junctionA diff --git a/tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst b/tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst new file mode 100644 index 000000000..3b33406e5 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/elements/junction-B-diff-name.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: junctionA/junctionB diff --git a/tests/loader/junctions/inconsistent-names/elements/target.bst b/tests/loader/junctions/inconsistent-names/elements/target.bst new file mode 100644 index 000000000..7eba141de --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/elements/target.bst @@ -0,0 +1,9 @@ +kind: import +sources: +- kind: local + path: files/foo +depends: +- filename: lib2.bst + junction: junction-B-diff-name.bst +- filename: lib.bst + junction: junction-A.bst diff --git a/tests/loader/junctions/inconsistent-names/files/foo b/tests/loader/junctions/inconsistent-names/files/foo new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/files/foo diff --git a/tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst b/tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst new file mode 100644 index 000000000..473aaee0b --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/elements/app.bst @@ -0,0 +1,6 @@ +kind: import +sources: +- kind: local + path: files/app +depends: +- lib.bst diff --git a/tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst b/tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst new file mode 100644 index 000000000..bc66d7851 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/elements/junction-B.bst @@ -0,0 +1,4 @@ +kind: junction +sources: +- kind: local + path: junctionB diff --git a/tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst b/tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst new file mode 100644 index 000000000..684a64315 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/elements/lib.bst @@ -0,0 +1,7 @@ +kind: import +sources: +- kind: local + path: files/lib +depends: +- filename: base.bst + junction: junction-B.bst diff --git a/tests/loader/junctions/inconsistent-names/junctionA/files/app b/tests/loader/junctions/inconsistent-names/junctionA/files/app new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/files/app diff --git a/tests/loader/junctions/inconsistent-names/junctionA/files/lib b/tests/loader/junctions/inconsistent-names/junctionA/files/lib new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/files/lib diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/base/baseimg b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/base/baseimg new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/base/baseimg diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst new file mode 100644 index 000000000..ecdc57c79 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/base.bst @@ -0,0 +1,4 @@ +kind: import +sources: +- kind: local + path: base diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst new file mode 100644 index 000000000..5a7c17b99 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/elements/lib2.bst @@ -0,0 +1,6 @@ +kind: import +sources: +- kind: local + path: files/lib2 +depends: +- base.bst diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/files/lib2 b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/files/lib2 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/files/lib2 diff --git a/tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf new file mode 100644 index 000000000..2e96170f8 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/junctionB/project.conf @@ -0,0 +1,5 @@ +# Unique project name +name: projectB + +# Subdirectory where elements are stored +element-path: elements diff --git a/tests/loader/junctions/inconsistent-names/junctionA/project.conf b/tests/loader/junctions/inconsistent-names/junctionA/project.conf new file mode 100644 index 000000000..166c4b78c --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/junctionA/project.conf @@ -0,0 +1,5 @@ +# Unique project name +name: projectA + +# Subdirectory where elements are stored +element-path: elements diff --git a/tests/loader/junctions/inconsistent-names/project.conf b/tests/loader/junctions/inconsistent-names/project.conf new file mode 100644 index 000000000..064bbc588 --- /dev/null +++ b/tests/loader/junctions/inconsistent-names/project.conf @@ -0,0 +1,5 @@ +# Unique project name +name: inconsistent-names + +# Subdirectory where elements are stored +element-path: elements |