update dev300-m58
[ooovba.git] / dmake / tests / misc-6
blob9f74f1e77cc60195e54d34a254b9b05db53cecde
1 #!/bin/sh
3 # 05.01.2006 Volker Quetschke
4 # Old dmakes throw a segmentation fault in special cases with
5 # dynamic prerequisits ( $$@ ).
6 # (issue 58259)
8 : ${DMAKEPROG:=dmake}
9 file1="mfile1.mk"
10 file2="mfile2.mk"
11 tmpfiles="$file1 $file2"
13 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
15 # Remove files from prior failed run
16 rm -rf $tmpfiles
18 # Remember to quote variables in generated makefiles( $ -> \$ ).
19 # Testcase 1
20 cat > $file1 <<EOT
21 SHELL*:=/bin/sh
22 SHELLFLAGS*:=-ce
24 all : allA allB
26 all : \$\$@A \$\$@B
28 allA :
29 +echo XaX
31 allB :
32 +echo XbX
33 EOT
35 # Testcase 2
36 cat > $file2 <<EOT
37 SHELL*:=/bin/sh
38 SHELLFLAGS*:=-ce
40 all : \$\$@A \$\$@B
42 all : allA allB
44 allA :
45 +echo XaX
47 allB :
48 +echo XbX
49 EOT
51 ${DMAKEPROG} -r -f $file1 >/dev/null 2>&1
52 result1=$?
53 ${DMAKEPROG} -r -f $file2 >/dev/null 2>&1
54 result2=$?
56 if test $result1 -eq 0 -a $result2 -eq 0; then
57 echo "Success - Cleaning up"
58 rm -f ${tmpfiles}
59 result=0
60 else
61 test $result1 -ne 0 && echo "Failure in testcase 1! Remove the corefile!"
62 test $result2 -ne 0 && echo "Failure in testcase 2! Remove the corefile!"
63 result=1
65 exit $result