From 29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:21:29 +0200 Subject: Adding upstream version 1:0.1.9998svn3589+dfsg. Signed-off-by: Daniel Baumann --- src/kmk/tests/scripts/variables/flavors | 96 +++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 src/kmk/tests/scripts/variables/flavors (limited to 'src/kmk/tests/scripts/variables/flavors') diff --git a/src/kmk/tests/scripts/variables/flavors b/src/kmk/tests/scripts/variables/flavors new file mode 100644 index 0000000..ba133ea --- /dev/null +++ b/src/kmk/tests/scripts/variables/flavors @@ -0,0 +1,96 @@ +# -*-perl-*- + +$description = "Test various flavors of make variable setting."; + +$details = ""; + +# TEST 0: Recursive + +run_make_test(' +ugh = Goodbye +foo = $(bar) +bar = ${ugh} +ugh = Hello +all: ; @echo $(foo) +', + '', "Hello\n"); + +# TEST 1: Simple + +run_make_test(' +bar = Goodbye +foo := $(bar) +bar = ${ugh} +ugh = Hello +all: ; @echo $(foo) +', + '', "Goodbye\n"); + +# TEST 2: Append to recursive + +run_make_test(' +foo = Hello +ugh = Goodbye +foo += $(bar) +bar = ${ugh} +ugh = Hello +all: ; @echo $(foo) +', + '', "Hello Hello\n"); + +# TEST 3: Append to simple + +run_make_test(' +foo := Hello +ugh = Goodbye +bar = ${ugh} +foo += $(bar) +ugh = Hello +all: ; @echo $(foo) +', + '', "Hello Goodbye\n"); + +# TEST 4: Conditional pre-set + +run_make_test(' +foo = Hello +ugh = Goodbye +bar = ${ugh} +foo ?= $(bar) +ugh = Hello +all: ; @echo $(foo) +', + '', "Hello\n"); + +# TEST 5: Conditional unset + +run_make_test(' +ugh = Goodbye +bar = ${ugh} +foo ?= $(bar) +ugh = Hello +all: ; @echo $(foo) +', + '', "Hello\n"); + +# TEST 6: Simple using POSIX syntax +run_make_test(' +bar = Goodbye +foo ::= $(bar) +bar = ${ugh} +ugh = Hello +all: ; @echo $(foo) +', + '', "Goodbye\n"); + +# TEST 7: POSIX syntax no spaces +run_make_test(' +bar = Goodbye +foo::=$(bar) +bar = ${ugh} +ugh = Hello +all: ; @echo $(foo) +', + '', "Goodbye\n"); + +1; -- cgit v1.2.3