__init__.py 1.1 KB

12345678910111213141516171819202122232425
  1. # SPDX-License-Identifier: GPL-2.0
  2. """
  3. Test transitional symbol migration functionality for all Kconfig types.
  4. This tests that:
  5. - OLD_* options in existing .config cause NEW_* options to be set
  6. - OLD_* options are not written to the new .config file
  7. - NEW_* options appear in the new .config file with correct values
  8. - NEW_* options with defaults from transitional symbols are not prompted
  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. def test(conf):
  13. # Run olddefconfig to process the migration with the initial config
  14. assert conf.olddefconfig(dot_config='initial_config') == 0
  15. # Check that the configuration matches expected output
  16. assert conf.config_contains('expected_config')
  17. # Test oldconfig to ensure symbols with transitional defaults are not prompted
  18. assert conf.oldconfig(dot_config='initial_config', in_keys='n\n') == 0
  19. # Except for when conditional default evaluates to 'no'
  20. assert conf.stdout_contains('expected_stdout')