summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2018-01-26 14:00:29 +0000
committerTristan Maat <tristan.maat@codethink.co.uk>2018-02-07 16:14:15 +0000
commita32a06c4de99f4f306b60ad0518562488ea7bc9b (patch)
tree985f56ebb876f8a3c39ec19a452e720b20c398cb
parent831a4dfcf1d3149a675b35922a16ee270408e3ac (diff)
downloadbuildstream-175-refactor-integration-tests.tar.gz
Add workspace mount integration test175-refactor-integration-tests
-rw-r--r--tests/integration/project/elements/workspace/workspace-mount.bst14
-rw-r--r--tests/integration/project/files/workspace-mount-src/hello.cpp7
-rw-r--r--tests/integration/workspace.py29
3 files changed, 50 insertions, 0 deletions
diff --git a/tests/integration/project/elements/workspace/workspace-mount.bst b/tests/integration/project/elements/workspace/workspace-mount.bst
new file mode 100644
index 000000000..20b434964
--- /dev/null
+++ b/tests/integration/project/elements/workspace/workspace-mount.bst
@@ -0,0 +1,14 @@
+kind: manual
+description: Workspace mount test
+
+depends:
+ - filename: base.bst
+ type: build
+
+sources:
+ - kind: local
+ path: files/workspace-mount-src/
+
+config:
+ build-commands:
+ - g++ -c hello.cpp
diff --git a/tests/integration/project/files/workspace-mount-src/hello.cpp b/tests/integration/project/files/workspace-mount-src/hello.cpp
new file mode 100644
index 000000000..5d364c3cb
--- /dev/null
+++ b/tests/integration/project/files/workspace-mount-src/hello.cpp
@@ -0,0 +1,7 @@
+#include <iostream>
+
+int main() {
+ std::cout << "Hello world!\n";
+
+ return 0;
+}
diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py
new file mode 100644
index 000000000..26168341d
--- /dev/null
+++ b/tests/integration/workspace.py
@@ -0,0 +1,29 @@
+import os
+import pytest
+
+from tests.testutils import cli_integration as cli
+
+
+pytestmark = pytest.mark.integration
+
+
+DATA_DIR = os.path.join(
+ os.path.dirname(os.path.realpath(__file__)),
+ "project"
+)
+
+
+@pytest.mark.integration
+@pytest.mark.datafiles(DATA_DIR)
+def test_workspace_mount(cli, tmpdir, datafiles):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ workspace = os.path.join(cli.directory, 'workspace')
+ element_name = 'workspace/workspace-mount.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'))