office-gobmx/dmake/tests/misc-5
Ivo Hinkelmann aa057c097f INTEGRATION: CWS dmake45 (1.2.2); FILE MERGED
2006/06/22 20:45:44 vq 1.2.2.1: #i66650# Make dmake testsuite more portable. (Usable with Solaris.)
Patch by hjs.
2006-06-29 10:29:33 +00:00

49 lines
1,008 B
Bash
Executable file

#!/bin/sh
# 06.10.2005 Volker Quetschke
# Test if infered makefile generation works.
# (issue 54938)
: ${DMAKEPROG:=dmake}
file1="mymakefile.mk"
file2="incfile.mk"
file3="incfiledepend"
tmpfiles="$file1 $file2 $file3"
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( $ -> \$ ).
cat > $file1 <<EOT
# Verify that makefile generation is finished when using it
SHELL*:=/bin/sh
SHELLFLAGS*:=-ce
incfile.mk : incfiledepend
+@echo AA:=123 > \$@
incfiledepend :
+@sleep 1
+@echo 1234 > \$@
.INCLUDE : incfile.mk
all :
+@echo aa:\$(AA):bb
EOT
output=`eval ${DMAKEPROG} -r -P2 -f $file1 all`
result=$?
# The space between aaa and bbb comes from the +=
if test "$output" != "aa:123:bb"; then
echo "Wrong result"
result=1
fi
test $result -eq 0 && echo "Success - Cleaning up" && rm -f ${tmpfiles}
test $result -ne 0 && echo "Failure!"
exit $result