aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-08-09 20:13:55 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-08-11 08:07:23 +0000
commit7854f12dda22c676a3e3ae1de404fff5163830c9 (patch)
treed75258e980fc5b0f10e0cabed7a9cb1e0f2dcbbd
parent6070ee370d1e3c57af6de094d266afeed78427d9 (diff)
lib/make.sh (make_check): Indent code
Change-Id: I37409062eeca6057b51469e607f021bb2ad5166d
-rw-r--r--lib/make.sh135
1 files changed, 66 insertions, 69 deletions
diff --git a/lib/make.sh b/lib/make.sh
index 5375da94..eff4fceb 100644
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -750,84 +750,81 @@ make_check()
# Run tests
local checklog="${builddir}/check-${component}.log"
record_artifact "log_check_${component}" "${checklog}"
- if false; then
- :
- else
- local dirs check_targets exec_tests
- dirs="/"
- check_targets="check"
- exec_tests=false
- case "$component" in
- binutils)
- dirs="/binutils /ld /gas"
- check_targets="check-DEJAGNU"
- exec_tests=true
- ;;
- gcc)
- exec_tests=true
- ;;
- gdb)
- check_targets="check-gdb"
- exec_tests=true
- ;;
- glibc)
- check_targets="check run-built-tests=no"
- ;;
- newlib)
- # We need a special case for newlib, to bypass its
- # multi-do Makefile targets that do not properly
- # propagate multilib flags. This means that we call
- # runtest only once for newlib.
- dirs="/${target}/newlib"
- check_targets="check-DEJAGNU"
- ;;
- esac
- local schroot_make_opts
+ local dirs check_targets exec_tests
+ dirs="/"
+ check_targets="check"
+ exec_tests=false
+ case "$component" in
+ binutils)
+ dirs="/binutils /ld /gas"
+ check_targets="check-DEJAGNU"
+ exec_tests=true
+ ;;
+ gcc)
+ exec_tests=true
+ ;;
+ gdb)
+ check_targets="check-gdb"
+ exec_tests=true
+ ;;
+ glibc)
+ check_targets="check run-built-tests=no"
+ ;;
+ newlib)
+ # We need a special case for newlib, to bypass its
+ # multi-do Makefile targets that do not properly
+ # propagate multilib flags. This means that we call
+ # runtest only once for newlib.
+ dirs="/${target}/newlib"
+ check_targets="check-DEJAGNU"
+ ;;
+ esac
- if $exec_tests && [ x"$test_container" != x"" ]; then
- schroot_make_opts=$(print_make_opts_and_copy_sysroot "$test_container")
- if [ $? -ne 0 ]; then
- error "Cannot initialize sysroot on $test_container"
- return 1
- fi
- elif [ x"${build}" = x"${target}" ]; then
- schroot_make_opts="ABE_TEST_CONTAINER=local"
- fi
+ local schroot_make_opts
- if $exec_tests && [ x"${clibrary}" != "newlib" ]; then
- touch ${sysroots}/libc/etc/ld.so.cache
- chmod 700 ${sysroots}/libc/etc/ld.so.cache
+ if $exec_tests && [ x"$test_container" != x"" ]; then
+ schroot_make_opts=$(print_make_opts_and_copy_sysroot "$test_container")
+ if [ $? -ne 0 ]; then
+ error "Cannot initialize sysroot on $test_container"
+ return 1
fi
+ elif [ x"${build}" = x"${target}" ]; then
+ schroot_make_opts="ABE_TEST_CONTAINER=local"
+ fi
- # Remove existing logs so that rerunning make check results
- # in a clean log.
- if test -e ${checklog}; then
- # This might or might not be called, depending on whether make_clean
- # is called before make_check. None-the-less it's better to be safe.
- notice "Removing existing check-${component}.log: ${checklog}"
- rm ${checklog}
- fi
+ if $exec_tests && [ x"${clibrary}" != "newlib" ]; then
+ touch ${sysroots}/libc/etc/ld.so.cache
+ chmod 700 ${sysroots}/libc/etc/ld.so.cache
+ fi
- local i result=0
- for i in ${dirs}; do
- # Always append "tee -a" to the log when building components individually
- dryrun "make ${check_targets} SYSROOT_UNDER_TEST=${sysroots}/libc FLAGS_UNDER_TEST=\"\" PREFIX_UNDER_TEST=\"$prefix/bin/${target}-\" QEMU_CPU_UNDER_TEST=${qemu_cpu} ${schroot_make_opts} ${make_flags} -w -i -k -C ${builddir}$i 2>&1 | tee -a ${checklog}"
- if [ $? != 0 ]; then
- warning "make ${check_targets} -C ${builddir}$i failed."
- result=1
- fi
- record_test_results "${component}" $2
- done
+ # Remove existing logs so that rerunning make check results
+ # in a clean log.
+ if test -e ${checklog}; then
+ # This might or might not be called, depending on whether make_clean
+ # is called before make_check. None-the-less it's better to be safe.
+ notice "Removing existing check-${component}.log: ${checklog}"
+ rm ${checklog}
+ fi
- if $exec_tests && [ x"${clibrary}" != "newlib" ]; then
- rm -rf ${sysroots}/libc/etc/ld.so.cache
+ local i result=0
+ for i in ${dirs}; do
+ # Always append "tee -a" to the log when building components individually
+ dryrun "make ${check_targets} SYSROOT_UNDER_TEST=${sysroots}/libc FLAGS_UNDER_TEST=\"\" PREFIX_UNDER_TEST=\"$prefix/bin/${target}-\" QEMU_CPU_UNDER_TEST=${qemu_cpu} ${schroot_make_opts} ${make_flags} -w -i -k -C ${builddir}$i 2>&1 | tee -a ${checklog}"
+ if [ $? != 0 ]; then
+ warning "make ${check_targets} -C ${builddir}$i failed."
+ result=1
fi
+ record_test_results "${component}" $2
+ done
- if [ $result != 0 ]; then
- error "Making check in ${builddir} failed"
- return 1
- fi
+ if $exec_tests && [ x"${clibrary}" != "newlib" ]; then
+ rm -rf ${sysroots}/libc/etc/ld.so.cache
+ fi
+
+ if [ $result != 0 ]; then
+ error "Making check in ${builddir} failed"
+ return 1
fi
if test x"${component}" = x"gcc"; then