Skip to content

Commit 2634eb5

Browse files
committed
tests: Add test for 'forall' with jobs
Add test cases for running the forall command with multiple processes. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 06fd709 commit 2634eb5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_project.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,23 @@ def test_forall(west_init_tmpdir):
417417
]
418418

419419

420+
@pytest.mark.parametrize("jobs", ["-j 1", "-j 2", "-j"])
421+
def test_forall_jobs(jobs, west_init_tmpdir):
422+
# 'forall' with no projects cloned shouldn't fail
423+
assert cmd(['forall', jobs, '-c', 'echo foo']).splitlines() == [
424+
'=== running "echo foo" in manifest (zephyr):',
425+
'foo']
426+
427+
cmd('update net-tools Kconfiglib')
428+
429+
# print order is no longer guaranteed when there are multiple projects
430+
output = cmd(['forall', jobs, '-c', '']).splitlines()
431+
432+
assert '=== running "" in manifest (zephyr):' in output
433+
assert '=== running "" in net-tools (net-tools):' in output
434+
assert '=== running "" in Kconfiglib (subdir/Kconfiglib):' in output
435+
436+
420437
def test_grep(west_init_tmpdir):
421438
# Make sure we don't find things we don't expect, and do find
422439
# things we do.

0 commit comments

Comments
 (0)