From a8164c67acd9e3aae36dfb6d99966d1e426f68af Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 15 Dec 2015 02:51:57 +0000 Subject: [PATCH] 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 --- External/Nurbs/lit.local.cfg | 2 +- External/Povray/lit.local.cfg | 2 +- External/skidmarks10/lit.local.cfg | 2 +- MultiSource/lit.local.cfg | 2 +- RunSafely.sh | 60 +++++------------------------- SingleSource/lit.local.cfg | 2 +- lit.cfg | 31 ++++++--------- 7 files changed, 27 insertions(+), 74 deletions(-) diff --git a/External/Nurbs/lit.local.cfg b/External/Nurbs/lit.local.cfg index 46b2a9a7..babebd99 100644 --- a/External/Nurbs/lit.local.cfg +++ b/External/Nurbs/lit.local.cfg @@ -1 +1 @@ -config.produce_traditional_output = True +config.output_append_exitstatus = True diff --git a/External/Povray/lit.local.cfg b/External/Povray/lit.local.cfg index 46b2a9a7..babebd99 100644 --- a/External/Povray/lit.local.cfg +++ b/External/Povray/lit.local.cfg @@ -1 +1 @@ -config.produce_traditional_output = True +config.output_append_exitstatus = True diff --git a/External/skidmarks10/lit.local.cfg b/External/skidmarks10/lit.local.cfg index 46b2a9a7..babebd99 100644 --- a/External/skidmarks10/lit.local.cfg +++ b/External/skidmarks10/lit.local.cfg @@ -1 +1 @@ -config.produce_traditional_output = True +config.output_append_exitstatus = True diff --git a/MultiSource/lit.local.cfg b/MultiSource/lit.local.cfg index 46b2a9a7..babebd99 100644 --- a/MultiSource/lit.local.cfg +++ b/MultiSource/lit.local.cfg @@ -1 +1 @@ -config.produce_traditional_output = True +config.output_append_exitstatus = True diff --git a/RunSafely.sh b/RunSafely.sh index a6876c5d..2e7d9059 100755 --- a/RunSafely.sh +++ b/RunSafely.sh @@ -16,9 +16,8 @@ # # Syntax: # -# RunSafely.sh [-d ] [-r ] [-l ] [-rc ] -# [-rp ] [-u ] [--show-errors] -# [-n [-o ] [-e ]] +# RunSafely.sh [--omit-exitval] [-d ] [-r ] [-l ] +# [-rc ] [-rp ] [-u ] [--show-errors] # -t # # where: @@ -28,13 +27,10 @@ # is the remote client used to execute the program # is the port used by the remote client # is a wrapper that the program is run under -# file where standard output is written to -# file where standard error output is written to # is a wrapper that is used to collect timing data # is the maximum number of seconds to let the run # is a file from which standard input is directed -# is a file to which standard output and error are directed. -# This argument is not parsed if -n was specified. +# is a file to which standard output and error are directed # is the path to the program to run # 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 diff --git a/SingleSource/lit.local.cfg b/SingleSource/lit.local.cfg index 46b2a9a7..babebd99 100644 --- a/SingleSource/lit.local.cfg +++ b/SingleSource/lit.local.cfg @@ -1 +1 @@ -config.produce_traditional_output = True +config.output_append_exitstatus = True diff --git a/lit.cfg b/lit.cfg index a80b758e..6918b1a2 100644 --- a/lit.cfg +++ b/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']