You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/07/27 15:22:32 UTC

[incubator-nuttx] 04/06: tools: testbuild.sh: Add exportandimport func

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

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

commit 5633e38da2b9c8aebb9098a1e8841c4d1d4a216e
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Wed Jul 27 14:07:32 2022 +0900

    tools: testbuild.sh: Add exportandimport func
    
    Summary:
    - This commit adds exportandimport func for CONFIG_BUILD_KERNEL=y
    
    Impact:
    - ci with CONFIG_BUILD_KERNEL=y only
    
    Testing:
    - Tested with sabre-6quad:netknsh (will be updated later)
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 tools/testbuild.sh | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index a44a23fcb1..abb42cd08f 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -177,9 +177,42 @@ blacklist=`grep "^-" $testfile || true`
 
 cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
 
+function exportandimport {
+  # Do nothing until we finish to build the nuttx
+  if [ ! -f nuttx ]; then
+    return $fail
+  fi
+
+  # If CONFIG_BUILD_KERNEL=y does not exist in .config, do nothing
+  if ! grep CONFIG_BUILD_KERNEL=y .config 1>/dev/null; then
+    return $fail
+  fi
+
+  if ! ${MAKE} export ${JOPTION} 1>/dev/null; then
+    fail=1
+    return $fail
+  fi
+
+  pushd ../apps/
+
+  if ! ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-*.tar.gz 1>/dev/null; then
+    fail=1
+    popd
+    return $fail
+  fi
+
+  if ! ${MAKE} import ${JOPTION} 1>/dev/null; then
+    fail=1
+  fi
+  popd
+  return $fail
+}
+
 function makefunc {
   if ! ${MAKE} ${MAKE_FLAGS} "${EXTRA_FLAGS}" ${JOPTION} $@ 1>/dev/null; then
     fail=1
+  else
+    exportandimport
   fi
 
   return $fail