Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dmake / tests / macros-1
blob3eb0d57704f3a0f15f82c15860fc334f34fcdb7c
1 #!/bin/sh
3 # 01.06.2005 Volker Quetschke
4 # Tests for special dmake macros.
5 # (issue 37491)
7 : ${DMAKEPROG:=dmake}
8 file1="mymakefile.mk"
9 tmpfiles="$file1"
11 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
13 trap 'rm -rf $tmpfiles' 1 2 3 15
15 # Remember to quote variables in generated makefiles( $ -> \$ ).
16 cat > $file1 <<EOT
17 # Testing macros
18 SHELL*:=/bin/sh
19 SHELLFLAGS*:=-ce
21 TEST1:=a b c
22 PAT:=Z
24 all:
25 +@echo -e '\n\$\$(SPACECHAR) section'
26 +test ": :" = ":\$(SPACECHAR):"
28 +@echo -e '\n\$\$(MACRO:s/pat/rep/) section'
29 +test ":aZbZc:" = ":\$(TEST1:s/ /Z/):"
30 +test ":aZbZc:" = ":\$(TEST1:s/\$(SPACECHAR)/Z/):"
31 +test ":aZbZc:" = ":\$(TEST1:s/ /\$(PAT)/ ):"
33 EOT
35 ${DMAKEPROG} -r -f $file1
36 result=$?
38 test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
39 test $result -ne 0 && echo "Failure!"
40 exit $result