From 00c42312673248ca49c1933a162a29261949e483 Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Thu, 10 Oct 2002 20:36:53 +0000 Subject: [PATCH] Bug 131386: use 'tee' (in a pipe) instead of 'tail -f' when we need to display the test output on stdout. This avoids the need to kill the tail process, which is tricky to do under MKS Korn Shell on Windows. Modified Files: all.sh jssqa common/init.sh --- security/nss/tests/all.sh | 24 ++++++------------------ security/nss/tests/common/init.sh | 3 --- security/nss/tests/jssqa | 20 ++++++++++++-------- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/security/nss/tests/all.sh b/security/nss/tests/all.sh index 7fabc4863d29..1e75ee743251 100755 --- a/security/nss/tests/all.sh +++ b/security/nss/tests/all.sh @@ -84,30 +84,18 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then . ./init.sh fi -if [ -z "O_CRON" -o "$O_CRON" != "ON" ] -then - tail -f ${LOGFILE} & - TAILPID=$! -fi - for i in ${TESTS} do SCRIPTNAME=${i}.sh echo "Running Tests for $i" - (cd ${QADIR}/$i ; . ./$SCRIPTNAME all file >> ${LOGFILE} 2>&1) + if [ "$O_CRON" = "ON" ] + then + (cd ${QADIR}/$i ; . ./$SCRIPTNAME all file >> ${LOGFILE} 2>&1) + else + (cd ${QADIR}/$i ; . ./$SCRIPTNAME all file 2>&1 | tee -a ${LOGFILE}) + fi done SCRIPTNAME=all.sh -if [ -z "O_CRON" -o "$O_CRON" != "ON" ] -then - kill ${TAILPID} - if [ -n "$os_name" -a "$os_name" = "Windows" ] - then - echo "MKS special - killing the tail -f" - kill `ps | grep "tail -f ${LOGFILE}" | grep -v grep | - sed -e "s/^ *//" -e "s/ .*//"` - fi -fi - . ${QADIR}/common/cleanup.sh diff --git a/security/nss/tests/common/init.sh b/security/nss/tests/common/init.sh index bb8a5125dc61..fde7c30d0819 100644 --- a/security/nss/tests/common/init.sh +++ b/security/nss/tests/common/init.sh @@ -80,9 +80,6 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then html_failed "$*" fi echo "
" >> ${RESULTS} - if [ -n "${TAILPID}" ]; then - ${KILL} "${TAILPID}" - fi if [ -n "${SERVERPID}" -a -f "${SERVERPID}" ]; then ${KILL} `cat ${SERVERPID}` fi diff --git a/security/nss/tests/jssqa b/security/nss/tests/jssqa index 79566a2f9078..d5356b9e82fe 100755 --- a/security/nss/tests/jssqa +++ b/security/nss/tests/jssqa @@ -202,15 +202,19 @@ jss_test() jss_init jss_mode_init -if [ -z "O_CRON" -o "$O_CRON" != "ON" -a "$O_WIN" != "ON" ] -then - tail -f ${JSS_LOGFILE} & - TAILPID=$! -fi -jss_test >>$JSS_LOGFILE 2>&1 +if [ "$O_CRON" = "ON" -o "$O_WIN" = "ON" ] +then + jss_test >>$JSS_LOGFILE 2>&1 +else + jss_test 2>&1 | tee -a $JSS_LOGFILE +fi BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" jss_mode_init -jss_test >>$JSS_LOGFILE 2>&1 -kill $TAILPID +if [ "$O_CRON" = "ON" -o "$O_WIN" = "ON" ] +then + jss_test >>$JSS_LOGFILE 2>&1 +else + jss_test 2>&1 | tee -a $JSS_LOGFILE +fi Exit "jssqa completed. Done `uname -n` $QA_OS_STRING"