diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 3 | ||||
-rw-r--r-- | tests/scripts/variables/define | 50 | ||||
-rw-r--r-- | tests/scripts/variables/flavors | 20 |
3 files changed, 72 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 3e0643c..7ad4085 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,8 @@ 2012-01-29 Paul Smith <psmith@gnu.org> + * scripts/variables/flavors: Add tests for ::= + * scripts/variables/define: Ditto + * scripts/functions/file: Test the new $(file ...) function. 2012-01-12 Paul Smith <psmith@gnu.org> diff --git a/tests/scripts/variables/define b/tests/scripts/variables/define index f91519e..68d493b 100644 --- a/tests/scripts/variables/define +++ b/tests/scripts/variables/define @@ -30,6 +30,10 @@ define simple := @echo $(FOO) endef +define posix ::= +@echo $(FOO) +endef + append = @echo a define append += @@ -49,10 +53,54 @@ FOO = there all: ; $(multi) $(simple) + $(posix) + $(append) + $(cond) +', + '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n"); + +# TEST 1a: Various new-style define/endef, with no spaces + +run_make_test(' +FOO = foo + +define multi= +echo hi +@echo $(FOO) +endef # this is the end + +define simple:= +@echo $(FOO) +endef + +define posix::= +@echo $(FOO) +endef + +append = @echo a + +define append+= + +@echo b +endef + +define cond?= # this is a conditional +@echo first +endef + +define cond?= +@echo second +endef + +FOO = there + +all: ; $(multi) + $(simple) + $(posix) $(append) $(cond) ', - '', "echo hi\nhi\nthere\nfoo\na\nb\nfirst\n"); + '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n"); # TEST 2: define in true section of conditional (containing conditional) diff --git a/tests/scripts/variables/flavors b/tests/scripts/variables/flavors index 92feed6..ba133ea 100644 --- a/tests/scripts/variables/flavors +++ b/tests/scripts/variables/flavors @@ -73,4 +73,24 @@ 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; |