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 <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2022-07-27 14:07:32 +09:00 committed by Xiang Xiao
parent 88d0a4d20e
commit 5633e38da2
1 changed files with 33 additions and 0 deletions

View File

@ -177,9 +177,42 @@ blacklist=`grep "^-" $testfile || true`
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } 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 { function makefunc {
if ! ${MAKE} ${MAKE_FLAGS} "${EXTRA_FLAGS}" ${JOPTION} $@ 1>/dev/null; then if ! ${MAKE} ${MAKE_FLAGS} "${EXTRA_FLAGS}" ${JOPTION} $@ 1>/dev/null; then
fail=1 fail=1
else
exportandimport
fi fi
return $fail return $fail