diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-06-17 21:04:41 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-06-17 21:37:22 -0400 |
commit | 73b930024d164e076275868253f92a47593f2dd8 (patch) | |
tree | 1789cbea13738ad4f4fcd7167c6741cb41dcccf5 /tests/examples | |
parent | 3f56037896a6f546d6949c70aa65384d78b7a0fc (diff) | |
download | buildstream-73b930024d164e076275868253f92a47593f2dd8.tar.gz |
doc: Adding part 2 of the getting started tutorial
o doc/examples/running-commands: New example project of a `manual` build element
o doc/sessions/running-commands.run: New session file to capture bst output
o doc/source/sessions-stored: Added new generated sessions
o doc/source/tutorial/running-commands.rst: New tutorial entry describing how
commands are run in the sandbox
o tests/examples/running-commands.py: Test case validating the tutorial's assertions
Diffstat (limited to 'tests/examples')
-rw-r--r-- | tests/examples/running-commands.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py new file mode 100644 index 000000000..95f645d77 --- /dev/null +++ b/tests/examples/running-commands.py @@ -0,0 +1,36 @@ +import os +import pytest + +from tests.testutils import cli_integration as cli +from tests.testutils.integration import assert_contains +from tests.testutils.site import IS_LINUX + + +pytestmark = pytest.mark.integration +DATA_DIR = os.path.join( + os.path.dirname(os.path.realpath(__file__)), '..', '..', 'doc', 'examples', 'running-commands' +) + + +@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.datafiles(DATA_DIR) +def test_running_commands_build(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + + result = cli.run(project=project, args=['build', 'hello.bst']) + assert result.exit_code == 0 + + +# Test running the executable +@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.datafiles(DATA_DIR) +def test_running_commands_run(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + + result = cli.run(project=project, args=['build', 'hello.bst']) + assert result.exit_code == 0 + + result = cli.run(project=project, args=['shell', 'hello.bst', '--', 'hello']) + assert result.exit_code == 0 + assert result.output == 'Hello World\n' |