diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 14:48:34 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 14:48:34 +0000 |
commit | 0f63c9c045b52e6e3cdf8b7e963006e8eef50416 (patch) | |
tree | c72270c7c2a57784b1327da923b0065ce5f7ab15 | |
parent | ec1570380566c3f8bbcb2235d3bea58560c228b0 (diff) |
INTEGRATION: CWS dmake411 (1.1.2); FILE ADDED
2007/10/11 20:57:13 vq 1.1.2.2: #i50092# Work around Solaris and nfs timing issues.
Patch from hjs@openoffice.org.
2007/08/05 21:10:13 vq 1.1.2.1: #i50092# Enhance $(shell,expand .. ) parsing. Add testcase.
-rwxr-xr-x | dmake/tests/function_macros-9 | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/dmake/tests/function_macros-9 b/dmake/tests/function_macros-9 new file mode 100755 index 000000000000..e8d4d3a070a7 --- /dev/null +++ b/dmake/tests/function_macros-9 @@ -0,0 +1,70 @@ +#!/bin/sh + +# 05.08.2007 Volker Quetschke +# Test the $(shell,expand ..) function macro. +# (issue 50092) + +: ${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( $ -> \$ ). +# Test 1 - Test if it works. +cat > $file1 <<EOT +# The printf on Solaris seems to need bash. +SHELL:=/bin/bash +SHELLFLAGS*:=-ce + +AAA!=123 + +all : + noop X\$(shell,expand +@printf "\x24(AAA)")Y\$(shell +@printf \\\\x24\\(AAA\\))Z +EOT + +output1=`eval ${DMAKEPROG} -r -f $file1` +result1=$? +if test "$output1" != "noop X123Y\$(AAA)Z"; then + echo "Subtest 1: Wrong result: $output1" + result1=1 +else + echo "Subtest 1: OK" +fi + +# Test 2 - Test if wrong arguments are catched. +cat > $file1 <<EOT +# The printf on Solaris seems to need bash. +SHELL:=/bin/bash +SHELLFLAGS*:=-ce + +AAA!=123 + +all : + noop X\$(shell,XXX +@printf ABC\\\\x24\\(AAA\\))Y + +EOT + +output2=`eval ${DMAKEPROG} -rf $file1 2>&1` +result2=$? + +if echo $output2 | grep 'Error: -- Unknown argument \[XXX\] to shell' > /dev/null 2>&1 ; then + echo "Subtest 2: OK" +else + echo "Subtest 2: Wrong result: $output2" + echo + result2=0 +fi + + + +if test $result1 -eq 0 -a $result2 -ne 0 ; then + echo "Success - Cleaning up" && rm -f ${tmpfiles} + exit +else + echo "Failure!" + exit 1 +fi |