diff options
Diffstat (limited to 'tests/frontend/overlaps.py')
-rw-r--r-- | tests/frontend/overlaps.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/frontend/overlaps.py b/tests/frontend/overlaps.py index a45fc700d..28bf8a7f5 100644 --- a/tests/frontend/overlaps.py +++ b/tests/frontend/overlaps.py @@ -4,7 +4,7 @@ import os import pytest from buildstream.testing.runcli import cli # pylint: disable=unused-import -from buildstream.exceptions import ErrorDomain +from buildstream.exceptions import ErrorDomain, LoadErrorReason from buildstream import _yaml from buildstream.plugin import CoreWarnings from tests.testutils import generate_junction @@ -71,6 +71,19 @@ def test_overlaps_whitelist_on_overlapper(cli, datafiles): @pytest.mark.datafiles(DATA_DIR) +def test_overlaps_whitelist_undefined_variable(cli, datafiles): + project_dir = str(datafiles) + gen_project(project_dir, False) + result = cli.run(project=project_dir, silent=True, args=["build", "whitelist-undefined.bst"]) + + # Assert that we get the expected undefined variable error, + # and that it has the provenance we expect from whitelist-undefined.bst + # + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.UNRESOLVED_VARIABLE) + assert "whitelist-undefined.bst [line 13 column 6]" in result.stderr + + +@pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("use_fatal_warnings", [True, False]) def test_overlaps_script(cli, datafiles, use_fatal_warnings): # Test overlaps with script element to test |