tests: Add forall test cases

Test using the environment variables in forall

Signed-off-by: Pieter De Gendt <pieter.degendt@gmail.com>
This commit is contained in:
Pieter De Gendt 2024-07-19 22:08:27 +02:00 committed by Carles Cufí
parent 659319fe60
commit b69c85e2e5
1 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,7 @@ from west.manifest import Manifest, ManifestProject, Project, \
from west.manifest import ImportFlag as MIF
from conftest import create_branch, create_workspace, create_repo, \
add_commit, add_tag, check_output, cmd, GIT, rev_parse, \
check_proj_consistency
check_proj_consistency, WINDOWS
assert 'TOXTEMPDIR' in os.environ, "you must run these tests using tox"
@ -379,6 +379,16 @@ def test_forall(west_init_tmpdir):
'=== running "echo foo" in net-tools (net-tools):',
'foo']
# Use environment variables
env_var = "%WEST_PROJECT_NAME%" if WINDOWS else "$WEST_PROJECT_NAME"
assert cmd(f'forall -c "echo {env_var}"').splitlines() == [
f'=== running "echo {env_var}" in manifest (zephyr):',
'manifest',
f'=== running "echo {env_var}" in net-tools (net-tools):',
'net-tools']
cmd('update Kconfiglib')
assert cmd('forall -c "echo foo"').splitlines() == [
'=== running "echo foo" in manifest (zephyr):',