summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-09-26 17:18:23 +0900
committerbst-marge-bot <marge-bot@buildstream.build>2020-09-28 09:26:09 +0000
commitd2b0039cbd7ceaac9fd66bb4e17db04f321d494e (patch)
treef948ab6b11e54c308b33320a244769868e730301
parent295d65b9c753d378c97cafd132275016b9cea3f5 (diff)
downloadbuildstream-d2b0039cbd7ceaac9fd66bb4e17db04f321d494e.tar.gz
tests/format/dependencies.py: Test bad filename configuration
Test a dictionary instead of a string when given to the filename list.
-rw-r--r--tests/format/dependencies.py11
-rw-r--r--tests/format/dependencies3/elements/invalid-filenames.bst13
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/format/dependencies.py b/tests/format/dependencies.py
index 0e2d4a1a7..789df060f 100644
--- a/tests/format/dependencies.py
+++ b/tests/format/dependencies.py
@@ -294,3 +294,14 @@ def test_shorthand(cli, datafiles, target, number):
result.assert_success()
assert "TEST PLUGIN FOUND {} ENABLED DEPENDENCIES".format(number) in result.stderr
+
+
+@pytest.mark.datafiles(DATA_DIR)
+def test_invalid_filenames(cli, datafiles):
+ project = os.path.join(str(datafiles), "dependencies3")
+
+ result = cli.run(project=project, args=["show", "invalid-filenames.bst"])
+ result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
+
+ # Assert expected provenance
+ assert "invalid-filenames.bst [line 9 column 4]" in result.stderr
diff --git a/tests/format/dependencies3/elements/invalid-filenames.bst b/tests/format/dependencies3/elements/invalid-filenames.bst
new file mode 100644
index 000000000..0a8325eae
--- /dev/null
+++ b/tests/format/dependencies3/elements/invalid-filenames.bst
@@ -0,0 +1,13 @@
+kind: configsupported
+
+# Here we test an incorrect type of filename, e.g. a dictionary
+#
+depends:
+- filename:
+ - target-a.bst
+ - target-b.bst
+ - multiple: foo
+ components: bar
+ junction: subproject.bst
+ config:
+ enabled: true