aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2015-04-01 15:58:22 -0500
committerChristophe Lyon <christophe.lyon@linaro.org>2015-04-02 21:21:09 +0100
commit3c7485cb3529c86e19ee380a53f1dad4528d078b (patch)
tree0facc033d3dd9c45cbba8a2b3c2f97eacbdc98c3
parente8680cf9885d927ef5ff37df361e93264f7d7cbd (diff)
Add 'return 1' code paths when make check or make clean fails.
Change-Id: I6dfca0b9b73afcbaa43407fde64b071aa414f630
-rwxr-xr-xlib/make.sh33
-rw-r--r--lib/package.sh9
2 files changed, 38 insertions, 4 deletions
diff --git a/lib/make.sh b/lib/make.sh
index 06440368..588cdf68 100755
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -267,6 +267,10 @@ build_all()
# test_binary_toolchain.
if test x"${runtests}" != x; then
test_binary_toolchain
+ if test $? -gt 0; then
+ error "test_binary_toolchain failed with return code $?"
+ return 1
+ fi
notice "Testing packaging took ${SECONDS} seconds"
fi
fi
@@ -694,7 +698,7 @@ make_check_installed()
if test x"${builddir}" = x; then
local builddir="`get_builddir $1 ${2:+$2}`"
fi
- notice "Making check in ${builddir}"
+ notice "Making check in ${builddir} on installed components"
# TODO:
# extract binary tarball
@@ -705,15 +709,27 @@ make_check_installed()
local tests=""
case $1 in
binutils*)
- # these
local builddir="`get_builddir ${binutils_version} ${2:+$2}`"
dryrun "make -C ${builddir}/gas check-DEJAGNU RUNTESTFLAGS=${runtest_flags} ${make_flags} -w -i -k 2>&1 | tee ${builddir}/check-binutils.log"
+ if test $? -gt 0; then
+ error "make -C ${builddir}/gas failed."
+ return 1;
+ fi
dryrun "make -C ${builddir}/ld check-DEJAGNU RUNTESTFLAGS=${runtest_flags} ${make_flags} -w -i -k 2>&1 | tee -a ${builddir}/check-binutils.log"
+ if test $? -gt 0; then
+ error "make -C ${builddir}/ld failed."
+ return 1;
+ fi
;;
gcc*)
local builddir="`get_builddir ${gcc_version} ${2:+$2}`"
for i in "c c++"; do
dryrun "make -C ${builddir} check-gcc=$i RUNTESTFLAGS=${runtest_flags} ${make_flags} -w -i -k 2>&1 | tee -a ${builddir}/check-$i.log"
+ if test $? -gt 0; then
+ error "make -C ${builddir} check-gcc=$i failed."
+ return 1;
+ fi
+
done
;;
*libc*)
@@ -751,7 +767,7 @@ make_check()
notice "Making check in ${builddir}"
# if test x"$2" != x; then
-# make_check_installed
+# make_check_installed ${2}
# return 0
# fi
@@ -786,7 +802,11 @@ make_check()
# Run tests
local checklog="${builddir}/check-${tool}.log"
if test x"${build}" = x"${target}" -a x"${tarbin}" != x"yes"; then
- dryrun "make check RUNTESTFLAGS=\"${runtest_flags} --xml=${tool}.xml \" ${make_flags} -w -i -k -C ${builddir} 2>&1 | tee ${checklog}"
+ dryrun "make check RUNTESTFLAGS=\"${runtest_flags} --xml=${tool}.xml \" ${make_flags} -w -i -k -C ${builddir} 2>&1 | tee ${checklog}"
+ if test $? -gt 0; then
+ error "make check -C ${builddir} failed."
+ return 1
+ fi
else
local exec_tests
exec_tests=false
@@ -846,7 +866,12 @@ make_check()
fi
for i in ${dirs}; do
+ # Always append "tee -a" to the log when building components individually
dryrun "make ${check_targets} SYSROOT_UNDER_TEST=${sysroots} FLAGS_UNDER_TEST=\"\" PREFIX_UNDER_TEST=\"${local_builds}/destdir/${host}/bin/${target}-\" RUNTESTFLAGS=\"${runtest_flags}\" ${schroot_make_opts} ${make_flags} -w -i -k -C ${builddir}$i 2>&1 | tee -a ${checklog}"
+ if test $? -gt 0; then
+ error "make ${check_targets} -C ${builddir}$i failed."
+ return 1
+ fi
done
# Stop schroot sessions
diff --git a/lib/package.sh b/lib/package.sh
index e9f40f28..a3d0b661 100644
--- a/lib/package.sh
+++ b/lib/package.sh
@@ -573,13 +573,22 @@ test_binary_toolchain()
# test GCC using the build we just completed, since we need access to the test cases.
make_clean ${binutils_version} binutils
make_check ${binutils_version} binutils
+ if test $? -gt 0; then
+ error "'make_check ${binutils_version} binutils'."
+ return 1
+ fi
fi
# Only test gcc if the user has requested it.
if test $testgcc -eq 0; then
make_clean ${gcc_version} stage2
make_check ${gcc_version} stage2
+ if test $? -gt 0; then
+ error "'make_check ${gcc_version} stage2' failed."
+ return 1
+ fi
fi
rm -fr ${install}
+ return 0
}