Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (3)
......@@ -58,6 +58,10 @@ class Includes:
message = "{}: Include block references a file that could not be found: '{}'.".format(
include_provenance, include)
raise LoadError(LoadErrorReason.MISSING_FILE, message) from e
elif e.reason == LoadErrorReason.LOADING_DIRECTORY:
message = "{}: Include block references a directory instead of a file: '{}'.".format(
include_provenance, include)
raise LoadError(LoadErrorReason.LOADING_DIRECTORY, message) from e
else:
raise
......@@ -112,7 +116,7 @@ class Includes:
file_path = os.path.join(directory, include)
key = (current_loader, file_path)
if key not in self._loaded:
self._loaded[key] = _yaml.load(os.path.join(directory, include),
self._loaded[key] = _yaml.load(file_path,
shortname=shortname,
project=project,
copy_tree=self._copy_tree)
......
......@@ -45,6 +45,27 @@ def test_include_missing_file(cli, tmpdir):
assert 'line 4 column 2' in result.stderr
def test_include_dir(cli, tmpdir):
tmpdir.join('project.conf').write('{"name": "test"}')
tmpdir.mkdir('subdir')
element = tmpdir.join('include_dir.bst')
# Normally we would use dicts and _yaml.dump to write such things, but here
# we want to be sure of a stable line and column number.
element.write(textwrap.dedent("""
kind: manual
"(@)":
- subdir/
""").strip())
result = cli.run(project=str(tmpdir), args=['show', str(element.basename)])
result.assert_main_error(
ErrorDomain.LOAD, LoadErrorReason.LOADING_DIRECTORY)
# Make sure the root cause provenance is in the output.
assert 'line 4 column 2' in result.stderr
@pytest.mark.datafiles(DATA_DIR)
def test_include_junction_file(cli, tmpdir, datafiles):
project = os.path.join(str(datafiles), 'junction')
......@@ -65,7 +86,7 @@ def test_include_junction_file(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_include_junction_options(cli, tmpdir, datafiles):
def test_include_junction_options(cli, datafiles):
project = os.path.join(str(datafiles), 'options')
result = cli.run(project=project, args=[
......@@ -146,7 +167,7 @@ def test_junction_element_not_partial_project_file(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_include_element_overrides(cli, tmpdir, datafiles):
def test_include_element_overrides(cli, datafiles):
project = os.path.join(str(datafiles), 'overrides')
result = cli.run(project=project, args=[
......@@ -161,7 +182,7 @@ def test_include_element_overrides(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_include_element_overrides_composition(cli, tmpdir, datafiles):
def test_include_element_overrides_composition(cli, datafiles):
project = os.path.join(str(datafiles), 'overrides')
result = cli.run(project=project, args=[
......@@ -176,7 +197,7 @@ def test_include_element_overrides_composition(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_include_element_overrides_sub_include(cli, tmpdir, datafiles):
def test_include_element_overrides_sub_include(cli, datafiles):
project = os.path.join(str(datafiles), 'sub-include')
result = cli.run(project=project, args=[
......@@ -210,7 +231,7 @@ def test_junction_do_not_use_included_overrides(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_conditional_in_fragment(cli, tmpdir, datafiles):
def test_conditional_in_fragment(cli, datafiles):
project = os.path.join(str(datafiles), 'conditional')
result = cli.run(project=project, args=[
......@@ -240,7 +261,7 @@ def test_inner(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_recursive_include(cli, tmpdir, datafiles):
def test_recursive_include(cli, datafiles):
project = os.path.join(str(datafiles), 'recursive')
result = cli.run(project=project, args=[
......