update dev300-m58
[ooovba.git] / dmake / tests / macros-5
blobd175271ee6f909c350dd00c7b1aaf7e30cc60c85
1 #!/bin/sh
3 # 24.09.2006 Volker Quetschke
4 # TMD is sometimes set incorrectly (issue 69821).
6 : ${DMAKEPROG:=dmake}
7 file1="mfile1.mk"
8 file2="mfile2.mk"
9 file3="test1/aaa"
10 file4="test2/aaa"
11 tmpfiles="$file1 $file2"
13 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles test1 test2; }' 1 2 3 15
15 # Remove files from prior failed run
16 rm -rf $tmpfiles test1 test2
18 # Remember to quote variables in generated makefiles( $ -> \$ ).
19 # Testcase 1
20 cat > $file1 <<EOT
21 SHELL*:=/bin/sh
22 SHELLFLAGS*:=-ce
24 all :
25 +@echo \$(TMD)
27 EOT
29 # Testcase 2
30 mkdir -p "$file3"
31 mkdir -p "$file4"
32 cat > $file2 <<EOT
33 SHELL*:=/bin/sh
34 SHELLFLAGS*:=-ce
37 all ".SETDIR=../../$file3" :
38 +@echo \$(TMD)
39 EOT
41 output1=`eval ${DMAKEPROG} -r -f $file1`
42 result1=$?
43 output2=`eval cd $file4 ; ../../${DMAKEPROG} -r -f ../../$file2`
44 result2=$?
46 if test "$output1" != "."; then
47 echo "Test 1: Wrong result: $output1"
48 result1=1
49 else
50 echo " Subtest 1: OK"
52 if test "$output2" != "../../test2/aaa"; then
53 echo "Test 2: Wrong result: $output2"
54 result2=1
55 else
56 echo " Subtest 2: OK"
59 if test $result1 -eq 0 -a $result2 -eq 0; then
60 echo "Success - Cleaning up"
61 rm -rf $tmpfiles test1 test2
62 exit
63 result=0
64 else
65 echo "Failure!"
66 result=1
68 exit $result