summaryrefslogtreecommitdiff
path: root/src/buildstream/testing
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2020-04-02 17:54:29 +0200
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2020-04-15 05:51:54 +0000
commit86f013dbffa87692250ce1aefd31cecd1559ddd5 (patch)
tree0aff67bc43d39ad0b8b599202b25acef78b039e2 /src/buildstream/testing
parent4bdb97396ed8e286c8b433a371eea63e1c10bdc0 (diff)
downloadbuildstream-86f013dbffa87692250ce1aefd31cecd1559ddd5.tar.gz
Process options in includes files with the options of their junctionvalentindavid/include-options-from-junction
Unfortunately the options from main project cannot always be processed in the include processing since project configuration might load option declarations from a separate file. For that reason the result of `Include.process` should still be passed through the option processor. But all options files included from junctioned are already evaluated.
Diffstat (limited to 'src/buildstream/testing')
-rw-r--r--src/buildstream/testing/_utils/junction.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildstream/testing/_utils/junction.py b/src/buildstream/testing/_utils/junction.py
index e4dbd5984..6f45ad590 100644
--- a/src/buildstream/testing/_utils/junction.py
+++ b/src/buildstream/testing/_utils/junction.py
@@ -19,7 +19,7 @@ from .site import HAVE_GIT, GIT, GIT_ENV
# Returns:
# (str): The ref
#
-def generate_junction(tmpdir, subproject_path, junction_path, *, store_ref=True):
+def generate_junction(tmpdir, subproject_path, junction_path, *, store_ref=True, options={}):
# Create a repo to hold the subproject and generate
# a junction element for it
#
@@ -29,6 +29,10 @@ def generate_junction(tmpdir, subproject_path, junction_path, *, store_ref=True)
source_ref = None
element = {"kind": "junction", "sources": [repo.source_config(ref=source_ref)]}
+
+ if options:
+ element["config"] = {"options": options}
+
_yaml.roundtrip_dump(element, junction_path)
return ref