tools/testbuild.sh: use function to call make and fail handle in common
Change-Id: I50cbc335254be0f2388b4bb6af8a874e74ba98c2 Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
parent
499607d68f
commit
3b311ab895
@ -149,12 +149,19 @@ blacklist=`grep "^-" $testfile`
|
|||||||
|
|
||||||
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
|
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
|
||||||
|
|
||||||
|
function makefunc {
|
||||||
|
${MAKE} $@
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
fail=$?
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Clean up after the last build
|
# Clean up after the last build
|
||||||
|
|
||||||
function distclean {
|
function distclean {
|
||||||
if [ -f .config ]; then
|
if [ -f .config ]; then
|
||||||
echo " Cleaning..."
|
echo " Cleaning..."
|
||||||
${MAKE} ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null || fail=$?
|
makefunc ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +190,7 @@ function configure {
|
|||||||
echo "$toolchain=y" >> $nuttx/.config
|
echo "$toolchain=y" >> $nuttx/.config
|
||||||
|
|
||||||
echo " Refreshing..."
|
echo " Refreshing..."
|
||||||
${MAKE} ${MAKE_FLAGS} olddefconfig 1>/dev/null || fail=$?
|
makefunc ${MAKE_FLAGS} olddefconfig 1>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +199,7 @@ function configure {
|
|||||||
function build {
|
function build {
|
||||||
echo " Building NuttX..."
|
echo " Building NuttX..."
|
||||||
echo "------------------------------------------------------------------------------------"
|
echo "------------------------------------------------------------------------------------"
|
||||||
${MAKE} ${JOPTION} ${MAKE_FLAGS} 1>/dev/null || fail=$?
|
makefunc ${JOPTION} ${MAKE_FLAGS} 1>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Coordinate the steps for the next build test
|
# Coordinate the steps for the next build test
|
||||||
|
Loading…
Reference in New Issue
Block a user