1 #!/bin/sh 1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 << 3 2 4 function test_ex { 3 function test_ex { 5 make -C ex V=1 clean > ex.out 2>&1 4 make -C ex V=1 clean > ex.out 2>&1 6 make -C ex V=1 >> ex.out 2>&1 5 make -C ex V=1 >> ex.out 2>&1 7 6 8 if [ ! -x ./ex/ex ]; then 7 if [ ! -x ./ex/ex ]; then 9 echo FAILED 8 echo FAILED 10 exit -1 9 exit -1 11 fi 10 fi 12 11 13 make -C ex V=1 clean > /dev/null 2>&1 12 make -C ex V=1 clean > /dev/null 2>&1 14 rm -f ex.out 13 rm -f ex.out 15 } 14 } 16 15 17 function test_ex_suffix { 16 function test_ex_suffix { 18 make -C ex V=1 clean > ex.out 2>&1 17 make -C ex V=1 clean > ex.out 2>&1 19 18 20 # use -rR to disable make's builtin ru 19 # use -rR to disable make's builtin rules 21 make -rR -C ex V=1 ex.o >> ex.out 2>&1 20 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 21 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 22 make -rR -C ex V=1 ex.s >> ex.out 2>&1 24 23 25 if [ -x ./ex/ex ]; then 24 if [ -x ./ex/ex ]; then 26 echo FAILED 25 echo FAILED 27 exit -1 26 exit -1 28 fi 27 fi 29 28 30 if [ ! -f ./ex/ex.o -o ! -f ./ex/ex.i 29 if [ ! -f ./ex/ex.o -o ! -f ./ex/ex.i -o ! -f ./ex/ex.s ]; then 31 echo FAILED 30 echo FAILED 32 exit -1 31 exit -1 33 fi 32 fi 34 33 35 make -C ex V=1 clean > /dev/null 2>&1 34 make -C ex V=1 clean > /dev/null 2>&1 36 rm -f ex.out 35 rm -f ex.out 37 } 36 } 38 37 39 function test_ex_include { 38 function test_ex_include { 40 make -C ex V=1 clean > ex.out 2>&1 39 make -C ex V=1 clean > ex.out 2>&1 41 40 42 # build with krava.h include 41 # build with krava.h include 43 touch ex/krava.h 42 touch ex/krava.h 44 make -C ex V=1 CFLAGS=-DINCLUDE >> ex. 43 make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1 45 44 46 if [ ! -x ./ex/ex ]; then 45 if [ ! -x ./ex/ex ]; then 47 echo FAILED 46 echo FAILED 48 exit -1 47 exit -1 49 fi 48 fi 50 49 51 # build without the include 50 # build without the include 52 rm -f ex/krava.h ex/ex 51 rm -f ex/krava.h ex/ex 53 make -C ex V=1 >> ex.out 2>&1 52 make -C ex V=1 >> ex.out 2>&1 54 53 55 if [ ! -x ./ex/ex ]; then 54 if [ ! -x ./ex/ex ]; then 56 echo FAILED 55 echo FAILED 57 exit -1 56 exit -1 58 fi 57 fi 59 58 60 make -C ex V=1 clean > /dev/null 2>&1 59 make -C ex V=1 clean > /dev/null 2>&1 61 rm -f ex.out 60 rm -f ex.out 62 } 61 } 63 62 64 echo -n Testing.. 63 echo -n Testing.. 65 64 66 test_ex 65 test_ex 67 test_ex_suffix 66 test_ex_suffix 68 test_ex_include 67 test_ex_include 69 68 70 echo OK 69 echo OK
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.