summaryrefslogtreecommitdiff
path: root/tests/frontend
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-09-03 18:47:32 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-09-04 04:14:54 -0400
commit3027bc1e2b5711994427ec632eaff6ef7366b46a (patch)
treedb55f15332d389526d0c0cac73099f7faf8d4514 /tests/frontend
parentd290abe942620b6223371183a62610eda82be638 (diff)
downloadbuildstream-3027bc1e2b5711994427ec632eaff6ef7366b46a.tar.gz
tests/frontend/compose_splits.py: Adding some simple artifact splitting test.
This adds a couple of extra elements to the test data project.
Diffstat (limited to 'tests/frontend')
-rw-r--r--tests/frontend/compose_splits.py37
-rw-r--r--tests/frontend/project/elements/compose-exclude-dev.bst16
-rw-r--r--tests/frontend/project/elements/compose-include-bin.bst16
3 files changed, 69 insertions, 0 deletions
diff --git a/tests/frontend/compose_splits.py b/tests/frontend/compose_splits.py
new file mode 100644
index 000000000..fd65493bb
--- /dev/null
+++ b/tests/frontend/compose_splits.py
@@ -0,0 +1,37 @@
+import os
+import pytest
+from tests.testutils.runcli import cli
+
+# Project directory
+DATA_DIR = os.path.join(
+ os.path.dirname(os.path.realpath(__file__)),
+ "project",
+)
+
+
+@pytest.mark.parametrize("target", [
+ ('compose-include-bin.bst'),
+ ('compose-exclude-dev.bst')
+])
+@pytest.mark.datafiles(DATA_DIR)
+def test_compose_splits(datafiles, cli, target):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ checkout = os.path.join(cli.directory, 'checkout')
+
+ # First build it
+ result = cli.run(project=project, args=['build', target])
+ assert result.exit_code == 0
+
+ # Now check it out
+ result = cli.run(project=project, args=[
+ 'checkout', target, checkout
+ ])
+ assert result.exit_code == 0
+
+ # Check that the executable hello file is found in the checkout
+ filename = os.path.join(checkout, 'usr', 'bin', 'hello')
+ assert os.path.exists(filename)
+
+ # Check that the executable hello file is found in the checkout
+ filename = os.path.join(checkout, 'usr', 'include', 'pony.h')
+ assert not os.path.exists(filename)
diff --git a/tests/frontend/project/elements/compose-exclude-dev.bst b/tests/frontend/project/elements/compose-exclude-dev.bst
new file mode 100644
index 000000000..75c14378c
--- /dev/null
+++ b/tests/frontend/project/elements/compose-exclude-dev.bst
@@ -0,0 +1,16 @@
+kind: compose
+
+depends:
+- filename: import-bin.bst
+ type: build
+- filename: import-dev.bst
+ type: build
+
+config:
+ # Dont try running the sandbox, we dont have a
+ # runtime to run anything in this context.
+ integrate: False
+
+ # Exclude the dev domain
+ exclude:
+ - devel
diff --git a/tests/frontend/project/elements/compose-include-bin.bst b/tests/frontend/project/elements/compose-include-bin.bst
new file mode 100644
index 000000000..9571203c6
--- /dev/null
+++ b/tests/frontend/project/elements/compose-include-bin.bst
@@ -0,0 +1,16 @@
+kind: compose
+
+depends:
+- filename: import-bin.bst
+ type: build
+- filename: import-dev.bst
+ type: build
+
+config:
+ # Dont try running the sandbox, we dont have a
+ # runtime to run anything in this context.
+ integrate: False
+
+ # Only include the runtim
+ include:
+ - runtime