merge the formfield patch from ooo-build
[ooovba.git] / dmake / tests / recipes-5
blobb8887212a2722793dccda30e0283f344099b2181
1 #!/bin/sh
3 # 13.11.2006 Volker Quetschke
4 # Test @@ recipe property.
5 # (issue 71422)
7 : ${DMAKEPROG:=dmake}
8 file1="mfile1.mk"
9 file2="ofile1.out"
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 # Test @@ recipe
19 SHELL*:=/bin/sh
20 SHELLFLAGS*:=-ce
22 all :
23 @@+echo someoutput > $file2
24 @@+echo something
25 EOT
27 output1=`eval ${DMAKEPROG} -r -f $file1`
28 result1=$?
29 if test "$output1" != ""; then
30 echo "Wrong result: $output1"
31 result1=1
33 if test -f $file2; then
34 if test `cat $file2 ` != "someoutput"; then
35 echo "Wrong file content: `cat $file2`"
36 result1=1
38 else
39 echo "No such file : $file2"
40 result1=1
43 # Test if -vr enables the output again
44 output2=`eval ${DMAKEPROG} -vr -rf $file1`
45 result2=$?
46 if echo $output2 | grep -v 'echo someoutput > ofile1.out'; then
47 echo "Missing output: echo someoutput > ofile1.out"
48 result2=1
50 if echo $output2 | grep -v 'something'; then
51 echo "Missing output: something"
52 result2=1
55 if test $result1 -eq 0 -a $result2 -eq 0; then
56 echo "Success - Cleaning up"
57 rm -f ${tmpfiles}
58 exit 0
59 else
60 echo "Failure!"
61 exit 1