chiark / gitweb /
tests/example: Reset times of (copied) source files too
[subdirmk.git] / tests / example / check
1 #!/bin/sh
2 set -ex
3
4 . tests/build-common
5
6 make_copy example
7
8 cd tests/example/example
9
10 : ----- out of tree build -----
11
12 mkdir build
13 cd build
14 >>../src/for-test.sd.mk
15 >>../lib/for-test.mk.in
16 .././autogen.sh && ../configure
17 make -j4 all check
18
19 : ----- testing rebuild on input change -----
20
21 reset_times () {
22         cd ..
23
24         find ! -path './build/*' -type f -print0 \
25         | xargs -0 \
26         touch -hmd 'now -2000 seconds' --
27
28         cd build
29
30         find -type f -print0 \
31         | xargs -0 \
32         touch -hmd 'now -1000 seconds' --
33 }
34
35 : ----- for-check-1 -----
36 reset_times
37 echo 'for-check-1:' >>../src/for-test.sd.mk
38 make -j4 for-check-1
39 grep '^for-check-1:' src/Subdir.mk || false
40
41 : ----- for-check-2 -----
42 reset_times
43 echo 'for-check-2:' >>../lib/for-test.mk.in
44 make -j4 for-check-2
45 grep '^for-check-2:' lib/for-test.mk || false
46
47 echo ok.