Revert "(HEAD -> master, origin/master, origin/HEAD) EXPRIMENTAL: Support separate stdout/stderr redirect"

Revert accidental commit.

This reverts commit r255609.

git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@255610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun 2015-12-15 02:51:57 +00:00
Родитель 28e3f2db7a
Коммит a8164c67ac
7 изменённых файлов: 27 добавлений и 74 удалений

2
External/Nurbs/lit.local.cfg поставляемый
Просмотреть файл

@ -1 +1 @@
config.produce_traditional_output = True
config.output_append_exitstatus = True

2
External/Povray/lit.local.cfg поставляемый
Просмотреть файл

@ -1 +1 @@
config.produce_traditional_output = True
config.output_append_exitstatus = True

2
External/skidmarks10/lit.local.cfg поставляемый
Просмотреть файл

@ -1 +1 @@
config.produce_traditional_output = True
config.output_append_exitstatus = True

Просмотреть файл

@ -1 +1 @@
config.produce_traditional_output = True
config.output_append_exitstatus = True

Просмотреть файл

@ -16,9 +16,8 @@
#
# Syntax:
#
# RunSafely.sh [-d <workdir>] [-r <rhost>] [-l <ruser>] [-rc <client>]
# [-rp <port>] [-u <under>] [--show-errors]
# [-n [-o <stdoutfile>] [-e <stderrfile>]]
# RunSafely.sh [--omit-exitval] [-d <workdir>] [-r <rhost>] [-l <ruser>]
# [-rc <client>] [-rp <port>] [-u <under>] [--show-errors]
# -t <timeit> <timeout> <infile> <outfile> <program> <args...>
#
# where:
@ -28,13 +27,10 @@
# <client> is the remote client used to execute the program
# <port> is the port used by the remote client
# <under> is a wrapper that the program is run under
# <stdoutfile> file where standard output is written to
# <stderrfile> file where standard error output is written to
# <timeit> is a wrapper that is used to collect timing data
# <timeout> is the maximum number of seconds to let the <program> run
# <infile> is a file from which standard input is directed
# <outfile> is a file to which standard output and error are directed.
# This argument is not parsed if -n was specified.
# <outfile> is a file to which standard output and error are directed
# <program> is the path to the program to run
# <args...> are the arguments to pass to the program.
#
@ -61,10 +57,12 @@ RCLIENT=rsh
RUN_UNDER=
TIMEIT=
SHOW_ERRORS=0
NEW_MODE=0
STDOUT_FILE=""
STDERR_FILE=""
OMIT_EXITVAL=0
PWD=`pwd`
if [ $1 = "--omit-exitval" ]; then
OMIT_EXITVAL=1
shift 1
fi
if [ $1 = "-d" ]; then
PWD="$2"
shift 2
@ -93,18 +91,6 @@ if [ $1 = "--show-errors" ]; then
SHOW_ERRORS=1
shift 1
fi
if [ $1 = "-n" ]; then
NEW_MODE=1
shift 1
if [ $1 = "-o" ]; then
STDOUT_FILE="$2"
shift 2
fi
if [ $1 = "-e" ]; then
STDERR_FILE="$2"
shift 2
fi
fi
if [ $1 = "-t" ]; then
TIMEIT=$2
shift 2
@ -150,45 +136,19 @@ COMMAND="$RUN_UNDER $PROGRAM $*"
TIMEITCMD="$TIMEIT $LIMITARGS --timeout $TIMELIMIT --chdir $PWD"
if [ "x$RHOST" = x ] ; then
rm -f "$OUTFILE.time"
if [ "$STDOUT_FILE" != "" ]; then
TIMEITCMD="$TIMEITCMD --redirect-stdout $STDOUT_FILE"
fi
if [ "$STDERR_FILE" != "" ]; then
TIMEITCMD="$TIMEITCMD --redirect-stderr $STDERR_FILE"
fi
if [ "$NEW_MODE" = "0" ]; then
TIMEITCMD="$TIMEITCMD --redirect-output $OUTFILE"
fi
$TIMEITCMD \
--summary $OUTFILE.time \
--redirect-input $INFILE \
--redirect-output $OUTFILE \
$COMMAND
else
# Get the absolute path to INFILE.
ABSINFILE=$(cd $(dirname $INFILE); pwd)/$(basename $INFILE)
PROG_BASENAME="$(basename ${PROG})"
if [ "$STDOUT_FILE" != "" ]; then
case "$STDOUT_FILE" in
/*) STDOUT_FILE_ABS="$STDOUT_FILE";;
*) STDOUT_FILE_ABS="$PWD/$STDOUT_FILE";;
esac
TIMEITCMD="$TIMEITCMD --redirect-stdout ${STDOUT_FILE_ABS}"
fi
if [ "$STDERR_FILE" != "" ]; then
case "$STDERR_FILE" in
/*) STDERR_FILE_ABS="$STDERR_FILE";;
*) STDERR_FILE_ABS="$PWD/$STDERR_FILE";;
esac
TIMEITCMD="$TIMEITCMD --redirect-stderr ${STDERR_FILE_ABS}"
fi
case "$OUTFILE" in
/*) OUTFILE_ABS="$OUTFILE";;
*) OUTFILE_ABS="$PWD/$OUTFILE";;
esac
if [ "$NEW_MODE" = "0" ]; then
TIMEITCMD="$TIMEITCMD --redirect-output ${OUTFILE_ABS}.remote"
fi
rm -f "$PWD/${PROG_BASENAME}.command"
rm -f "$PWD/${PROG_BASENAME}.remote"
rm -f "${OUTFILE_ABS}.remote.time"
@ -224,7 +184,7 @@ elif [ "$SHOW_ERRORS" -eq 1 -a "$exitval" -ne 0 ] ; then
else
fail=no
fi
if [ "$NEW_MODE" = "0" ]; then
if [ "$OMIT_EXITVAL" -ne 1 ]; then
echo "exit $exitval" >> $OUTFILE
fi

Просмотреть файл

@ -1 +1 @@
config.produce_traditional_output = True
config.output_append_exitstatus = True

31
lit.cfg
Просмотреть файл

@ -87,33 +87,37 @@ def prepareRunSafely(config, commandline, outfile):
workdir = None
tokens = shlex.split(commandline)
# Parse "< INPUTFILE", "> OUTFILE", "2> OUTFILE" patterns
i = 0
while i < len(tokens):
for i in range(len(tokens)):
if tokens[i] == "<" and i+1 < len(tokens):
stdin = tokens[i+1]
del tokens[i+1]
del tokens[i]
continue
break
elif tokens[i] == ">" and i+1 < len(tokens):
stdout = tokens[i+1]
del tokens[i+1]
del tokens[i]
continue
break
elif tokens[i] == "2>" and i+1 < len(tokens):
stderr = tokens[i+1]
del tokens[i+1]
del tokens[i]
continue
break
if i+2 < len(tokens) and tokens[i] == "cd" and tokens[i+2] == ";":
workdir = tokens[i+1]
del tokens[i+2]
del tokens[i+1]
del tokens[i]
continue
i += 1
if stdin is None:
stdin = "/dev/null"
if stdout is not None or stderr is not None:
raise Exception("stdout/stderr redirection in combination with RunSafely not implemented yet")
runsafely = "%s/RunSafely.sh" % config.test_suite_root
runsafely_prefix = [ runsafely ]
if not config.output_append_exitstatus:
runsafely_prefix += [ "--omit-exitval" ]
if workdir is not None:
runsafely_prefix += [ "-d", workdir ]
if config.remote_host:
@ -126,19 +130,8 @@ def prepareRunSafely(config, commandline, outfile):
runsafely_prefix += [ "-rp", config.remote_port ]
if config.run_under:
runsafely_prefix += [ "-u", config.run_under ]
if not config.produce_traditional_output:
runsafely_prefix += [ "-n" ]
if stdout is not None:
runsafely_prefix += [ "-o", stdout ]
if stderr is not None:
runsafely_prefix += [ "-e", stderr ]
else:
if stdout is not None or stderr is not None:
raise Exception("separate stdout/stderr redirection not possible with traditional output")
timeit = "%s/tools/timeit-target" % config.test_source_root
timeout = "7200"
if stdin is None:
stdin = "/dev/null"
runsafely_prefix += [ "-t", timeit, timeout, stdin, outfile ]
new_commandline = " ".join(map(quote, runsafely_prefix + tokens))
@ -232,6 +225,6 @@ config.name = 'test-suite'
config.test_format = TestSuiteTest()
config.suffixes = ['.test']
config.excludes = ['ABI-Testsuite']
config.produce_traditional_output = False
config.output_append_exitstatus = False
if 'SSH_AUTH_SOCK' in os.environ:
config.environment['SSH_AUTH_SOCK'] = os.environ['SSH_AUTH_SOCK']