diff options
author | Phillip Smyth <phillipsmyth@Nexus-x240.dyn.ducie.codethink.co.uk> | 2018-07-16 16:06:15 +0100 |
---|---|---|
committer | Phillip Smyth <phillip.smyth@codethink.co.uk> | 2018-07-17 12:53:55 +0000 |
commit | 2797d1fd2b854db86d0cefc0787e2549f713107b (patch) | |
tree | 3c570134187cdc2d137634c04cfb487c7bd53d03 /tests | |
parent | 7e9282c97a7f940b9882154ccc6164a7f2268da8 (diff) | |
download | buildstream-2797d1fd2b854db86d0cefc0787e2549f713107b.tar.gz |
tests/frontend/buildcheckout.py: Added tests for "Add a `--deps` flag to `bst checkout`"add_flag_to_checkout
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/buildcheckout.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 5b46d3d52..0fce355d4 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -60,6 +60,42 @@ def test_build_checkout(datafiles, cli, strict, hardlinks): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize("deps", [("run"), ("none")]) +def test_build_checkout_deps(datafiles, cli, deps): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + + # First build it + result = cli.run(project=project, args=['build', 'target.bst']) + result.assert_success() + + # Assert that after a successful build, the builddir is empty + builddir = os.path.join(cli.directory, 'build') + assert os.path.isdir(builddir) + assert not os.listdir(builddir) + + # Now check it out + result = cli.run(project=project, args=['checkout', 'target.bst', '--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') + + if deps == "run": + assert os.path.exists(filename) + else: + assert not os.path.exists(filename) + + +@pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("hardlinks", [("copies"), ("hardlinks")]) def test_build_checkout_nonempty(datafiles, cli, hardlinks): project = os.path.join(datafiles.dirname, datafiles.basename) |