3 # 28.08.2007 Volker Quetschke
4 # Test mktmp function macro.
11 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
13 # Remove files from prior failed run
16 # Remember to quote variables in generated makefiles( $ -> \$ ).
17 # Test 1 - Check that mktmp can write special characters into a file.
22 FOO:=test1\n\ttest2\n\
26 @cat \$(mktmp \$(FOO:m))
30 output1
=`eval ${DMAKEPROG} -r -f $file1`
32 comparewith
=`printf "test1\n\ttest2\n test3"`
33 if test $result1 = 0 -a "$output1" = "$comparewith" ; then
37 echo "Subtest 1: Wrong result: $output1"
43 # Remember to quote variables in generated makefiles( $ -> \$ ).
44 # Test 2 - Check output of '('
50 @cat \${mktmp text (to dump to file}
54 output2
=`eval ${DMAKEPROG} -r -f $file1`
56 if test $result2 = 0 -a "$output2" = "text (to dump to file" ; then
60 echo "Subtest 2: Wrong result: $output2"
66 # Remember to quote variables in generated makefiles( $ -> \$ ).
67 # Test 3 - Test multiple line output.
72 OBJ = fred.obj mary.obj
75 @cat \$(mktmp \$(OBJ:t"+\n"))
78 output3
=`eval OOODMAKEMODE=y ${DMAKEPROG} -r -f $file1`
80 comparewith
=`printf "fred.obj+\nmary.obj"`
81 if test $result3 = 0 -a "$output3" = "$comparewith" ; then
85 echo "Subtest 3: Wrong result: $output3"
91 # Remember to quote variables in generated makefiles( $ -> \$ ).
92 # Test 4 - Test <+ ... +>
97 OBJ = fred.obj mary.obj joe.obj
103 output4
=`eval ${DMAKEPROG} -r -f $file1`
105 if test $result4 = 0 -a "$output4" = "fred.obj mary.obj joe.obj" ; then
109 echo "Subtest 4: Wrong result: $output4"
115 if test $result1 -eq 0 -a $result2 -eq 0 \
116 -a $result3 -eq 0 -a $result4 -eq 0 ; then
117 echo "Success - Cleaning up" && rm -f ${tmpfiles}