From d0079669f97d9e9c8731e6b35cc83a5272b55fa0 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Thu, 6 Feb 2025 21:01:38 +0100 Subject: [PATCH] tests: project: Add test for update cloned option Add a test case for passing --cloned to west update or as a configuration option. Signed-off-by: Pieter De Gendt --- tests/test_project.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/test_project.py b/tests/test_project.py index 322d4d39..7f9bcd42 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -379,7 +379,6 @@ def test_status(west_init_tmpdir): cmd('update Kconfiglib') - def test_forall(west_init_tmpdir): # Note that the 'echo' command is available in both Unix shells # and Windows .bat files. @@ -1521,6 +1520,28 @@ def test_update_narrow_depth1(tmpdir): assert len(refs) == 1 +def test_update_cloned(west_init_tmpdir): + # Manually update a single project + cmd('update Kconfiglib') + + cmd('update --cloned') + assert (west_init_tmpdir / 'subdir' / 'Kconfiglib').check(dir=1) + assert (west_init_tmpdir / 'tagged_repo').check(dir=0) + assert (west_init_tmpdir / 'net-tools').check(dir=0) + + cmd('config update.cloned true') + cmd('update') + assert (west_init_tmpdir / 'subdir' / 'Kconfiglib').check(dir=1) + assert (west_init_tmpdir / 'tagged_repo').check(dir=0) + assert (west_init_tmpdir / 'net-tools').check(dir=0) + + cmd('config update.cloned false') + cmd('update') + assert (west_init_tmpdir / 'subdir' / 'Kconfiglib').check(dir=1) + assert (west_init_tmpdir / 'tagged_repo').check(dir=1) + assert (west_init_tmpdir / 'net-tools').check(dir=1) + + def test_init_again(west_init_tmpdir): # Test that 'west init' on an initialized tmpdir errors out # with a message that indicates it's already initialized.