Loading scripts/kconfig/tests/preprocess/builtin_func/Kconfig 0 → 100644 +27 −0 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 # 'info' prints the argument to stdout. $(info,hello world 0) # 'warning-if', if the first argument is y, sends the second argument to stderr, # and the message is prefixed with the current file name and line number. $(warning-if,y,hello world 1) # 'error-if' is similar, but it terminates the parsing immediately. # The following is just no-op since the first argument is not y. $(error-if,n,this should not be printed) # Shorthand warning = $(warning-if,y,$(1)) # 'shell' executes a command, and returns its stdout. $(warning,$(shell,echo hello world 3)) # Every newline in the output is replaced with a space, # but any trailing newlines are deleted. $(warning,$(shell,printf 'hello\nworld\n\n4\n\n\n')) # 'filename' is expanded to the currently parsed file name, # 'lineno' to the line number. $(warning,filename=$(filename)) $(warning,lineno=$(lineno)) scripts/kconfig/tests/preprocess/builtin_func/__init__.py 0 → 100644 +9 −0 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 """ Built-in function tests. """ def test(conf): assert conf.oldaskconfig() == 0 assert conf.stdout_contains('expected_stdout') assert conf.stderr_matches('expected_stderr') scripts/kconfig/tests/preprocess/builtin_func/expected_stderr 0 → 100644 +5 −0 Original line number Diff line number Diff line Kconfig:8: hello world 1 Kconfig:18: hello world 3 Kconfig:22: hello world 4 Kconfig:26: filename=Kconfig Kconfig:27: lineno=27 scripts/kconfig/tests/preprocess/builtin_func/expected_stdout 0 → 100644 +1 −0 Original line number Diff line number Diff line hello world 0 scripts/kconfig/tests/preprocess/circular_expansion/Kconfig 0 → 100644 +5 −0 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 X = $(Y) Y = $(X) $(info $(X)) Loading
scripts/kconfig/tests/preprocess/builtin_func/Kconfig 0 → 100644 +27 −0 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 # 'info' prints the argument to stdout. $(info,hello world 0) # 'warning-if', if the first argument is y, sends the second argument to stderr, # and the message is prefixed with the current file name and line number. $(warning-if,y,hello world 1) # 'error-if' is similar, but it terminates the parsing immediately. # The following is just no-op since the first argument is not y. $(error-if,n,this should not be printed) # Shorthand warning = $(warning-if,y,$(1)) # 'shell' executes a command, and returns its stdout. $(warning,$(shell,echo hello world 3)) # Every newline in the output is replaced with a space, # but any trailing newlines are deleted. $(warning,$(shell,printf 'hello\nworld\n\n4\n\n\n')) # 'filename' is expanded to the currently parsed file name, # 'lineno' to the line number. $(warning,filename=$(filename)) $(warning,lineno=$(lineno))
scripts/kconfig/tests/preprocess/builtin_func/__init__.py 0 → 100644 +9 −0 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 """ Built-in function tests. """ def test(conf): assert conf.oldaskconfig() == 0 assert conf.stdout_contains('expected_stdout') assert conf.stderr_matches('expected_stderr')
scripts/kconfig/tests/preprocess/builtin_func/expected_stderr 0 → 100644 +5 −0 Original line number Diff line number Diff line Kconfig:8: hello world 1 Kconfig:18: hello world 3 Kconfig:22: hello world 4 Kconfig:26: filename=Kconfig Kconfig:27: lineno=27
scripts/kconfig/tests/preprocess/builtin_func/expected_stdout 0 → 100644 +1 −0 Original line number Diff line number Diff line hello world 0
scripts/kconfig/tests/preprocess/circular_expansion/Kconfig 0 → 100644 +5 −0 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 X = $(Y) Y = $(X) $(info $(X))