Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / dmake / tests / targets-19
blob3ca904f53e8d066e63ae331a35fee0ee58d4074b
1 #!/bin/sh
3 # 22.06.2007 Volker Quetschke
4 # Check that multiple leading slashes are normalized.
5 # (issue 78061)
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 - Test if excess leading slashes get removed
18 cat > $file1 <<EOT
19 SHELL*:=/bin/sh
20 SHELLFLAGS*:=-ce
22 ////all :
23 @echo X\$@Y
25 EOT
27 output1=`eval ${DMAKEPROG} -rf $file1 2>&1 `
28 result1=$?
29 if test "$output1" != "X/allY"; then
30 echo "Subtest 1: Wrong result: $output1"
31 result1=1
32 else
33 echo "Subtest 1: OK"
34 fi
37 # Test 2 - Test if excess leading slashes in DOS paths get removed
38 cat > $file1 <<EOT
39 SHELL*:=/bin/sh
40 SHELLFLAGS*:=-ce
42 "c:////all" .WINPATH :
43 @echo X\$@Y
45 EOT
47 if test x`uname -o 2> /dev/null` = "xCygwin"; then
48 output2=`eval ${DMAKEPROG} -r -f $file1`
49 result2=$?
50 if test "$output2" != "Xc:/allY"; then
51 echo "Subtest 2: Wrong result: $output2"
52 result2=1
53 else
54 echo "Subtest 2: OK"
56 else
57 echo "Subtest 2 ignored for non cygwin environment"
58 result2=0
59 fi
62 if test $result1 -eq 0 -a $result2 -eq 0; then
63 echo "Success - Cleaning up" && rm -f ${tmpfiles}
64 exit
65 else
66 echo "Failure!"
67 exit 1