3 # 24.07.2007 Volker Quetschke
4 # Test the $(normpath ..) function macro.
11 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
13 # Remove files from prior failed run
16 # Remember to quote variables in generated makefiles( $ -> \$ ).
17 # Test 1 - Test if normpath works.
25 @echo 1\$(normpath /tmp/./a "/tmp/a b/xxx/../b" /tmp)1
28 output1
=`eval ${DMAKEPROG} -r -f $file1`
30 if test "$output1" != "1/tmp/a \"/tmp/a b/b\" /tmp1"; then
31 echo "Subtest 1: Wrong result: $output1"
37 # Test 2 - Test if normpath honors .WINPATH setting
43 @echo 2\$(normpath /tmp)2
47 output2
=`eval ${DMAKEPROG} -r -f $file1`
49 if test x
`uname -o 2> /dev/null` = "xCygwin"; then
50 if test "$output2" != "2`cygpath -m /tmp`2"; then
51 echo "Subtest 2: Wrong result: $output2"
57 if test "$output2" != "2/tmp2"; then
58 echo "Subtest 2: Wrong result: $output2"
65 # Test 3 - Test if the optional parameter works
71 @echo 3\$(normpath,"" /tmp)3\$(normpath,"abc" /tmp)3
75 output3
=`eval ${DMAKEPROG} -r -f $file1`
77 if test x
`uname -o 2> /dev/null` = "xCygwin"; then
78 if test "$output3" != "3/tmp3`cygpath -m /tmp`3"; then
79 echo "Subtest 3: Wrong result: $output3"
85 if test "$output3" != "3/tmp3/tmp3"; then
86 echo "Subtest 3: Wrong result: $output3"
94 if test $result1 -eq 0 -a $result2 -eq 0 \
95 -a $result3 -eq 0 ; then
96 echo "Success - Cleaning up" && rm -f ${tmpfiles}