You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/04/20 13:07:45 UTC

[incubator-nuttx] 05/09: tools/testbuild.sh: Verify nuttx/apps folder clean after build

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 95e5506637a30c26665ad734390d98b0a1c559ac
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Apr 19 17:51:59 2020 +0800

    tools/testbuild.sh: Verify nuttx/apps folder clean after build
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/testbuild.sh | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index 4bef96e..3f1d949 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -165,16 +165,12 @@ function makefunc {
 
 # Clean up after the last build
 
-function distclean_with_git {
-  git -C $nuttx clean -xfdq
-  git -C $APPSDIR clean -xfdq
-}
-
 function distclean {
+  echo "  Cleaning..."
   if [ -f .config ]; then
-    echo "  Cleaning..."
     if [ ${GITCLEAN} -eq 1 ]; then
-      distclean_with_git
+      git -C $nuttx clean -xfdq
+      git -C $APPSDIR clean -xfdq
     else
       makefunc ${JOPTION} distclean
     fi
@@ -224,6 +220,19 @@ function build {
   if ! ./tools/refresh.sh --silent $config; then
     fail=1
   fi
+
+  # Ensure nuttx and apps directory in clean state
+
+  if [ -d $nuttx/.git ] || [ -d $APPSDIR/.git ]; then
+    if [[ -n $(git -C $nuttx status -s) ]]; then
+      git -C $nuttx status
+      fail=1
+    fi
+    if [[ -n $(git -C $APPSDIR status -s) ]]; then
+      git -C $APPSDIR status
+      fail=1
+    fi
+  fi
 }
 
 # Coordinate the steps for the next build test