kconfig: tests: test dependency after shuffling choices
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 20 Mar 2024 16:52:11 +0000 (01:52 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 20 Mar 2024 17:40:39 +0000 (02:40 +0900)
commitf2fd2aad1908554fbc4ad6e8ef23bad3086bebd1
tree8bcd491fa02e2f5998eb2ccd8fe7d5e3cbd9e98d
parent47ad16894c4a25e6cb342666f0fa203701a88476
kconfig: tests: test dependency after shuffling choices

Commit c8fb7d7e48d1 ("kconfig: fix broken dependency in randconfig-
generated .config") fixed the issue, but I did not add a test case.

This commit adds a test case that emulates the reported situation.
The test would fail without c8fb7d7e48d1.

To handle the choice "choose X", FOO must be calculated beforehand.
FOO depends on A, which is a member of another choice "choose A or B".
Kconfig _temporarily_ assumes the value of A to proceed. The choice
"choose A or B" will be shuffled later, but the result may or may not
meet "FOO depends on A". Kconfig should invalidate the symbol values
and recompute them.

In the real example for ARCH=arm64, the choice "Instrumentation type"
needs the value of CPU_BIG_ENDIAN. The choice "Endianness" will be
shuffled later.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/tests/choice_randomize2/Kconfig [new file with mode: 0644]
scripts/kconfig/tests/choice_randomize2/__init__.py [new file with mode: 0644]
scripts/kconfig/tests/choice_randomize2/expected_config0 [new file with mode: 0644]
scripts/kconfig/tests/choice_randomize2/expected_config1 [new file with mode: 0644]
scripts/kconfig/tests/choice_randomize2/expected_config2 [new file with mode: 0644]