3 # 25.08.2007 Volker Quetschke
4 # Check that dmake handles dependencies correctly.
12 tmpfiles
="$file1 $file2 $file3 $file4"
14 trap '{ echo "trapped signal - removing temporary files" ; rm -rf $tmpfiles ; }' 1 2 3 15
16 # Remove files from prior failed run
19 # Remember to quote variables in generated makefiles( $ -> \$ ).
33 # Create test environment
35 # Avoid that aa.x has the same time stamp as aa.y after
36 # that has been rebuild.
39 output1
=`eval ${DMAKEPROG} -rf $file1 2>&1`
42 if test $result1 = 0 && echo $output1 |
grep 'Warning: -- Target \[aa.x\] was made but the time stamp has not been updated.' > /dev
/null
2>&1 ; then
46 echo "Subtest 1: Wrong result: $output1"
52 # Remember to quote variables in generated makefiles( $ -> \$ ).
53 # Test 2 - Warn if virtual targets have a corresponding file.
62 # Should warn - aa.y exists.
70 # Create test environment
73 # Avoid the same time after build.
76 output2
=`eval ${DMAKEPROG} -rf $file1 2>&1`
79 if test $result2 = 0 && echo $output2 |
grep 'Warning: -- Found file corresponding to virtual target \[aa.y\].' > /dev
/null
2>&1 ; then
83 echo "Subtest 2: Wrong result: $output2"
89 # Remember to quote variables in generated makefiles( $ -> \$ ).
107 # Create test environment
109 touch aa.z
; sleep 1 ; touch aa.x
110 # Avoid the same time after build.
113 # This tests that aa.x is not build as the dependency chain is intact with
114 # the virtual target aa.y having the same time stamp as aa.z.
115 output3
=`eval ${DMAKEPROG} -rf $file1 2>&1`
118 if test $result3 = 0 -a "$output3" = "\`aa.x' is up to date" ; then
122 echo "Subtest 3: Wrong result: :$output3:"
128 # Remember to quote variables in generated makefiles( $ -> \$ ).
146 # Create test environment
147 touch aa.z
; sleep 1 ; touch aa.x
148 # Create a file for the virtual target that is newer than aa.x
150 # Avoid the same time after build.
153 # This tests that aa.x is build.
154 output4
=`eval ${DMAKEPROG} -rf $file1 2>&1`
157 if test $result4 = 0 -a "$output4" = "Build aa.x" ; then
161 echo "Subtest 4: Wrong result: :$output4:"
167 if test $result1 -eq 0 -a $result2 -eq 0 \
168 -a $result3 -eq 0 -a $result4 -eq 0 ; then
169 echo "Success - Cleaning up"