diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-08 06:49:30 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-08 06:49:30 +0100 |
| commit | a21d4585f2299df64cdb60af86c254aa4aa8da72 (patch) | |
| tree | d68d1c61d5c4715a83c774ce23bad78083728902 | |
| parent | 5522b013598a9905a85e9e0947e24d25c56356fe (diff) | |
Test the actual allno/yesconfig.py scripts.
No need to duplicate them in the test suite, and we also get coverage of
'make scriptconfig'.
| -rw-r--r-- | kconfigtest.py | 100 |
1 files changed, 18 insertions, 82 deletions
diff --git a/kconfigtest.py b/kconfigtest.py index 171d2fd..cdebc4d 100644 --- a/kconfigtest.py +++ b/kconfigtest.py @@ -286,8 +286,8 @@ def run_compatibility_tests(): # tree -- currently, all tests. The boolean flag indicates whether .config # (generated by the C implementation) should be compared to ._config # (generated by us) after each invocation. - all_arch_tests = [(test_all_no, True), - (test_config_absent, True), + all_arch_tests = [(test_config_absent, True), + (test_all_no, True), (test_all_yes, True), (test_call_all, False), # Needs to report success/failure for each arch/defconfig @@ -383,37 +383,14 @@ def get_arch_configs(): # docstring ourselves def test_all_no(conf): """ - Test if our allnoconfig implementation generates the same .config as - 'make allnoconfig' for each architecture.""" - - while True: - done = True - - for sym in conf: - # Choices take care of themselves for allnoconf, so we only need to - # worry about non-choice symbols - if not sym.is_choice_item(): - lower_bound = sym.get_lower_bound() - - # If we can assign a lower value to the symbol (where "n", "m" and - # "y" are ordered from lowest to highest), then do so. - # lower_bound() returns None for symbols whose values cannot - # (currently) be changed, as well as for non-bool, non-tristate - # symbols. - if lower_bound is not None and \ - kconfiglib.tri_less(lower_bound, sym.calc_value()): - - sym.set_value(lower_bound) - - # We just changed the value of some symbol. As this may effect - # other symbols, we need to keep looping. - done = False - - if done: - break - - conf.write_config("._config") - + Test if our examples/allnoconfig.py script generates the same .config as + 'make allnoconfig' for each architecture. Runs the script via + 'make scriptconfig' and needs to reparse the configurations, so kinda slow + even in speedy mode.""" + + # TODO: Support speedy mode for running the script + shell("make scriptconfig SCRIPT=Kconfiglib/examples/allnoconfig.py") + shell("mv .config ._config") if speedy_mode: shell("scripts/kconfig/conf --allnoconfig Kconfig") else: @@ -421,55 +398,14 @@ def test_all_no(conf): def test_all_yes(conf): """ - Test if our allyesconfig implementation generates the same .config as - 'make allyesconfig' for each architecture.""" - - # Get a list of all symbols that are not choice items - non_choice_syms = [sym for sym in conf.get_symbols() if - not sym.is_choice_item()] - - while True: - done = True - - # Handle symbols outside of choices - - for sym in non_choice_syms: - upper_bound = sym.get_upper_bound() - - # See corresponding comment for allnoconf implementation - if upper_bound is not None and \ - kconfiglib.tri_less(sym.calc_value(), upper_bound): - sym.set_value(upper_bound) - done = False - - # Handle symbols within choices - - for choice in conf.get_choices(): - - # Handle choices whose visibility allow them to be in "y" mode - - if choice.get_visibility() == "y": - selection = choice.get_selection_from_defaults() - if selection is not None and \ - selection is not choice.get_user_selection(): - selection.set_value("y") - done = False - - # Handle choices whose visibility only allow them to be in "m" mode - - elif choice.get_visibility() == "m": - for sym in choice.get_items(): - if sym.calc_value() != "m" and \ - sym.get_upper_bound() != "n": - sym.set_value("m") - done = False - - - if done: - break - - conf.write_config("._config") - + Test if our examples/allyesconfig.py script generates the same .config as + 'make allyesconfig' for each architecture. Runs the script via + 'make scriptconfig' and needs to reparse the configurations, so kinda slow + even in speedy mode.""" + + # TODO: Support speedy mode for running the script + shell("make scriptconfig SCRIPT=Kconfiglib/examples/allyesconfig.py") + shell("mv .config ._config") if speedy_mode: shell("scripts/kconfig/conf --allyesconfig Kconfig") else: |
