diff options
author | William Salmon <will.salmon@codethink.co.uk> | 2018-10-10 11:41:05 +0100 |
---|---|---|
committer | Phil Dawson <phildawson.0807@gmail.com> | 2018-10-16 12:39:14 +0000 |
commit | 0d04e1b7db7e7612a2d2ca13652e7c425e519650 (patch) | |
tree | e90c141de1bd8403c53d043861c22912ccd30c3b /tests | |
parent | 5e7cc645c69f96b35508113fdd311ce2e8ba9ab2 (diff) | |
download | buildstream-0d04e1b7db7e7612a2d2ca13652e7c425e519650.tar.gz |
Added tests for conf-root variable
For issue #512 in Gitlab.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/autotools.py | 24 | ||||
-rw-r--r-- | tests/integration/cmake.py | 18 | ||||
-rw-r--r-- | tests/integration/project/elements/autotools/amhelloconfroot.bst | 15 | ||||
-rw-r--r-- | tests/integration/project/elements/cmake/cmakeconfroothello.bst | 15 |
4 files changed, 72 insertions, 0 deletions
diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py index 6ea2b667c..3c4981365 100644 --- a/tests/integration/autotools.py +++ b/tests/integration/autotools.py @@ -38,6 +38,30 @@ def test_autotools_build(cli, tmpdir, datafiles): '/usr/share/doc/amhello/README']) +# Test that an autotools build 'works' - we use the autotools sample +# amhello project for this. +@pytest.mark.integration +@pytest.mark.datafiles(DATA_DIR) +def test_autotools_confroot_build(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + element_name = 'autotools/amhelloconfroot.bst' + + result = cli.run(project=project, args=['build', element_name]) + assert result.exit_code == 0 + + result = cli.run(project=project, args=['checkout', element_name, checkout]) + assert result.exit_code == 0 + + assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin', + '/usr/share', '/usr/lib/debug', + '/usr/lib/debug/usr', '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello', + '/usr/bin/hello', '/usr/share/doc', + '/usr/share/doc/amhello', + '/usr/share/doc/amhello/README']) + + # Test running an executable built with autotools @pytest.mark.datafiles(DATA_DIR) def test_autotools_run(cli, tmpdir, datafiles): diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py index 3c16b29b9..e74958b91 100644 --- a/tests/integration/cmake.py +++ b/tests/integration/cmake.py @@ -33,6 +33,24 @@ def test_cmake_build(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +def test_cmake_confroot_build(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + element_name = 'cmake/cmakeconfroothello.bst' + + result = cli.run(project=project, args=['build', element_name]) + assert result.exit_code == 0 + + result = cli.run(project=project, args=['checkout', element_name, checkout]) + assert result.exit_code == 0 + + assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello', + '/usr/lib/debug', '/usr/lib/debug/usr', + '/usr/lib/debug/usr/bin', + '/usr/lib/debug/usr/bin/hello']) + + +@pytest.mark.datafiles(DATA_DIR) def test_cmake_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'cmake/cmakehello.bst' diff --git a/tests/integration/project/elements/autotools/amhelloconfroot.bst b/tests/integration/project/elements/autotools/amhelloconfroot.bst new file mode 100644 index 000000000..28926446b --- /dev/null +++ b/tests/integration/project/elements/autotools/amhelloconfroot.bst @@ -0,0 +1,15 @@ +kind: autotools +description: Autotools test + +depends: +- base.bst + +sources: +- kind: tar + url: project_dir:/files/amhello.tar.gz + ref: 9ba123fa4e660929e9a0aa99f0c487b7eee59c5e7594f3284d015640b90f5590 + directory: SourceFile + +variables: + conf-root: "%{build-root}/SourceFile" + command-subdir: build diff --git a/tests/integration/project/elements/cmake/cmakeconfroothello.bst b/tests/integration/project/elements/cmake/cmakeconfroothello.bst new file mode 100644 index 000000000..cd33dee99 --- /dev/null +++ b/tests/integration/project/elements/cmake/cmakeconfroothello.bst @@ -0,0 +1,15 @@ +kind: cmake +description: Cmake test + +depends: + - base.bst + +sources: + - kind: tar + directory: Source + url: project_dir:/files/cmakehello.tar.gz + ref: 508266f40dbc5875293bd24c4e50a9eb6b88cbacab742033f7b92f8c087b64e5 + +variables: + conf-root: "%{build-root}/Source" + command-subdir: build |