ce6470ef26
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.
62 lines
1.1 KiB
Bash
Executable file
62 lines
1.1 KiB
Bash
Executable file
#!/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
|