]> Cypherpunks.ru repositories - goredo.git/blob - t/redo-sh.tests/dependency_rebuild_2/test
Import tests from apenwarr/redo and redo.sh
[goredo.git] / t / redo-sh.tests / dependency_rebuild_2 / test
1 #!/bin/sh -eu
2 # A target must be rebuilt when a dependency of a dependency changes.
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 printf '1'
7
8 redo
9 <a read -r timestamp_a1
10 <b read -r timestamp_b1
11
12 sleep 1
13 >c printf '2'
14
15 redo
16 <a read -r timestamp_a2
17 <b read -r timestamp_b2
18
19 test ${timestamp_a2} -gt ${timestamp_a1}
20 test ${timestamp_b2} -gt ${timestamp_b1}