summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2018-09-14 11:37:47 +0100
committerPhil Dawson <phildawson.0807@gmail.com>2018-10-16 12:39:14 +0000
commitbbcb9bd5cd5ba85e499d4a37058ca9e8663399d4 (patch)
tree5f703d39ddef81c677f2a32deb81893666a8c63b
parent6298e4093d48845b4d49bd95505b44961f7d37bd (diff)
downloadbuildstream-bbcb9bd5cd5ba85e499d4a37058ca9e8663399d4.tar.gz
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.
-rw-r--r--tests/integration/project/elements/workspace/workspace-commanddir.bst17
-rw-r--r--tests/integration/workspace.py17
2 files changed, 34 insertions, 0 deletions
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 000000000..d963346d7
--- /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 102d053fc..bcbcd674b 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')