3 # 01.06.2005 Volker Quetschke
4 # Tests for dmake function macros. (issue 36027, issue 37053)
10 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
12 trap 'rm -rf $tmpfiles' 1 2 3 15
14 # Remember to quote variables in generated makefiles( $ -> \$ ).
16 # Testing function macros
23 @echo \$\$(and ...) section
24 test "::" = ":\$(and \$(nil) \$(nil) ):"
25 test ":t:" = ":\$(and a b ):"
26 test "::" = ":\$(and \$(nil) \
28 test "::" = ":\$(and \
31 @echo -e \n\$\$(assign ...) section
32 test ":A:" = ":\$(assign A := B ):"
34 test ":A:" = ":\$(assign A\
38 @echo -e \n\$\$(echo ...) section
39 test ":123:" = ":\$(echo 123 ):"
40 test ":123:" = ":\$(echo 123 ):"
41 test ":123:" = ":\$(echo\
43 test ":123:" = ":\$(echo \
46 @echo -e \n\$\$(eq ...) section
47 test ":true:" = ":\$(eq,1,1 true false):"
48 test ":true:" = ":\$(eq,1,1\
51 # These tests need to use a shell
52 +@echo -e '\n\$\$(foreach ...) section'
53 +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) [\$i]):"
54 +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) [\$i]):"
55 +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) [\$i] ):"
56 +test ":[a] [b] [c]:" = ":\$(foreach,i,\$(TEST1) \
59 @echo -e \n\$\$(nil ...) section
60 test "::" = ":\$(nil abc):"
61 # Fails with syntax error
62 test "::" = ":\$(nil \
65 @echo -e \n\$\$(not ...) section
66 test "::" = ":\$(not abc):"
67 test ":t:" = ":\$(not \$(NULL)):"
68 test ":t:" = ":\$(not ):"
69 test ":t:" = ":\$(not \
72 @echo -e \n\$\$(null ...) section
73 test ":true:" = ":\$(null, true false):"
74 test ":false:" = ":\$(null,a true false):"
75 test ":false:" = ":\$(null,a true false ):"
76 test ":false:" = ":\$(null,a \
78 test ":true:" = ":\$(null, \
81 @echo -e \n\$\$(or ...) section
82 test "::" = ":\$(or \$(nil) \$(nil) ):"
83 test ":t:" = ":\$(or a \$(nil) ):"
84 test "::" = ":\$(or \$(nil) \
91 ${DMAKEPROG} -r -f $file1
94 test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
95 test $result -ne 0 && echo "Failure!"