merge the formfield patch from ooo-build
[ooovba.git] / dmake / tests / recipes-8
blobb4264a33df0c87f4b44a256181060b88df6ec031
1 #!/bin/sh
3 # 08.08.2007 Volker Quetschke
4 # Test group recipes syntax check.
5 # (issue 67709)
7 : ${DMAKEPROG:=dmake}
8 file1="mfile1.mk"
9 tmpfiles="$file1"
11 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
13 # Remove files from prior failed run
14 rm -rf $tmpfiles
16 # Remember to quote variables in generated makefiles( $ -> \$ ).
17 # Test 1
18 cat > $file1 <<EOT
19 SHELL*:=/bin/sh
20 SHELLFLAGS*:=-ce
21 GROUPSHELL*:=/bin/sh
23 all :
24 [ This should warn!
25 @echo "Group recipe line"
28 EOT
30 output1=`eval ${DMAKEPROG} -r -f $file1 2>&1`
31 result1=$?
33 if test $result1 != 0 && echo $output1 | grep 'Warning: -- Found non-white space character after' > /dev/null 2>&1 ; then
34 echo "Subtest 1: OK"
35 result1=0
36 else
37 echo "Subtest 1: Wrong result: $output1"
38 echo
39 result1=1
43 # Test 2
44 cat > $file1 <<EOT
45 SHELL*:=/bin/sh
46 SHELLFLAGS*:=-ce
47 GROUPSHELL*:=/bin/sh
49 all :
50 echo hallo
52 echo "Group recipe line"
55 EOT
57 output2=`eval ${DMAKEPROG} -r -f $file1 2>&1`
58 result2=$?
60 if test $result2 != 0 && echo $output2 | grep 'Error: -- Cannot mix single and group recipe lines.' > /dev/null 2>&1 ; then
61 echo "Subtest 2: OK"
62 result2=0
63 else
64 echo "Subtest 2: Wrong result: $output2"
65 echo
66 result2=1
70 # Test 3
71 cat > $file1 <<EOT
72 SHELL*:=/bin/sh
73 SHELLFLAGS*:=-ce
74 GROUPSHELL*:=/bin/sh
76 all :
79 echo "Group recipe line"
82 EOT
84 output3=`eval ${DMAKEPROG} -r -f $file1 2>&1`
85 result3=$?
86 if test $result3 != 0 && echo $output3 | grep 'Error: -- New group recipe begin found within group recipe.' > /dev/null 2>&1 ; then
87 echo "Subtest 3: OK"
88 result3=0
89 else
90 echo "Subtest 3: Wrong result: $output3"
91 echo
92 result3=1
97 if test $result1 -eq 0 -a $result2 -eq 0 \
98 -a $result3 -eq 0 ; then
99 echo "Success - Cleaning up" && rm -f ${tmpfiles}
100 exit
101 else
102 echo "Failure!"
103 exit 1