tools/testbuild.sh: Add an optional step to run NuttX

I plan to use this to run sim:ostest (and probably other tests later)
on the CI.

The script indirection might allow future non-sim usage as well.
(like running it with qemu, or even on the real hardware.)
I have no plan to do it by myself right now though.
This commit is contained in:
YAMAMOTO Takashi
2022-01-31 11:12:10 +09:00
committed by Xiang Xiao
parent e5d7179e4c
commit 3aa83d6146
2 changed files with 19 additions and 0 deletions
+1
View File
@@ -1008,6 +1008,7 @@ testbuild.sh
* This assumes that only nuttx and apps repos need to be cleaned. * 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 * If the tree has files not managed by git, they will be removed
as well. as well.
-R execute "run" script in the config directories if exists.
-h will show this help test and terminate -h will show this help test and terminate
<testlist-file> selects the list of configurations to test. No default <testlist-file> selects the list of configurations to test. No default
+18
View File
@@ -36,6 +36,7 @@ PRINTLISTONLY=0
GITCLEAN=0 GITCLEAN=0
SAVEARTIFACTS=0 SAVEARTIFACTS=0
CHECKCLEAN=1 CHECKCLEAN=1
RUN=0
case $(uname -s) in case $(uname -s) in
Darwin*) Darwin*)
@@ -77,6 +78,7 @@ 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 " -R execute \"run\" script in the config directories if exists."
echo " -h will show this help test and terminate" echo " -h will show this help test and terminate"
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 ""
@@ -128,6 +130,9 @@ while [ ! -z "$1" ]; do
-C ) -C )
CHECKCLEAN=0 CHECKCLEAN=0
;; ;;
-R )
RUN=1
;;
-h ) -h )
showusage showusage
;; ;;
@@ -276,6 +281,18 @@ function build {
return $fail return $fail
} }
function run {
if [ ${RUN} -ne 0 ]; then
run_script="$path/run"
if [ -x $run_script ]; then
echo " Running NuttX..."
if ! $run_script; then
fail=1
fi
fi
fi
return $fail
}
# Coordinate the steps for the next build test # Coordinate the steps for the next build test
function dotest { function dotest {
@@ -330,6 +347,7 @@ function dotest {
distclean distclean
configure configure
build build
run
} }
# Perform the build test for each entry in the test list file # Perform the build test for each entry in the test list file