]> Cypherpunks.ru repositories - goredo.git/blob - t/redo-sh.tests/dependency_nobuild_3/test
Import tests from apenwarr/redo and redo.sh
[goredo.git] / t / redo-sh.tests / dependency_nobuild_3 / test
1 #!/bin/sh -eu
2 # A target must not be rebuilt when a dependency of a dependency of a dependency does not change.
3 >all.do printf 'redo-ifchange a\n'
4 >a.do printf 'redo-ifchange b\ndate +%s\n'
5 >b.do printf 'redo-ifchange c\ndate +%s\n'
6 >c.do printf 'redo-ifchange d\ndate +%s\n'
7 >d printf '1'
8
9 redo
10 <a read -r timestamp_a1
11 <b read -r timestamp_b1
12 <c read -r timestamp_c1
13
14 sleep 1
15 >d printf '1'
16
17 redo
18 <a read -r timestamp_a2
19 <b read -r timestamp_b2
20 <c read -r timestamp_c2
21
22 test ${timestamp_a2} -eq ${timestamp_a1}
23 test ${timestamp_b2} -eq ${timestamp_b1}
24 test ${timestamp_c2} -eq ${timestamp_c1}