Skip to content

Commit

Permalink
tests: Add forall test cases
Browse files Browse the repository at this point in the history
Test using the environment variables in forall

Signed-off-by: Pieter De Gendt <[email protected]>
  • Loading branch information
pdgendt committed Jul 22, 2024
1 parent 64b8fba commit d2faa7a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
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"

Expand Down Expand Up @@ -378,6 +378,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):',
Expand Down

0 comments on commit d2faa7a

Please sign in to comment.