chiark / gitweb /
Legal: Add NO WARRANTY everywhere
[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 >>../for-test-final.sd.mk
17 .././autogen.sh && ../configure
18 make -j4 all check
19
20 : ----- testing rebuild on input change -----
21
22 reset_times () {
23         cd ..
24
25         find ! -path './build/*' -type f -print0 \
26         | xargs -0 \
27         touch -hmd 'now -2000 seconds' --
28
29         cd build
30
31         find -type f -print0 \
32         | xargs -0 \
33         touch -hmd 'now -1000 seconds' --
34 }
35
36 : ----- for-check-1 -----
37 reset_times
38 echo 'for-check-1:' >>../src/for-test.sd.mk
39 make -j4 for-check-1
40 grep '^for-check-1:' src/Dir.mk || false
41
42 : ----- for-check-2 -----
43 reset_times
44 echo 'for-check-2:' >>../lib/for-test.mk.in
45 make -j4 for-check-2
46 grep '^for-check-2:' lib/for-test.mk || false
47
48 : ----- for-check-3 -----
49 reset_times
50 echo 'for-check-3:' >>../for-test-final.sd.mk
51 make -j4 for-check-3
52 grep '^for-check-3:' Final.mk
53
54 echo ok.