summaryrefslogtreecommitdiff
path: root/tests/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'tests/frontend')
-rw-r--r--tests/frontend/buildcheckout.py25
-rw-r--r--tests/frontend/project/elements/target.foo4
-rw-r--r--tests/frontend/project/elements/target2.bst7
-rw-r--r--tests/frontend/project/project.conf3
4 files changed, 39 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index 159af2d74..1299fa190 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -61,6 +61,31 @@ def test_build_checkout(datafiles, cli, strict, hardlinks):
@pytest.mark.datafiles(DATA_DIR)
+@pytest.mark.parametrize("strict,hardlinks", [
+ ("non-strict", "hardlinks"),
+])
+def test_build_invalid_suffix(datafiles, cli, strict, hardlinks):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ checkout = os.path.join(cli.directory, 'checkout')
+
+ result = cli.run(project=project, args=strict_args(['build', 'target.foo'], strict))
+ result.assert_main_error(ErrorDomain.LOAD, "bad-element-suffix")
+
+
+@pytest.mark.datafiles(DATA_DIR)
+@pytest.mark.parametrize("strict,hardlinks", [
+ ("non-strict", "hardlinks"),
+])
+def test_build_invalid_suffix_dep(datafiles, cli, strict, hardlinks):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ checkout = os.path.join(cli.directory, 'checkout')
+
+ # target2.bst depends on an element called target.foo
+ result = cli.run(project=project, args=strict_args(['build', 'target2.bst'], strict))
+ result.assert_main_error(ErrorDomain.LOAD, "bad-element-suffix")
+
+
+@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("deps", [("run"), ("none")])
def test_build_checkout_deps(datafiles, cli, deps):
project = os.path.join(datafiles.dirname, datafiles.basename)
diff --git a/tests/frontend/project/elements/target.foo b/tests/frontend/project/elements/target.foo
new file mode 100644
index 000000000..d644c89ba
--- /dev/null
+++ b/tests/frontend/project/elements/target.foo
@@ -0,0 +1,4 @@
+kind: stack
+description: |
+
+ Main stack target for the bst build test
diff --git a/tests/frontend/project/elements/target2.bst b/tests/frontend/project/elements/target2.bst
new file mode 100644
index 000000000..259819f59
--- /dev/null
+++ b/tests/frontend/project/elements/target2.bst
@@ -0,0 +1,7 @@
+kind: stack
+description: |
+
+ Main stack target for the bst build test
+
+depends:
+- target.foo
diff --git a/tests/frontend/project/project.conf b/tests/frontend/project/project.conf
index 854e38693..a7e4a023c 100644
--- a/tests/frontend/project/project.conf
+++ b/tests/frontend/project/project.conf
@@ -2,3 +2,6 @@
name: test
element-path: elements
+
+fatal-warnings:
+- bad-element-suffix