merge the formfield patch from ooo-build
[ooovba.git] / dmake / tests / macros-3
blobf3428fb8307ce7c33b8a60ade706ebf03b087bfa
1 #!/bin/sh
3 # 17.05.2006 Volker Quetschke
4 # Check that .INIT and .DONE are not mistaken for .<suffix> targets
5 # and that dmake warns if .<suffix> targets have prerequisites.
6 # (issue 65333).
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 - No warning expected
20 cat > $file1 <<EOT
21 SHELL*:=/bin/sh
22 SHELLFLAGS*:=-ce
24 all :
25 +@echo "all"
27 .INIT .DONE : something
28 +@echo "Dummy recipe"
30 something :
31 +@echo "just a target"
33 EOT
35 # Testcase 2 - dmake should warn
36 cat > $file2 <<EOT
37 SHELL*:=/bin/sh
38 SHELLFLAGS*:=-ce
40 .MYTARGET : something
41 +@echo ".MYTARGET"
43 something :
44 +@echo "just a target"
46 EOT
48 output1=`eval ${DMAKEPROG} -r -f $file1 2>&1 `
49 result1=$?
50 output2=`eval ${DMAKEPROG} -r -f $file2 2>&1 `
51 result2=$?
53 if test "$output1" != "all"; then
54 echo "Test 1: Wrong result: $output1"
55 result1=1
57 if echo $output2 | grep -v 'Warning: -- Ignoring' ; then
58 echo "Test 2: Wrong result: $output2"
59 result2=1
62 if test $result1 -eq 0 -a $result2 -eq 0; then
63 echo "Success - Cleaning up"
64 rm -rf $tmpfiles
65 exit
66 result=0
67 else
68 echo "Failure!"
69 result=1
71 exit $result