aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2020-05-13 10:13:58 -0500
committerDan Murphy <dmurphy@ti.com>2020-05-13 10:13:58 -0500
commit49fca5fc5b64d36b36e16f247e151c9c8c43b900 (patch)
treeecf4a193ab1843fc44238d022a96eed016c81abe
parentcde2eecd3ec3e2f0010c3650437862ed0c78e8c0 (diff)
downloadlinux-dt-49fca5fc5b64d36b36e16f247e151c9c8c43b900.tar.gz
system_test: build_system_test: Add clean up of output directory on fail
Signed-off-by: Dan Murphy <dmurphy@ti.com>
-rwxr-xr-xsystem_test/build_system_test.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/system_test/build_system_test.sh b/system_test/build_system_test.sh
index 76f9401..e7e8967 100755
--- a/system_test/build_system_test.sh
+++ b/system_test/build_system_test.sh
@@ -79,28 +79,37 @@ function cross_make {
make -j"$BUILD_THREADS" $*
}
+function clean_up_on_fail() {
+ cross_make ARCH=${ARCH} O=${KERNEL_OUT} distclean
+ rm -rf ${KERNEL_OUT}
+}
+
function build_the_kernel() {
cross_make ARCH=${ARCH} O=${KERNEL_OUT}
if [ "$?" -gt 0 ]; then
echo "Building the ${TESTSUITE} kernel failed"
+ clean_up_on_fail
exit 1
fi
cross_make ARCH=${ARCH} O=${KERNEL_OUT} dtbs
if [ "$?" -gt 0 ]; then
echo "Building the ${TESTSUITE} dtbs failed"
+ clean_up_on_fail
exit 1
fi
cross_make ARCH=${ARCH} O=${KERNEL_OUT} modules
if [ "$?" -gt 0 ]; then
echo "Building the ${TESTSUITE} modules failed"
+ clean_up_on_fail
exit 1
fi
cross_make ARCH=${ARCH} O=${KERNEL_OUT} tar-pkg
if [ "$?" -gt 0 ]; then
echo "Tar-pk for ${TESTSUITE} failed"
+ clean_up_on_fail
exit 1
fi