diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2018-09-26 00:30:17 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2018-12-03 09:46:13 +0000 |
commit | 1b24148fdadcafaf4b316cc45819a06d8ec42647 (patch) | |
tree | 3940bd30844326b19150f9db0926697dab07fd2b /tests | |
parent | 87ba19d77393bce1bcc03df36a12e91010500451 (diff) | |
download | buildstream-1b24148fdadcafaf4b316cc45819a06d8ec42647.tar.gz |
Ensure `--deps=none` option works for `bst checkout`
Currently, `bst checkout --deps none` command always produces empty
output. Fix this issue and add regression test for the same.
- element_enums.py: Add Scope.NONE.
- element.py: Ensure Scope.NONE works correctly in addition to
Scope.RUN/Scope.ALL in Element.dependencies() and Element.search().
- tests/frontend/buildcheckout.py: Fix tests for `--deps none`.
Fixes #670.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/buildcheckout.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 1299fa190..d43bac863 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -90,9 +90,10 @@ def test_build_invalid_suffix_dep(datafiles, cli, strict, hardlinks): def test_build_checkout_deps(datafiles, cli, deps): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') + element_name = "checkout-deps.bst" # First build it - result = cli.run(project=project, args=['build', 'target.bst']) + result = cli.run(project=project, args=['build', element_name]) result.assert_success() # Assert that after a successful build, the builddir is empty @@ -101,20 +102,15 @@ def test_build_checkout_deps(datafiles, cli, deps): assert not os.listdir(builddir) # Now check it out - result = cli.run(project=project, args=['checkout', 'target.bst', '--deps', deps, checkout]) + result = cli.run(project=project, args=['checkout', element_name, '--deps', deps, checkout]) result.assert_success() - # Check that the executable hello file is found in the checkout - filename = os.path.join(checkout, 'usr', 'bin', 'hello') - - if deps == "run": - assert os.path.exists(filename) - else: - assert not os.path.exists(filename) - - # Check that the executable hello file is found in the checkout - filename = os.path.join(checkout, 'usr', 'include', 'pony.h') + # Verify output of this element + filename = os.path.join(checkout, 'etc', 'buildstream', 'config') + assert os.path.exists(filename) + # Verify output of this element's runtime dependencies + filename = os.path.join(checkout, 'usr', 'bin', 'hello') if deps == "run": assert os.path.exists(filename) else: |