Merge tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / build / tests / run.sh
blob2c54e4d4354647abb53a4ffd591892170fffd213
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 function test_ex {
5 make -C ex V=1 clean > ex.out 2>&1
6 make -C ex V=1 >> ex.out 2>&1
8 if [ ! -x ./ex/ex ]; then
9 echo FAILED
10 exit -1
13 make -C ex V=1 clean > /dev/null 2>&1
14 rm -f ex.out
17 function test_ex_suffix {
18 make -C ex V=1 clean > ex.out 2>&1
20 # use -rR to disable make's builtin rules
21 make -rR -C ex V=1 ex.o >> ex.out 2>&1
22 make -rR -C ex V=1 ex.i >> ex.out 2>&1
23 make -rR -C ex V=1 ex.s >> ex.out 2>&1
25 if [ -x ./ex/ex ]; then
26 echo FAILED
27 exit -1
30 if [ ! -f ./ex/ex.o -o ! -f ./ex/ex.i -o ! -f ./ex/ex.s ]; then
31 echo FAILED
32 exit -1
35 make -C ex V=1 clean > /dev/null 2>&1
36 rm -f ex.out
39 function test_ex_include {
40 make -C ex V=1 clean > ex.out 2>&1
42 # build with krava.h include
43 touch ex/krava.h
44 make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1
46 if [ ! -x ./ex/ex ]; then
47 echo FAILED
48 exit -1
51 # build without the include
52 rm -f ex/krava.h ex/ex
53 make -C ex V=1 >> ex.out 2>&1
55 if [ ! -x ./ex/ex ]; then
56 echo FAILED
57 exit -1
60 make -C ex V=1 clean > /dev/null 2>&1
61 rm -f ex.out
64 echo -n Testing..
66 test_ex
67 test_ex_suffix
68 test_ex_include
70 echo OK