From 5633e38da2b9c8aebb9098a1e8841c4d1d4a216e Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Wed, 27 Jul 2022 14:07:32 +0900 Subject: [PATCH] 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 --- 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