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 <[email protected]>
  • Loading branch information
pdgendt committed Nov 25, 2024
1 parent db84746 commit 2d8ebf2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,22 @@ 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
output = cmd(['forall', jobs, '-c', '']).splitlines()
assert '=== running "" in manifest (zephyr):' in output

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 2d8ebf2

Please sign in to comment.