summaryrefslogtreecommitdiff
path: root/dmake/tests
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-01-18 08:41:18 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-01-18 08:41:18 +0000
commitce6470ef2634d745bc891edcabab2a37714c4841 (patch)
tree405a23d8677eafb2c3e8b63a50d44c79fa83e000 /dmake/tests
parent454508359442c2a204d3364d8083b2bd3f95d1db (diff)
INTEGRATION: CWS dmake47 (1.1.2); FILE ADDED
2006/11/21 11:50:42 hjs 1.1.2.3: small cleanup 2006/11/20 16:58:23 vq 1.1.2.2: #i71777# Fix testcase. 2006/11/09 21:31:23 vq 1.1.2.1: #i69821# Add testcase to verify that .SETDIR works (with drive letters on cygwin) and sets TMD correctly.
Diffstat (limited to 'dmake/tests')
-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