diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-12-20 15:08:07 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-12-20 17:21:07 -0500 |
commit | 59211623564fe3e7636eeab5255cd732d9f1aee8 (patch) | |
tree | b05a99ea70d10ed343118da6417b771319fb6af4 /net-misc | |
parent | sys-fs/squashfs-tools: Fix building with GCC 5 (diff) | |
download | gentoo-59211623564fe3e7636eeab5255cd732d9f1aee8.tar.gz gentoo-59211623564fe3e7636eeab5255cd732d9f1aee8.tar.bz2 gentoo-59211623564fe3e7636eeab5255cd732d9f1aee8.zip |
net-misc/openssh: clean up test code a bit
Use arrays instead of a flat scalar, and clean up the warning/error output.
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/openssh/openssh-7.3_p1-r8.ebuild | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/net-misc/openssh/openssh-7.3_p1-r8.ebuild b/net-misc/openssh/openssh-7.3_p1-r8.ebuild index a03905c5b8f6..f886839d5865 100644 --- a/net-misc/openssh/openssh-7.3_p1-r8.ebuild +++ b/net-misc/openssh/openssh-7.3_p1-r8.ebuild @@ -272,37 +272,32 @@ src_install() { } src_test() { - local t tests skipped failed passed shell - tests="interop-tests compat-tests" - skipped="" - shell=$(egetshell ${UID}) + local t skipped=() failed=() passed=() + local tests=( interop-tests compat-tests ) + + local shell=$(egetshell "${UID}") if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then - elog "Running the full OpenSSH testsuite" - elog "requires a usable shell for the 'portage'" + elog "Running the full OpenSSH testsuite requires a usable shell for the 'portage'" elog "user, so we will run a subset only." - skipped="${skipped} tests" + skipped+=( tests ) else - tests="${tests} tests" + tests+=( tests ) fi - # It will also attempt to write to the homedir .ssh + + # It will also attempt to write to the homedir .ssh. local sshhome=${T}/homedir mkdir -p "${sshhome}"/.ssh - for t in ${tests} ; do + for t in "${tests[@]}" ; do # Some tests read from stdin ... HOMEDIR="${sshhome}" HOME="${sshhome}" \ emake -k -j1 ${t} </dev/null \ - && passed="${passed}${t} " \ - || failed="${failed}${t} " + && passed+=( "${t}" ) \ + || failed+=( "${t}" ) done - einfo "Passed tests: ${passed}" - ewarn "Skipped tests: ${skipped}" - if [[ -n ${failed} ]] ; then - ewarn "Failed tests: ${failed}" - die "Some tests failed: ${failed}" - else - einfo "Failed tests: ${failed}" - return 0 - fi + + einfo "Passed tests: ${passed[*]}" + [[ ${#skipped[@]} -gt 0 ]] && ewarn "Skipped tests: ${skipped[*]}" + [[ ${#failed[@]} -gt 0 ]] && die "Some tests failed: ${failed[*]}" } pkg_preinst() { |