diff options
| author | Roman <ztcoils@gmail.com> | 2018-02-27 10:04:36 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-02-27 09:04:36 +0100 |
| commit | aea0232a56d9a9d2611b79ea9c67e0d9d49b183f (patch) | |
| tree | 8460f167baa395761417259eec3326db937e651d /testsuite.py | |
| parent | 17026039bd81da7305b35c3d13b8d9cf45924a50 (diff) | |
Implement 'rsource' statement ('source' with relative path)
The 'rsource' statement works like 'source', but looks relative to the
Kconfig file that has the 'rsource' rather than relative to the base
Kconfig file. Using 'rsource' makes it possible to move subtrees with
Kconfig files around without breaking references to other Kconfig files.
So far, this is a Kconfiglib-exclusive feature.
Diffstat (limited to 'testsuite.py')
| -rw-r--r-- | testsuite.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/testsuite.py b/testsuite.py index fba897a..403fb06 100644 --- a/testsuite.py +++ b/testsuite.py @@ -787,7 +787,7 @@ g """) - print("Testing locations and 'source'") + print("Testing locations and 'source', 'rsource'") def verify_locations(nodes, *expected_locs): verify(len(nodes) == len(expected_locs), @@ -800,13 +800,15 @@ g .format(repr(node), expected_loc, node_loc)) # Expanded in the 'source' statement in Klocation - os.environ["EXPANDED_FROM_ENV"] = "tests" + os.environ["TESTS_DIR_FROM_ENV"] = "tests" + os.environ["SUB_DIR_FROM_ENV"] = "sub" os.environ["srctree"] = "Kconfiglib/" # Has symbol with empty help text, so disable warnings c = Kconfig("tests/Klocation", warn=False) - os.environ.pop("EXPANDED_FROM_ENV", None) + os.environ.pop("TESTS_DIR_FROM_ENV", None) + os.environ.pop("SUB_DIR_FROM_ENV", None) os.environ.pop("srctree", None) verify_locations(c.syms["SINGLE_DEF"].nodes, "tests/Klocation:4") @@ -814,17 +816,18 @@ g verify_locations(c.syms["MULTI_DEF"].nodes, "tests/Klocation:7", "tests/Klocation:31", - "tests/Klocation_included:3", - "tests/Klocation:47") + "tests/Klocation_sourced:3", + "tests/sub/Klocation_rsourced:2", + "tests/Klocation:57") verify_locations(c.named_choices["CHOICE"].nodes, - "tests/Klocation_included:5") + "tests/Klocation_sourced:5") verify_locations([c.syms["MENU_HOOK"].nodes[0].next], - "tests/Klocation_included:12") + "tests/Klocation_sourced:12") verify_locations([c.syms["COMMENT_HOOK"].nodes[0].next], - "tests/Klocation_included:18") + "tests/Klocation_sourced:18") # Test recursive 'source' detection |
