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