Add the ability to capture the test script output in a log file.

This commit is contained in:
Brook Milligan 2009-03-06 16:19:01 +00:00 committed by Thomas Klausner
parent acbdc315c2
commit 4ebd784e06
3 changed files with 28 additions and 7 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2009/03/05 15:59:57 brook1 Exp $
# $NetBSD: Makefile,v 1.5 2009/03/06 16:19:01 brook1 Exp $
DISTNAME= boost-test-suite-20090305
CATEGORIES= devel
@ -16,6 +16,7 @@ USE_TOOLS+= ftp pax patch
FTP= ${TOOLS_PLATFORM.ftp}
HOSTNAME= ${TOOLS_PLATFORM.hostname}
TEE= ${TOOLS_PLATFORM.tee}
BOOST_USER?= ${USER}
BOOST_TEST_BASEDIR?= /var/boost
@ -46,6 +47,7 @@ SUBST_VARS.fix-files+= PATCH
SUBST_VARS.fix-files+= PYTHONBIN
SUBST_VARS.fix-files+= RM
SUBST_VARS.fix-files+= SED
SUBST_VARS.fix-files+= TEE
SUBST_VARS.fix-files+= TR
SUBST_VARS.fix-files+= UNAME

View file

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: boost-test-suite,v 1.7 2009/03/06 15:15:11 brook1 Exp $
# $NetBSD: boost-test-suite,v 1.8 2009/03/06 16:19:01 brook1 Exp $
# Copyright (c) 2009, Brook Milligan < brook -at- nmsu.edu >
# All rights reserved.
@ -44,7 +44,7 @@ usage ()
echo >&2 \
" [-N name] [-S schedule] [-T title] [-U username] [-b directory]"
echo >&2 \
" [-t toolset] [-- args]"
" [-l logfile] [-t toolset] [-- args]"
echo >&2 \
" -D -- email domain to contact operator [$CONTACT_DOMAIN]"
echo >&2 \
@ -69,6 +69,8 @@ usage ()
" -h -- print this help (see the man page for more information)"
echo >&2 \
" -i -- do not import patches; use the distributed patches instead"
echo >&2 \
" -l -- log output of test to logfile"
echo >&2 \
" -p -- do not patch files prior to test"
echo >&2 \
@ -90,6 +92,7 @@ MKDIR="@MKDIR@"
PYTHON=@PYTHONBIN@
RM=@RM@
SED=@SED@
TEE=@TEE@
TR=@TR@
UNAME=@UNAME@
@ -122,8 +125,9 @@ CLEAN=0 # default: do NOT clean up files before test
USE_PATCHES=1 # default: use patches
IMPORT_PATCHES=1 # default: import patches (if needed)
INDEX_URL= # default: public URL for patches
LOG_FILE= # default: no logging
while getopts D:I:N:S:T:U:Vb:cdipt:vh opt
while getopts D:I:N:S:T:U:Vb:cdil:pt:vh opt
do
case "$opt" in
D) CONTACT_DOMAIN="$OPTARG";;
@ -137,6 +141,7 @@ do
c) CLEAN=1;;
d) DEBUG=1;;
i) IMPORT_PATCHES=0;;
l) LOG_FILE="$OPTARG";;
p) USE_PATCHES=0;;
t) TOOLSET="$OPTARG";;
v) VERBOSE=$($EXPR $VERBOSE + 1);;
@ -238,6 +243,11 @@ fi
RUNNER=$RUNNER_BASE$PATCHED
TEST_CMD="$PYTHON $RUN_SCRIPT --runner=$RUNNER --toolset=$TOOLSET $RUN_SCRIPT_ARGS"
if [ -z "$LOG_FILE" ]; then
REAL_TEST_CMD="$TEST_CMD"
else
REAL_TEST_CMD="$TEST_CMD | $TEE -a $LOG_FILE"
fi
# create comment.html
echo "Creating comment.html ..."
@ -279,9 +289,12 @@ fi
# run test suite
echo "Testing Boost: $RUNNER ..."
if [ $DEBUG -ne 0 -o $VERBOSE -ne 0 ]; then
echo "$TEST_CMD"
echo "$REAL_TEST_CMD"
fi
exec $TEST_CMD
if [ -n "$LOG_FILE" ]; then
eval echo "Testing Boost: $RUNNER in $BASEDIR ..." > $LOG_FILE
fi
eval $REAL_TEST_CMD
if [ $? -ne 0 ]; then
echo "An error occurred while running the tests. The results in"

View file

@ -1,4 +1,4 @@
.\" $NetBSD: boost-test-suite.1,v 1.4 2009/03/06 15:49:08 brook1 Exp $
.\" $NetBSD: boost-test-suite.1,v 1.5 2009/03/06 16:19:01 brook1 Exp $
.\"
.\" Copyright (c) 2009 Brook Milligan. < brook -at- nmsu.edu >
.\" All rights reserved.
@ -39,6 +39,7 @@
.Op Fl T Ar title
.Op Fl U Ar username
.Op Fl b Ar directory
.Op Fl l Ar logfile
.Op Fl t Ar toolset
.Op -- Ar args
.Sh DESCRIPTION
@ -176,6 +177,11 @@ Print a brief help page.
.It Fl i
Do not import patches. Instead, use the fixed set distributed with
the package.
.It Fl l Ar logfile
Log the output of the test runs to
.Ar logfile .
Note that a relative path will be resolved relative to the test
directory.
.It Fl p
Do not patch the source prior to running the tests.
.It Fl t Ar toolset