From: Louis Rannou <louis.rannou@syslinbit.com>
To: bitbake-devel@lists.openembedded.org
Cc: Louis Rannou <louis.rannou@syslinbit.com>,
louis.rannou@non.se.com, pascal.eberhard@se.com,
yoann.congal@smile.fr
Subject: [PATCH 2/2] bitbake: tests/parse: add test for getVarFlags
Date: Wed, 12 Feb 2025 13:16:19 +0100 [thread overview]
Message-ID: <20250212-varflags-v1-2-3a756c7aa95c@syslinbit.com> (raw)
In-Reply-To: <20250212-varflags-v1-0-3a756c7aa95c@syslinbit.com>
From: Louis Rannou <louis.rannou@non.se.com>
Run the test with:
$ bitbake-selftest bb.tests.parse.ParseTest.test_parse_defaulttest
test_parse_defaulttest (bb.tests.parse.ParseTest.test_parse_defaulttest) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK
This is a test case for [YOCTO #15685]
Signed-off-by: Louis Rannou <louis.rannou@non.se.com>
---
lib/bb/tests/parse.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py
index e3cba67ad448a491ee9c094e6725eb68eba14b32..74a6c54ad1908357b65c37c37c8b8c299fd5f3bc 100644
--- a/lib/bb/tests/parse.py
+++ b/lib/bb/tests/parse.py
@@ -127,6 +127,22 @@ A[flag_default_twice] ??= "default flag second"
self.assertEqual(d.getVarFlag("A","flag_set_twice"), "set flag second")
self.assertEqual(d.getVarFlag("A","flag_question_twice"), "question flag first")
self.assertEqual(d.getVarFlag("A","flag_default_twice"), "default flag second")
+ self.assertDictEqual(
+ d.getVarFlags("A"),
+ {
+ "flag_set_vs_question": "set flag",
+ "flag_set_vs_default": "set flag",
+ "flag_question": "question flag",
+ "flag_default": "default flag",
+ "flag_question_vs_default": "question flag",
+ "flag_default_vs_question": "question flag",
+ "flag_set_question_default": "set flag",
+ "flag_set_default_question": "set flag",
+ "flag_set_twice": "set flag second",
+ "flag_question_twice": "question flag first",
+ "flag_default_twice": "default flag second",
+ }
+ )
exporttest = """
A = "a"
--
2.48.1
prev parent reply other threads:[~2025-02-12 12:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 12:16 [PATCH 0/2] bitbake: fix ??= operator for getVarFlags and test Louis Rannou
2025-02-12 12:16 ` [PATCH 1/2] bitbake: data_smart: fix ??= operator for getVarFlags Louis Rannou
2025-02-12 14:00 ` [bitbake-devel] " Richard Purdie
2025-02-12 14:13 ` Richard Purdie
2025-02-12 17:01 ` Louis Rannou
2025-02-12 12:16 ` Louis Rannou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250212-varflags-v1-2-3a756c7aa95c@syslinbit.com \
--to=louis.rannou@syslinbit.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=louis.rannou@non.se.com \
--cc=pascal.eberhard@se.com \
--cc=yoann.congal@smile.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.