tools/testbuild.sh: add option -N use CMake with Ninja

tools/testbuild.sh
     added option -N Use CMake with Ninja as the backend.

    updated help.

    added date to print startup board

   added HOST=Msys

github/workflows/build.yml

   added option -N job docker
This commit is contained in:
simbit18
2024-07-16 18:07:08 +02:00
committed by Xiang Xiao
parent bdf60d7966
commit 1540dc2d67
2 changed files with 24 additions and 14 deletions
+2 -2
View File
@@ -160,9 +160,9 @@ jobs:
git config --global --add safe.directory /github/workspace/sources/apps git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci cd sources/nuttx/tools/ci
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
./cibuild.sh -c -A -R --codechecker testlist/${{matrix.boards}}.dat ./cibuild.sh -c -A -N -R --codechecker testlist/${{matrix.boards}}.dat
else else
./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat ./cibuild.sh -c -A -N -R testlist/${{matrix.boards}}.dat
fi fi
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
+22 -12
View File
@@ -37,6 +37,7 @@ GITCLEAN=0
SAVEARTIFACTS=0 SAVEARTIFACTS=0
CHECKCLEAN=1 CHECKCLEAN=1
CODECHECKER=0 CODECHECKER=0
NINJACMAKE=0
RUN=0 RUN=0
case $(uname -s) in case $(uname -s) in
@@ -49,6 +50,9 @@ case $(uname -s) in
MINGW32*) MINGW32*)
HOST=MinGw HOST=MinGw
;; ;;
MSYS*)
HOST=Msys
;;
*) *)
# Assume linux as a fallback # Assume linux as a fallback
@@ -58,10 +62,11 @@ esac
function showusage { function showusage {
echo "" echo ""
echo "USAGE: $progname [-l|m|c|g|n] [-d] [-e <extraflags>] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] [--codechecker] <testlist-file>" echo "USAGE: $progname -h [-l|m|c|g|n] [-d] [-e <extraflags>] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p]"
echo " $progname -h" echo " [-A] [-C] [-G] [-N] [-R] [--codechecker] <testlist-file>"
echo "" echo ""
echo "Where:" echo "Where:"
echo " -h will show this help test and terminate"
echo " -l|m|c|g|n selects Linux (l), macOS (m), Cygwin (c)," echo " -l|m|c|g|n selects Linux (l), macOS (m), Cygwin (c),"
echo " MSYS/MSYS2 (g) or Windows native (n). Default Linux" echo " MSYS/MSYS2 (g) or Windows native (n). Default Linux"
echo " -d enables script debug output" echo " -d enables script debug output"
@@ -79,8 +84,8 @@ function showusage {
echo " * This assumes that only nuttx and apps repos need to be cleaned." 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 " * If the tree has files not managed by git, they will be removed"
echo " as well." echo " as well."
echo " -N Use CMake with Ninja as the backend."
echo " -R execute \"run\" script in the config directories if exists." echo " -R execute \"run\" script in the config directories if exists."
echo " -h will show this help test and terminate"
echo " --codechecker enables CodeChecker statically analyze the code." echo " --codechecker enables CodeChecker statically analyze the code."
echo " <testlist-file> selects the list of configurations to test. No default" echo " <testlist-file> selects the list of configurations to test. No default"
echo "" echo ""
@@ -132,6 +137,9 @@ while [ ! -z "$1" ]; do
-C ) -C )
CHECKCLEAN=0 CHECKCLEAN=0
;; ;;
-N )
NINJACMAKE=1
;;
-R ) -R )
RUN=1 RUN=1
;; ;;
@@ -180,7 +188,7 @@ export APPSDIR
testlist=`grep -v -E "^(-|#)|^[C|c][M|m][A|a][K|k][E|e]" $testfile || true` testlist=`grep -v -E "^(-|#)|^[C|c][M|m][A|a][K|k][E|e]" $testfile || true`
blacklist=`grep "^-" $testfile || true` blacklist=`grep "^-" $testfile || true`
if [ "X$HOST" == "XLinux" ]; then if [ ${NINJACMAKE} -eq 1 ]; then
cmakelist=`grep "^[C|c][M|m][A|a][K|k][E|e]" $testfile | cut -d',' -f2 || true` cmakelist=`grep "^[C|c][M|m][A|a][K|k][E|e]" $testfile | cut -d',' -f2 || true`
fi fi
@@ -277,7 +285,7 @@ function distclean {
makefunc distclean makefunc distclean
# Remove .version manually because this file is shipped with # Remove .version manually because this file is shipped with
# the release package and then distclean has to keep it # the release package and then distclean has to keep it.
rm -f .version rm -f .version
@@ -495,12 +503,14 @@ function dotest {
done done
unset cmake unset cmake
for l in $cmakelist; do if [ ${NINJACMAKE} -eq 1 ]; then
if [[ "${config/\//:}" == "${l}" ]]; then for l in $cmakelist; do
echo "Cmake in present: $1" if [[ "${config/\//:}" == "${l}" ]]; then
cmake=1 echo "Cmake in present: $1"
fi cmake=1
done fi
done
fi
echo "Configuration/Tool: $1" echo "Configuration/Tool: $1"
if [ ${PRINTLISTONLY} -eq 1 ]; then if [ ${PRINTLISTONLY} -eq 1 ]; then
@@ -538,7 +548,7 @@ function dotest {
fi fi
# Perform the build test # Perform the build test
echo $(date '+%Y-%m-%d %H:%M:%S')
echo "------------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------------"
distclean distclean
configure configure