tools/testbuild.sh: select size_t to different type by testlist

testbuild.sh select size_t to different type by testlist in which
CONFIG_ARCH_SIZET_LONG defined for ulong and -CONFIG_ARCH_SIZET_LONG
for uint.
This commit is contained in:
liuhaitao 2020-02-15 12:22:32 +08:00 committed by Gregory Nutt
parent 6c31a72e2b
commit ba265e90d6
2 changed files with 19 additions and 20 deletions

View file

@ -964,7 +964,9 @@ testbuild.sh
build descriptions consists of two comma separated values. For example:
stm32f429i-disco:nsh,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
arduino-due:nsh,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL,-CONFIG_ARCH_SIZET_LONG
/arm,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
/risc-v,CONFIG_RV32IM_TOOLCHAIN_GNU_RVGL,CONFIG_ARCH_SIZET_LONG
The first value is the usual configuration description of the form
<board-name>:<configuration-name> or /<folder-name> and must correspond to a

View file

@ -37,7 +37,6 @@ nuttx=$WD/../nuttx
progname=$0
fail=0
sizet=default
APPSDIR=$WD/../apps
MAKE_FLAGS=-k
MAKE=make
@ -53,11 +52,6 @@ function showusage {
echo "Where:"
echo " -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),"
echo " Ubuntu under Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n). Default Linux"
echo " -si|-sl selected the type of size_t used within the compiler. This necessary because"
echo " the compiler will generate calls to new and delete operators using its internal"
echo " understanding which must match the usage in libs/libxx. -si indicates that the"
echo " underlying size_t is 'unsigned int'; -sl indicates unsigned long. Default: Use"
echo " the setting from the defconfig file."
echo " -d enables script debug output"
echo " -x exit on build failures"
echo " -j <ncpus> passed on to make. Default: No -j make option."
@ -94,12 +88,6 @@ while [ ! -z "$1" ]; do
shift
JOPTION="-j $1"
;;
-si )
sizet=uint
;;
-sl )
sizet=ulong
;;
-t )
shift
nuttx="$1"
@ -179,16 +167,18 @@ function configure {
sed -i -e "/$varname/d" $nuttx/.config
fi
if [ "X$sizet" != "Xdefault" ]; then
sed -i -e "/CONFIG_ARCH_SIZET_LONG/d" $nuttx/.config
if [ "X$sizet" == "Xulong" ]; then
sed -i -e "\$aCONFIG_ARCH_SIZET_LONG=y" $nuttx/.config
fi
fi
echo " Enabling $toolchain"
echo "$toolchain=y" >> $nuttx/.config
if [ "X$sizet" == "Xuint" ]; then
echo " Disabling CONFIG_ARCH_SIZET_LONG"
sed -i -e "/CONFIG_ARCH_SIZET_LONG/d" $nuttx/.config
elif [ "X$sizet" == "Xulong" ]; then
echo " Enabling CONFIG_ARCH_SIZET_LONG"
sed -i -e "\$aCONFIG_ARCH_SIZET_LONG=y" $nuttx/.config
fi
echo " Refreshing..."
makefunc ${MAKE_FLAGS} olddefconfig 1>/dev/null
fi
@ -234,12 +224,19 @@ function dotest {
showusage
fi
unset toolchain;
unset toolchain
unset sizet
if [ "X$config" != "X$1" ]; then
toolchain=`echo $1 | cut -d',' -f2`
if [ -z "$toolchain" ]; then
echo " Warning: no tool configuration"
fi
archsizet=`echo $line | cut -d',' -f3`
if [ "X$archsizet" == "XCONFIG_ARCH_SIZET_LONG" ]; then
sizet=ulong
elif [ "X$archsizet" == "X-CONFIG_ARCH_SIZET_LONG" ]; then
sizet=uint
fi
fi
# Perform the build test