build/pymake/tests/define-directive.mk

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 define COMMANDS
     2 shellvar=hello
     3 test "$$shellvar" != "hello"
     4 endef
     6 define COMMANDS2
     7 shellvar=hello; \
     8   test "$$shellvar" = "hello"
     9 endef
    11 define VARWITHCOMMENT # comment
    12 value
    13 endef
    15 define TEST3
    16   whitespace
    17 endef
    19 define TEST4
    20 define TEST5
    21 random
    22 endef
    23   endef
    25 ifdef TEST5
    26 $(error TEST5 should not be set)
    27 endif
    29 define TEST6
    30   define TEST7
    31 random
    32 endef
    33 endef
    35 ifdef TEST7
    36 $(error TEST7 should not be set)
    37 endif
    39 define TEST8
    40 is this # a comment?
    41 endef
    43 ifneq ($(TEST8),is this \# a comment?)
    44 $(error TEST8 value not expected: $(TEST8))
    45 endif
    47 # A backslash continuation "hides" the endef
    48 define TEST9
    49 value \
    50 endef
    51 endef
    53 # Test ridiculous spacing
    54  define TEST10
    55   	define TEST11
    56       baz
    57 endef
    58 define TEST12
    59   foo
    60   endef
    61     	endef
    63 all:
    64 	$(COMMANDS)
    65 	$(COMMANDS2)
    66 	test '$(VARWITHCOMMENT)' = 'value'
    67 	test '$(COMMANDS2)' = 'shellvar=hello; test "$$shellvar" = "hello"'
    68 	test "$(TEST3)" = "  whitespace"
    69 	@echo TEST-PASS

mercurial