summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-09-21 23:20:56 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2018-12-03 09:46:14 +0000
commit8ac1e7576f43f691b2f011d2655efe3ddb6984a3 (patch)
treee7f34f698e80ccf92edd7f7096e48185ec4a704e /tests
parent1b24148fdadcafaf4b316cc45819a06d8ec42647 (diff)
downloadbuildstream-8ac1e7576f43f691b2f011d2655efe3ddb6984a3.tar.gz
Add `--deps build` option to `bst checkout`
As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `--deps build` option to `bst checkout`. This will allow users to checkout the all build dependencies of a given element using a single command. - _frontend/cli.py: Add `--deps build` option for `bst checkout`. - element.py: Support `deps='build'` in Element._prepare_sandbox(). - tests/frontend/buildcheckout.py: Ensure `--deps build` works as expected.
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/buildcheckout.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index d43bac863..03bba0b26 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -86,7 +86,7 @@ def test_build_invalid_suffix_dep(datafiles, cli, strict, hardlinks):
@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.parametrize("deps", [("run"), ("none")])
+@pytest.mark.parametrize("deps", [("run"), ("none"), ("build")])
def test_build_checkout_deps(datafiles, cli, deps):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
@@ -107,7 +107,17 @@ def test_build_checkout_deps(datafiles, cli, deps):
# Verify output of this element
filename = os.path.join(checkout, 'etc', 'buildstream', 'config')
- assert os.path.exists(filename)
+ if deps == "build":
+ assert not os.path.exists(filename)
+ else:
+ assert os.path.exists(filename)
+
+ # Verify output of this element's build dependencies
+ filename = os.path.join(checkout, 'usr', 'include', 'pony.h')
+ if deps == "build":
+ assert os.path.exists(filename)
+ else:
+ assert not os.path.exists(filename)
# Verify output of this element's runtime dependencies
filename = os.path.join(checkout, 'usr', 'bin', 'hello')