diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Kuserfunctions | 3 | ||||
| -rw-r--r-- | tests/kconfigfunctions.py | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/Kuserfunctions b/tests/Kuserfunctions index 89b4442..b0bf630 100644 --- a/tests/Kuserfunctions +++ b/tests/Kuserfunctions @@ -9,3 +9,6 @@ one-two = $(one,foo bar,baz) one-or-more-zero = $(one-or-more) one-or-more-one = $(one-or-more,foo) one-or-more-three = $(one-or-more,foo,bar,baz) + +location-1 := $(location) +location-2 := $(location) diff --git a/tests/kconfigfunctions.py b/tests/kconfigfunctions.py index e760468..8f35511 100644 --- a/tests/kconfigfunctions.py +++ b/tests/kconfigfunctions.py @@ -1,14 +1,22 @@ def add(kconf, name, *args): return str(sum(map(int, args))) + def one(kconf, name, s): return name + 2*s + def one_or_more(kconf, name, arg, *args): return arg + " + " + ",".join(args) + +def location(kconf, name): + return "{}:{}".format(kconf.filename, kconf.linenr) + + functions = { "add": (add, 0, None), "one": (one, 1, 1), "one-or-more": (one_or_more, 1, None), + "location": (location, 0, 0), } |
