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