Skip to content

Commit 89fe7cd

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 5e6eb57 commit 89fe7cd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_project.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,22 @@ def test_forall(west_init_tmpdir):
554554
]
555555

556556

557+
@pytest.mark.parametrize("jobs", ["-j 1", "-j 2", "-j"])
558+
def test_forall_jobs(jobs, west_init_tmpdir):
559+
# 'forall' with no projects cloned shouldn't fail
560+
output = cmd(['forall', jobs, '-c', '']).splitlines()
561+
assert '=== running "" in manifest (zephyr):' in output
562+
563+
cmd('update net-tools Kconfiglib')
564+
565+
# print order is no longer guaranteed when there are multiple projects
566+
output = cmd(['forall', jobs, '-c', '']).splitlines()
567+
568+
assert '=== running "" in manifest (zephyr):' in output
569+
assert '=== running "" in net-tools (net-tools):' in output
570+
assert '=== running "" in Kconfiglib (subdir/Kconfiglib):' in output
571+
572+
557573
def test_grep(west_init_tmpdir):
558574
# Make sure we don't find things we don't expect, and do find
559575
# things we do.

0 commit comments

Comments
 (0)