summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/frontend/overlaps.py22
-rw-r--r--tests/frontend/overlaps/collect.bst9
-rw-r--r--tests/frontend/overlaps/one.bst7
-rw-r--r--tests/frontend/overlaps/one/file11
-rw-r--r--tests/frontend/overlaps/one/file21
-rw-r--r--tests/frontend/overlaps/project.conf3
-rw-r--r--tests/frontend/overlaps/three.bst7
-rw-r--r--tests/frontend/overlaps/three/file11
-rw-r--r--tests/frontend/overlaps/three/file21
-rw-r--r--tests/frontend/overlaps/three/file31
-rw-r--r--tests/frontend/overlaps/two.bst7
-rw-r--r--tests/frontend/overlaps/two/file21
-rw-r--r--tests/frontend/overlaps/two/file31
13 files changed, 62 insertions, 0 deletions
diff --git a/tests/frontend/overlaps.py b/tests/frontend/overlaps.py
new file mode 100644
index 000000000..cc7c08fa6
--- /dev/null
+++ b/tests/frontend/overlaps.py
@@ -0,0 +1,22 @@
+import os
+import pytest
+from tests.testutils.runcli import cli
+
+# Project directory
+DATA_DIR = os.path.join(
+ os.path.dirname(os.path.realpath(__file__)),
+ "overlaps"
+)
+
+
+@pytest.mark.datafiles(DATA_DIR)
+def test_overlaps(cli, datafiles):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ result = cli.run(project=project, silent=True, args=[
+ 'build', 'collect.bst'])
+
+ assert result.exit_code == 0
+ print(result.output)
+ assert "/file1: three.bst above one.bst" in result.output
+ assert "/file2: two.bst above three.bst above one.bst" in result.output
+ assert "/file3: two.bst above three.bst" in result.output
diff --git a/tests/frontend/overlaps/collect.bst b/tests/frontend/overlaps/collect.bst
new file mode 100644
index 000000000..e0f8186ff
--- /dev/null
+++ b/tests/frontend/overlaps/collect.bst
@@ -0,0 +1,9 @@
+kind: compose
+
+depends:
+- filename: one.bst
+ type: build
+- filename: two.bst
+ type: build
+- filename: three.bst
+ type: build
diff --git a/tests/frontend/overlaps/one.bst b/tests/frontend/overlaps/one.bst
new file mode 100644
index 000000000..292970707
--- /dev/null
+++ b/tests/frontend/overlaps/one.bst
@@ -0,0 +1,7 @@
+kind: import
+config:
+ source: /
+ target: /
+sources:
+- kind: local
+ path: one
diff --git a/tests/frontend/overlaps/one/file1 b/tests/frontend/overlaps/one/file1
new file mode 100644
index 000000000..257cc5642
--- /dev/null
+++ b/tests/frontend/overlaps/one/file1
@@ -0,0 +1 @@
+foo
diff --git a/tests/frontend/overlaps/one/file2 b/tests/frontend/overlaps/one/file2
new file mode 100644
index 000000000..5716ca598
--- /dev/null
+++ b/tests/frontend/overlaps/one/file2
@@ -0,0 +1 @@
+bar
diff --git a/tests/frontend/overlaps/project.conf b/tests/frontend/overlaps/project.conf
new file mode 100644
index 000000000..2027cc27a
--- /dev/null
+++ b/tests/frontend/overlaps/project.conf
@@ -0,0 +1,3 @@
+# Basic project configuration that doesnt override anything
+#
+name: pony
diff --git a/tests/frontend/overlaps/three.bst b/tests/frontend/overlaps/three.bst
new file mode 100644
index 000000000..07eb7252d
--- /dev/null
+++ b/tests/frontend/overlaps/three.bst
@@ -0,0 +1,7 @@
+kind: import
+config:
+ source: /
+ target: /
+sources:
+- kind: local
+ path: three
diff --git a/tests/frontend/overlaps/three/file1 b/tests/frontend/overlaps/three/file1
new file mode 100644
index 000000000..76018072e
--- /dev/null
+++ b/tests/frontend/overlaps/three/file1
@@ -0,0 +1 @@
+baz
diff --git a/tests/frontend/overlaps/three/file2 b/tests/frontend/overlaps/three/file2
new file mode 100644
index 000000000..5716ca598
--- /dev/null
+++ b/tests/frontend/overlaps/three/file2
@@ -0,0 +1 @@
+bar
diff --git a/tests/frontend/overlaps/three/file3 b/tests/frontend/overlaps/three/file3
new file mode 100644
index 000000000..257cc5642
--- /dev/null
+++ b/tests/frontend/overlaps/three/file3
@@ -0,0 +1 @@
+foo
diff --git a/tests/frontend/overlaps/two.bst b/tests/frontend/overlaps/two.bst
new file mode 100644
index 000000000..21366506c
--- /dev/null
+++ b/tests/frontend/overlaps/two.bst
@@ -0,0 +1,7 @@
+kind: import
+config:
+ source: /
+ target: /
+sources:
+- kind: local
+ path: two
diff --git a/tests/frontend/overlaps/two/file2 b/tests/frontend/overlaps/two/file2
new file mode 100644
index 000000000..257cc5642
--- /dev/null
+++ b/tests/frontend/overlaps/two/file2
@@ -0,0 +1 @@
+foo
diff --git a/tests/frontend/overlaps/two/file3 b/tests/frontend/overlaps/two/file3
new file mode 100644
index 000000000..5716ca598
--- /dev/null
+++ b/tests/frontend/overlaps/two/file3
@@ -0,0 +1 @@
+bar