xref: /linux/scripts/kconfig/tests/transitional/__init__.py (revision a5ba183bdeeeedd5f5b683c02561072848258496)
1# SPDX-License-Identifier: GPL-2.0
2"""
3Test transitional symbol migration functionality for all Kconfig types.
4
5This tests that:
6- OLD_* options in existing .config cause NEW_* options to be set
7- OLD_* options are not written to the new .config file
8- NEW_* options appear in the new .config file with correct values
9- All Kconfig types work correctly: bool, tristate, string, hex, int
10- User-set NEW values take precedence over conflicting OLD transitional values
11"""
12
13def test(conf):
14    # Run olddefconfig to process the migration with the initial config
15    assert conf.olddefconfig(dot_config='initial_config') == 0
16
17    # Check that the configuration matches expected output
18    assert conf.config_contains('expected_config')
19