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)
......@@ -2,6 +2,10 @@
buildstream 1.3.1
=================
o All elements must now be suffixed with `.bst`
Attempting to use an element that does not have the `.bst` extension,
will result in a warning.
o BREAKING CHANGE: The 'manual' element lost its default 'MAKEFLAGS' and 'V'
environment variables. There is already a 'make' element with the same
variables. Note that this is a breaking change, it will require users to
......
......@@ -109,7 +109,11 @@ def complete_target(args, incomplete):
if element_directory:
base_directory = os.path.join(base_directory, element_directory)
return complete_path("File", incomplete, base_directory=base_directory)
complete_list = []
for p in complete_path("File", incomplete, base_directory=base_directory):
if p.endswith(".bst ") or p.endswith("/"):
complete_list.append(p)
return complete_list
def override_completions(cmd, cmd_param, args, incomplete):
......
......@@ -66,6 +66,13 @@ PROJECT_ELEMENTS = [
"target.bst"
]
INVALID_ELEMENTS = [
"target.foo"
"target.bst.bar"
]
MIXED_ELEMENTS = PROJECT_ELEMENTS + INVALID_ELEMENTS
def assert_completion(cli, cmd, word_idx, expected, cwd=None):
result = cli.run(cwd=cwd, env={
......@@ -85,6 +92,24 @@ def assert_completion(cli, cmd, word_idx, expected, cwd=None):
assert words == expected
def assert_completion_failed(cli, cmd, word_idx, expected, cwd=None):
result = cli.run(cwd=cwd, env={
'_BST_COMPLETION': 'complete',
'COMP_WORDS': cmd,
'COMP_CWORD': str(word_idx)
})
words = []
if result.output:
words = result.output.splitlines()
# The order is meaningless, bash will
# take the results and order it by its
# own little heuristics
words = sorted(words)
expected = sorted(expected)
assert words != expected
@pytest.mark.parametrize("cmd,word_idx,expected", [
('bst', 0, []),
('bst ', 1, MAIN_COMMANDS),
......@@ -193,19 +218,19 @@ def test_option_directory(datafiles, cli, cmd, word_idx, expected, subdir):
# When running in the project directory
('no-element-path', 'bst show ', 2,
[e + ' ' for e in (PROJECT_ELEMENTS + ['project.conf'])] + ['files/'], None),
[e + ' ' for e in PROJECT_ELEMENTS] + ['files/'], None),
('no-element-path', 'bst build com', 2,
['compose-all.bst ', 'compose-include-bin.bst ', 'compose-exclude-dev.bst '], None),
# When running from the files subdir
('no-element-path', 'bst show ', 2,
[e + ' ' for e in (PROJECT_ELEMENTS + ['project.conf'])] + ['files/'], 'files'),
[e + ' ' for e in PROJECT_ELEMENTS] + ['files/'], 'files'),
('no-element-path', 'bst build com', 2,
['compose-all.bst ', 'compose-include-bin.bst ', 'compose-exclude-dev.bst '], 'files'),
# When passing the project directory
('no-element-path', 'bst --directory ../ show ', 4,
[e + ' ' for e in (PROJECT_ELEMENTS + ['project.conf'])] + ['files/'], 'files'),
[e + ' ' for e in PROJECT_ELEMENTS] + ['files/'], 'files'),
('no-element-path', 'bst --directory ../ show f', 4, ['files/'], 'files'),
('no-element-path', 'bst --directory ../ show files/', 4, ['files/bin-files/', 'files/dev-files/'], 'files'),
('no-element-path', 'bst --directory ../ build com', 4,
......@@ -226,6 +251,19 @@ def test_argument_element(datafiles, cli, project, cmd, word_idx, expected, subd
assert_completion(cli, cmd, word_idx, expected, cwd=cwd)
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("project,cmd,word_idx,expected,subdir", [
# When element has invalid suffix
('project', 'bst --directory ../ show ', 4, [e + ' ' for e in MIXED_ELEMENTS], 'files')
])
def test_argument_element_invalid(datafiles, cli, project, cmd, word_idx, expected, subdir):
cwd = os.path.join(str(datafiles), project)
if subdir:
cwd = os.path.join(cwd, subdir)
assert_completion_failed(cli, cmd, word_idx, expected, cwd=cwd)
@pytest.mark.parametrize("cmd,word_idx,expected", [
('bst he', 1, ['help ']),
('bst help ', 2, MAIN_COMMANDS),
......
......@@ -60,6 +60,31 @@ def test_build_checkout(datafiles, cli, strict, hardlinks):
assert os.path.exists(filename)
@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):
......
kind: stack
description: |
Main stack target for the bst build test
kind: stack
description: |
Main stack target for the bst build test
depends:
- target.foo
......@@ -2,3 +2,6 @@
name: test
element-path: elements
fatal-warnings:
- bad-element-suffix
......@@ -33,7 +33,7 @@ def create_test_directory(*path, mode=0o644):
@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_cache):
project = str(datafiles)
element_name = 'list'
element_name = 'list.bst'
element_path = os.path.join(project, 'elements', element_name)
repodir = os.path.join(str(tmpdir), 'repo')
sourcedir = os.path.join(project, 'source')
......@@ -108,7 +108,7 @@ def test_deterministic_source_local(cli, tmpdir, datafiles, integration_cache):
"""Only user rights should be considered for local source.
"""
project = str(datafiles)
element_name = 'test'
element_name = 'test.bst'
element_path = os.path.join(project, 'elements', element_name)
sourcedir = os.path.join(project, 'source')
......