@@ -40,13 +40,18 @@ print_warning()
4040# run all make check in directory recursively
4141function checkFolder()
4242{
43+ local retVal=0
4344 find " $1 " -name Makefile | while read line; do
44- local TEST_DIR=$( dirname $line ) /test/
45- if [ -d " $TEST_DIR " ] ; then
46- print_title " Checking in $( dirname ${line} ) " ;
47- make -C $( dirname $line ) check BRIEF=1 -j4
48- fi
49- done
45+ local TEST_DIR=$( dirname $line ) /test/
46+ if [ -d " $TEST_DIR " ] ; then
47+ print_title " Checking in $( dirname ${line} ) "
48+ make -C $( dirname $line ) check BRIEF=1 -j4
49+
50+ (( retVal = retVal + $? ))
51+ fi
52+ done
53+
54+ return $retVal
5055}
5156
5257# run make clean in dir recursively
@@ -60,24 +65,29 @@ function cleanFolder()
6065# run make all in dir recursively
6166function makeFolder()
6267{
68+ local retVal=0
69+
6370 find " $1 " -name Makefile | while read line; do
64- print_title " Compile in $( dirname ${line} ) ..." ;
65-
66- if (( $FULL_REPORT == 0 )) ; then
67- make -C $( dirname $line ) all -j4 > /dev/null
68- else
69- make -C $( dirname $line ) all -j4
70- fi
71+ print_title " Compile in $( dirname ${line} ) ..." ;
72+
73+ if (( $FULL_REPORT == 0 )) ; then
74+ make -C $( dirname $line ) all -j4 > /dev/null
75+ else
76+ make -C $( dirname $line ) all -j4
77+ fi
7178
72- local MK_RESULT=$?
79+ local MK_RESULT=$?
80+ (( retVal= retVal + MK_RESULT))
7381
74- if (( $MK_RESULT != 0 )) ; then
75- print_warning " Error code $MK_RESULT on compiling $( dirname $line ) "
76- if (( $FORCE_CONTINUE == 0 )) ; then
77- exit $MK_RESULT
78- fi
79- fi
80- done
82+ if (( $MK_RESULT != 0 )) ; then
83+ print_warning " Error code $MK_RESULT on compiling $( dirname $line ) "
84+ if (( $FORCE_CONTINUE == 0 )) ; then
85+ exit $MK_RESULT
86+ fi
87+ fi
88+ done
89+
90+ return $retVal
8191}
8292
8393function checkDependency()
0 commit comments