File: check

package info (click to toggle)
secnet 0.6.7
  • links: PTS
  • area: main
  • in suites: bookworm, trixie
  • size: 1,956 kB
  • sloc: ansic: 15,234; python: 1,057; perl: 966; sh: 596; tcl: 484; java: 231; asm: 114; yacc: 89; php: 64; makefile: 48; awk: 40
file content (60 lines) | stat: -rwxr-xr-x 1,126 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
# subdirmk - part of the test suite
#  Copyright 2019 Mark Wooding
#  Copyright 2019 Ian Jackson
# SPDX-License-Identifier: LGPL-2.0-or-later
# There is NO WARRANTY.

set -ex

. tests/build-common

make_copy example

cd tests/example/example

: ----- out of tree build -----

mkdir build
cd build
>>../src/for-test.sd.mk
>>../lib/for-test.mk.in
>>../for-test-final.sd.mk
.././autogen.sh && ../configure
make -j4 all check

: ----- testing rebuild on input change -----

reset_times () {
	cd ..

	find ! -path './build/*' -type f -print0 \
	| xargs -0 \
	touch -hmd 'now -2000 seconds' --

	cd build

	find -type f -print0 \
	| xargs -0 \
	touch -hmd 'now -1000 seconds' --
}

: ----- for-check-1 -----
reset_times
echo 'for-check-1:' >>../src/for-test.sd.mk
make -j4 for-check-1
grep '^for-check-1:' src/Dir.mk || false

: ----- for-check-2 -----
reset_times
echo 'for-check-2:' >>../lib/for-test.mk.in
make -j4 for-check-2
grep '^for-check-2:' lib/for-test.mk || false

: ----- for-check-3 -----
reset_times
echo 'for-check-3:' >>../for-test-final.sd.mk
make -j4 for-check-3
grep '^for-check-3:' Final.mk

echo ok.