[test-suite] r255610 - Revert "(HEAD -> master, origin/master, origin/HEAD) EXPRIMENTAL: Support separate stdout/stderr redirect"
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 14 18:51:57 PST 2015
Author: matze
Date: Mon Dec 14 20:51:57 2015
New Revision: 255610
URL: http://llvm.org/viewvc/llvm-project?rev=255610&view=rev
Log:
Revert "(HEAD -> master, origin/master, origin/HEAD) EXPRIMENTAL: Support separate stdout/stderr redirect"
Revert accidental commit.
This reverts commit r255609.
Modified:
test-suite/trunk/External/Nurbs/lit.local.cfg
test-suite/trunk/External/Povray/lit.local.cfg
test-suite/trunk/External/skidmarks10/lit.local.cfg
test-suite/trunk/MultiSource/lit.local.cfg
test-suite/trunk/RunSafely.sh
test-suite/trunk/SingleSource/lit.local.cfg
test-suite/trunk/lit.cfg
Modified: test-suite/trunk/External/Nurbs/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/Nurbs/lit.local.cfg?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/External/Nurbs/lit.local.cfg (original)
+++ test-suite/trunk/External/Nurbs/lit.local.cfg Mon Dec 14 20:51:57 2015
@@ -1 +1 @@
-config.produce_traditional_output = True
+config.output_append_exitstatus = True
Modified: test-suite/trunk/External/Povray/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/Povray/lit.local.cfg?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/External/Povray/lit.local.cfg (original)
+++ test-suite/trunk/External/Povray/lit.local.cfg Mon Dec 14 20:51:57 2015
@@ -1 +1 @@
-config.produce_traditional_output = True
+config.output_append_exitstatus = True
Modified: test-suite/trunk/External/skidmarks10/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/skidmarks10/lit.local.cfg?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/External/skidmarks10/lit.local.cfg (original)
+++ test-suite/trunk/External/skidmarks10/lit.local.cfg Mon Dec 14 20:51:57 2015
@@ -1 +1 @@
-config.produce_traditional_output = True
+config.output_append_exitstatus = True
Modified: test-suite/trunk/MultiSource/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/lit.local.cfg?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/lit.local.cfg (original)
+++ test-suite/trunk/MultiSource/lit.local.cfg Mon Dec 14 20:51:57 2015
@@ -1 +1 @@
-config.produce_traditional_output = True
+config.output_append_exitstatus = True
Modified: test-suite/trunk/RunSafely.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunSafely.sh?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/RunSafely.sh (original)
+++ test-suite/trunk/RunSafely.sh Mon Dec 14 20:51:57 2015
@@ -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
else
fail=no
fi
-if [ "$NEW_MODE" = "0" ]; then
+if [ "$OMIT_EXITVAL" -ne 1 ]; then
echo "exit $exitval" >> $OUTFILE
fi
Modified: test-suite/trunk/SingleSource/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/lit.local.cfg?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/lit.local.cfg (original)
+++ test-suite/trunk/SingleSource/lit.local.cfg Mon Dec 14 20:51:57 2015
@@ -1 +1 @@
-config.produce_traditional_output = True
+config.output_append_exitstatus = True
Modified: test-suite/trunk/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/lit.cfg?rev=255610&r1=255609&r2=255610&view=diff
==============================================================================
--- test-suite/trunk/lit.cfg (original)
+++ test-suite/trunk/lit.cfg Mon Dec 14 20:51:57 2015
@@ -87,33 +87,37 @@ def prepareRunSafely(config, commandline
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
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']
More information about the llvm-commits
mailing list