diff options
author | Valentin David <valentin.david@codethink.co.uk> | 2020-05-10 17:07:06 +0200 |
---|---|---|
committer | Valentin David <valentin.david@codethink.co.uk> | 2020-05-10 18:51:02 +0200 |
commit | cd6d0572ef70b93636d7940d06ad0b13e0aca486 (patch) | |
tree | 728e7ade7898ea31f87e8d7cf0b408cdd7475e99 /tests/loader/junctions.py | |
parent | 62eee7be681c74c6b6aa679acac9d27bf1b871e9 (diff) | |
download | buildstream-cd6d0572ef70b93636d7940d06ad0b13e0aca486.tar.gz |
Allow junctions to inject dependencies from current project to junctioned onevalentindavid/junction-replacements-1.4
There are cases where downstream projects want to overwrite upstream
elements.
So far, either the downstream project just allows overlaps and hopes
that ABI is compatible. There are also files left from original
elements when not overwritten.
Or downstream adds an "overlay" with local source to the
junctions. However on the latter, elements in the overlay are
considered as part of upstream, which means in cannot depend on
element outside of upstream (unless cyclic junction maybe?).
Here we add a feature to junctions to allow injecting elements from
current project to junctions.
This is useful for example in the case of GNOME SDK needing to override
GLib, GObjectIntrospection, libsoup, etc. from Freedesktop SDK.
Diffstat (limited to 'tests/loader/junctions.py')
-rw-r--r-- | tests/loader/junctions.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/loader/junctions.py b/tests/loader/junctions.py index aee164396..0daa7e9f6 100644 --- a/tests/loader/junctions.py +++ b/tests/loader/junctions.py @@ -330,3 +330,19 @@ def test_build_git_cross_junction_names(cli, tmpdir, datafiles): # Check that the checkout contains the expected files from both projects assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_replacements(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), "replacements") + copy_subprojects(project, datafiles, ["replacements-base"]) + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Build, checkout + result = cli.run(project=project, args=["build", "stack.bst"]) + result.assert_success() + result = cli.run(project=project, args=["checkout", "stack.bst", checkoutdir]) + result.assert_success() + + assert os.path.exists(os.path.join(checkoutdir, "destination/injected.txt")) + assert not os.path.exists(os.path.join(checkoutdir, "original.txt")) |