update dev300-m58
[ooovba.git] / dmake / tests / function_macros-3
blobbd8d06b3de27fdcf09b5ccffb64cf577798e43de
1 #!/bin/sh
3 # 04.09.2005 Volker Quetschke
4 # Tests $(shell ..) function macro when using two concurrend processes.
5 # (issue 53148)
7 : ${DMAKEPROG:=dmake}
8 file1="makefile.mk"
9 file2="stdout.txt"
10 tmpfiles="$file1 $file2"
12 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
14 trap 'rm -rf $tmpfiles' 1 2 3 15
16 # Remember to quote variables in generated makefiles( $ -> \$ ).
17 cat > $file1 <<EOT
18 # Testing continuation char in recipes
19 SHELL*:=/bin/sh
20 SHELLFLAGS*:=-ce
22 AA=X\$(shell +echo shellexec)X
24 $file2 :
25 +@echo b0
26 +@echo b1
27 +@echo b2
28 +@echo A\$(AA)A > $file2
29 EOT
31 ${DMAKEPROG} -P2 -r -f $file1
32 result=$?
33 if test "`cat $file2`" != "AXshellexecXA"; then
34 echo "Wrong result: `cat $file2`, AXshellexecXA expected!"
35 result=1
38 test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
39 test $result -ne 0 && echo "Failure!"
40 exit $result