update dev300-m58
[ooovba.git] / dmake / tests / macros-2
blobc0d26260e0b69f83a0c1f721d34fc1a6ba8e45b8
1 #!/bin/sh
3 # 26.01.2006 Volker Quetschke
4 # TMD is sometimes set incorrectly (issue 61170).
6 : ${DMAKEPROG:=dmake}
7 file1="mfile1.mk"
8 file2="mfile2.mk"
9 file3="dirwith space"
10 tmpfiles="$file1 $file2"
12 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles "$file3"; }' 1 2 3 15
14 # Remove files from prior failed run
15 rm -rf $tmpfiles "$file3"
17 # Remember to quote variables in generated makefiles( $ -> \$ ).
18 # Testcase 1
19 cat > $file1 <<EOT
20 SHELL*:=/bin/sh
21 SHELLFLAGS*:=-ce
23 all .SETDIR=${TMP} :
24 +@echo \$(TMD)
26 EOT
28 # Testcase 2
29 mkdir -p "$file3"
30 cat > $file2 <<EOT
31 SHELL*:=/bin/sh
32 SHELLFLAGS*:=-ce
35 all ".SETDIR=dirwith space" :
36 +@echo \$(TMD)
37 EOT
39 output1=`eval ${DMAKEPROG} -r -f $file1`
40 result1=$?
41 output2=`eval ${DMAKEPROG} -r -f $file2`
42 result2=$?
44 if test "$output1" = ""; then
45 echo "Test 1: Wrong result"
46 result1=1
48 if test "$output2" != ".."; then
49 echo "Test 2: Wrong result"
50 result2=1
53 if test $result1 -eq 0 -a $result2 -eq 0; then
54 echo "Success - Cleaning up"
55 rm -rf $tmpfiles "$file3"
56 exit
57 result=0
58 else
59 echo "Failure!"
60 result=1
62 exit $result