From 3aaeb025e2232c05cbf626599ae3113620e55c59 Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:07:08 +0200 Subject: [PATCH] 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 --- .github/workflows/build.yml | 4 ++-- tools/testbuild.sh | 34 ++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62d156b1f97f0..293678320b7b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,9 +160,9 @@ jobs: git config --global --add safe.directory /github/workspace/sources/apps cd sources/nuttx/tools/ci 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 - ./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat + ./cibuild.sh -c -A -N -R testlist/${{matrix.boards}}.dat fi - uses: actions/upload-artifact@v3 diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 17a5bab697f6a..65ab2aed19535 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -37,6 +37,7 @@ GITCLEAN=0 SAVEARTIFACTS=0 CHECKCLEAN=1 CODECHECKER=0 +NINJACMAKE=0 RUN=0 case $(uname -s) in @@ -49,6 +50,9 @@ case $(uname -s) in MINGW32*) HOST=MinGw ;; + MSYS*) + HOST=Msys + ;; *) # Assume linux as a fallback @@ -58,10 +62,11 @@ esac function showusage { echo "" - echo "USAGE: $progname [-l|m|c|g|n] [-d] [-e ] [-x] [-j ] [-a ] [-t ] [-p] [-G] [--codechecker] " - echo " $progname -h" + echo "USAGE: $progname -h [-l|m|c|g|n] [-d] [-e ] [-x] [-j ] [-a ] [-t ] [-p]" + echo " [-A] [-C] [-G] [-N] [-R] [--codechecker] " echo "" 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 " MSYS/MSYS2 (g) or Windows native (n). Default Linux" 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 " * If the tree has files not managed by git, they will be removed" echo " as well." + echo " -N Use CMake with Ninja as the backend." 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 " selects the list of configurations to test. No default" echo "" @@ -132,6 +137,9 @@ while [ ! -z "$1" ]; do -C ) CHECKCLEAN=0 ;; + -N ) + NINJACMAKE=1 + ;; -R ) RUN=1 ;; @@ -180,7 +188,7 @@ export APPSDIR testlist=`grep -v -E "^(-|#)|^[C|c][M|m][A|a][K|k][E|e]" $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` fi @@ -277,7 +285,7 @@ function distclean { makefunc distclean # 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 @@ -495,12 +503,14 @@ function dotest { done unset cmake - for l in $cmakelist; do - if [[ "${config/\//:}" == "${l}" ]]; then - echo "Cmake in present: $1" - cmake=1 - fi - done + if [ ${NINJACMAKE} -eq 1 ]; then + for l in $cmakelist; do + if [[ "${config/\//:}" == "${l}" ]]; then + echo "Cmake in present: $1" + cmake=1 + fi + done + fi echo "Configuration/Tool: $1" if [ ${PRINTLISTONLY} -eq 1 ]; then @@ -538,7 +548,7 @@ function dotest { fi # Perform the build test - + echo $(date '+%Y-%m-%d %H:%M:%S') echo "------------------------------------------------------------------------------------" distclean configure