You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:29:07 UTC

[buildstream] 02/09: New Integration test for workspace command-subdir

This is an automated email from the ASF dual-hosted git repository.

root pushed a commit to branch willsalmon/simpleOutSource
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 836727ba6366224d7bedc15a34c767cfa8964b39
Author: William Salmon <wi...@codethink.co.uk>
AuthorDate: Fri Sep 14 11:37:47 2018 +0100

    New Integration test for workspace command-subdir
    
    Build stream was only creating command-subdir for non workspace builds
    this has now been fixed, and this regression test should support the
    feature.
    
    For issue #512 in Gitlab.
---
 .../project/elements/workspace/workspace-commanddir.bst | 17 +++++++++++++++++
 tests/integration/workspace.py                          | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/tests/integration/project/elements/workspace/workspace-commanddir.bst b/tests/integration/project/elements/workspace/workspace-commanddir.bst
new file mode 100644
index 0000000..d963346
--- /dev/null
+++ b/tests/integration/project/elements/workspace/workspace-commanddir.bst
@@ -0,0 +1,17 @@
+kind: manual
+description: Workspace mount test
+
+depends:
+  - filename: base.bst
+    type: build
+
+sources:
+  - kind: local
+    path: files/workspace-mount-src/
+
+variables:
+  command-subdir: build
+
+config:
+  build-commands:
+    - cc -c ../hello.c
diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py
index 102d053..bcbcd67 100644
--- a/tests/integration/workspace.py
+++ b/tests/integration/workspace.py
@@ -34,6 +34,23 @@ def test_workspace_mount(cli, tmpdir, datafiles):
 
 @pytest.mark.integration
 @pytest.mark.datafiles(DATA_DIR)
+def test_workspace_commanddir(cli, tmpdir, datafiles):
+    project = os.path.join(datafiles.dirname, datafiles.basename)
+    workspace = os.path.join(cli.directory, 'workspace')
+    element_name = 'workspace/workspace-commanddir.bst'
+
+    res = cli.run(project=project, args=['workspace', 'open', element_name, workspace])
+    assert res.exit_code == 0
+
+    res = cli.run(project=project, args=['build', element_name])
+    assert res.exit_code == 0
+
+    assert os.path.exists(os.path.join(cli.directory, 'workspace'))
+    assert os.path.exists(os.path.join(cli.directory, 'workspace', 'build'))
+
+
+@pytest.mark.integration
+@pytest.mark.datafiles(DATA_DIR)
 def test_workspace_updated_dependency(cli, tmpdir, datafiles):
     project = os.path.join(datafiles.dirname, datafiles.basename)
     workspace = os.path.join(cli.directory, 'workspace')