Update ooo320-m1
[ooovba.git] / dmake / tests / macros-6
blob8119f2ae84bb812b73187d39a1919262b67d4eed
1 #!/bin/sh
3 # 09.11.2006 Volker Quetschke
4 # Check that TMD honors if .SETDIR is used (with drive letters on cygwin)
5 # (issue 69821).
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 # Testcase 1
18 cat > $file1 <<EOT
19 SHELL*:=/bin/sh
20 SHELLFLAGS*:=-ce
22 .IMPORT .IGNORE : TEMP
23 .IF "\$(TEMP)"==""
24 TEMP:=/tmp
25 .ENDIF
28 # Test if .SETDIR works with drive letters
29 .IF "\$(subst,Cygwin, \$(shell @uname))"!="\$(shell @uname)"
30 SDIR:=\$(shell @+cygpath -d "\$(TEMP)")
31 .ELSE
32 SDIR:=\$(TEMP)
33 .ENDIF
35 # Make TEMP the target directory, cd to TMD should go back to
36 # the original directory
37 all ".SETDIR=\$(SDIR)" :
38 @+cd \$(TMD); pwd
40 EOT
43 output1=`eval ${DMAKEPROG} -r -f $file1`
44 result1=$?
46 if test "$output1" != "`pwd`"; then
47 echo "Test 1: Wrong result: ${output1}"
48 result1=1
49 else
50 echo "Test 1: OK"
53 if test $result1 -eq 0; then
54 echo "Success - Cleaning up"
55 rm -rf $tmpfiles
56 exit
57 result=0
58 else
59 echo "Failure!"
60 result=1
62 exit $result