Skip to content

Commit

Permalink
tests: Add test for 'forall' with jobs
Browse files Browse the repository at this point in the history
Add test cases for running the forall command with multiple processes.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
  • Loading branch information
pdgendt committed Oct 17, 2024
1 parent 06fd709 commit 2634eb5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,23 @@ def test_forall(west_init_tmpdir):
]


@pytest.mark.parametrize("jobs", ["-j 1", "-j 2", "-j"])
def test_forall_jobs(jobs, west_init_tmpdir):
# 'forall' with no projects cloned shouldn't fail
assert cmd(['forall', jobs, '-c', 'echo foo']).splitlines() == [
'=== running "echo foo" in manifest (zephyr):',
'foo']

cmd('update net-tools Kconfiglib')

# print order is no longer guaranteed when there are multiple projects
output = cmd(['forall', jobs, '-c', '']).splitlines()

assert '=== running "" in manifest (zephyr):' in output
assert '=== running "" in net-tools (net-tools):' in output
assert '=== running "" in Kconfiglib (subdir/Kconfiglib):' in output


def test_grep(west_init_tmpdir):
# Make sure we don't find things we don't expect, and do find
# things we do.
Expand Down

0 comments on commit 2634eb5

Please sign in to comment.