summaryrefslogtreecommitdiff
path: root/dmake/tests/macros-6
diff options
context:
space:
mode:
Diffstat (limited to 'dmake/tests/macros-6')
-rwxr-xr-xdmake/tests/macros-662
1 files changed, 62 insertions, 0 deletions
diff --git a/dmake/tests/macros-6 b/dmake/tests/macros-6
new file mode 100755
index 000000000000..8119f2ae84bb
--- /dev/null
+++ b/dmake/tests/macros-6
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# 09.11.2006 Volker Quetschke
+# Check that TMD honors if .SETDIR is used (with drive letters on cygwin)
+# (issue 69821).
+
+: ${DMAKEPROG:=dmake}
+file1="mfile1.mk"
+tmpfiles="$file1"
+
+trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
+
+# Remove files from prior failed run
+rm -rf $tmpfiles
+
+# Remember to quote variables in generated makefiles( $ -> \$ ).
+# Testcase 1
+cat > $file1 <<EOT
+SHELL*:=/bin/sh
+SHELLFLAGS*:=-ce
+
+.IMPORT .IGNORE : TEMP
+.IF "\$(TEMP)"==""
+TEMP:=/tmp
+.ENDIF
+
+
+# Test if .SETDIR works with drive letters
+.IF "\$(subst,Cygwin, \$(shell @uname))"!="\$(shell @uname)"
+SDIR:=\$(shell @+cygpath -d "\$(TEMP)")
+.ELSE
+SDIR:=\$(TEMP)
+.ENDIF
+
+# Make TEMP the target directory, cd to TMD should go back to
+# the original directory
+all ".SETDIR=\$(SDIR)" :
+ @+cd \$(TMD); pwd
+
+EOT
+
+
+output1=`eval ${DMAKEPROG} -r -f $file1`
+result1=$?
+
+if test "$output1" != "`pwd`"; then
+ echo "Test 1: Wrong result: ${output1}"
+ result1=1
+else
+ echo "Test 1: OK"
+fi
+
+if test $result1 -eq 0; then
+ echo "Success - Cleaning up"
+ rm -rf $tmpfiles
+exit
+ result=0
+else
+ echo "Failure!"
+ result=1
+fi
+exit $result