testbuild.sh: Make the use of "git clean" optional

Also, update the list of command line options in the help text.
This commit is contained in:
YAMAMOTO Takashi 2020-04-03 11:35:30 +09:00 committed by Xiang Xiao
parent f438220555
commit 8851d3a7d3
2 changed files with 30 additions and 8 deletions

View File

@ -994,18 +994,26 @@ testbuild.sh
$ ./testbuild.sh -h
USAGE: ./testbuild.sh [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>
USAGE: ./testbuild.sh [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file>
./testbuild.sh -h
Where:
-l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),
Ubuntu under Windows 10 (u), or Windows native (n). Default Linux
-a <appsdir> provides the relative path to the apps/ directory. Default ../apps
-t <topdir> provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx
-p only print the list of configs without running any builds
-j <ncpus> passed on to make. Default: No -j make option
Ubuntu under Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n). Default Linux
-d enables script debug output
-x exit on build failures
-j <ncpus> passed on to make. Default: No -j make option.
-a <appsdir> provides the relative path to the apps/ directory. Default ../apps
-t <topdir> provides the absolute path to top nuttx/ directory.
Default $WD/../nuttx, where $WD is the parent directory of
the directory where this script is.
-p only print the list of configs without running any builds
-G Use "git clean -xfdq" instead of "make distclean" to clean the tree.
This option may speed up the builds. However, note that:
* This assumes that your trees are git based.
* This assumes that only nuttx and apps repos need to be cleaned.
* If the tree has files not managed by git, they will be removed
as well.
-h will show this help test and terminate
<testlist-file> selects the list of configurations to test. No default

View File

@ -44,10 +44,11 @@ unset testfile
unset HOPTION
unset JOPTION
PRINTLISTONLY=0
GITCLEAN=0
function showusage {
echo ""
echo "USAGE: $progname [-l|m|c|u|g|n] [-si|-sl>] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
echo "USAGE: $progname [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file>"
echo " $progname -h"
echo ""
echo "Where:"
@ -59,6 +60,12 @@ function showusage {
echo " -a <appsdir> provides the relative path to the apps/ directory. Default ../apps"
echo " -t <topdir> provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx"
echo " -p only print the list of configs without running any builds"
echo " -G Use \"git clean -xfdq\" instead of \"make distclean\" to clean the tree."
echo " This option may speed up the builds. However, note that:"
echo " * This assumes that your trees are git based."
echo " * This assumes that only nuttx and apps repos need to be cleaned."
echo " * If the tree has files not managed by git, they will be removed"
echo " as well."
echo " -h will show this help test and terminate"
echo " <testlist-file> selects the list of configurations to test. No default"
echo ""
@ -97,6 +104,9 @@ while [ ! -z "$1" ]; do
-p )
PRINTLISTONLY=1
;;
-G )
GITCLEAN=1
;;
-h )
showusage
;;
@ -159,7 +169,11 @@ function distclean_with_git {
function distclean {
if [ -f .config ]; then
echo " Cleaning..."
distclean_with_git || makefunc ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null
if [ ${GITCLEAN} -eq 1 ]; then
distclean_with_git
else
makefunc ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null
fi
fi
}