Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dmake / tests / recipes-6
blob2a0af305ef6a950516ae2d6bd3c4a9fb32d9dbdb
1 #!/bin/sh
3 # 13.11.2006 Volker Quetschke
4 # Test @@ recipe property with group recipes.
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
21 GROUPSHELL*:=/bin/sh
22 GROUPSUFFIX:=.sh
24 all :
25 @@[
26 echo someoutput > $file2
27 echo something
29 EOT
31 output1=`eval ${DMAKEPROG} -r -f $file1`
32 result1=$?
33 if test "$output1" != ""; then
34 echo "Wrong result: $output1"
35 result1=1
37 if test -f $file2; then
38 if test `cat $file2` != "someoutput"; then
39 echo "Wrong file content: `cat $file2`"
40 result1=1
42 else
43 echo "No such file : $file2"
44 result1=1
47 # Test if -vr enables the output again
48 output2=`eval ${DMAKEPROG} -vr -rf $file1`
49 result2=$?
50 if echo $output2 | grep -v 'echo someoutput > ofile1.out'; then
51 echo "Missing output: echo someoutput > ofile1.out"
52 result2=1
54 if echo $output2 | grep -v 'something'; then
55 echo "Missing output: something"
56 result2=1
59 if test $result1 -eq 0 -a $result2 -eq 0; then
60 echo "Success - Cleaning up"
61 rm -f ${tmpfiles}
62 exit 0
63 else
64 echo "Failure!"
65 exit 1