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