aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-12-05 04:36:12 +0000
committerMatthias Braun <matze@braunis.de>2015-12-05 04:36:12 +0000
commit620e52e674ce256a779646e7223138485a81fdb3 (patch)
tree4d5fac49d87964f03b5e4be10e980b0eb7421ad3
parent5f6ac3227e21137e6f3b3581fe47c507f6d6e8b2 (diff)
RunSafely: Add option to omit exit status from output.
This is useful for external benchmark suites which bring reference files for stdout without the llvm-test-suite convention of having an exit code behind the stdout output. As discussed in D14678 I am going for post-commit review as cmake/lit test-suite support is still in early development. Differential Revision: http://reviews.llvm.org/D14679 git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@254835 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--External/Nurbs/CMakeLists.txt1
-rw-r--r--External/Nurbs/lit.local.cfg1
-rw-r--r--External/Povray/CMakeLists.txt1
-rw-r--r--External/Povray/lit.local.cfg1
-rw-r--r--External/skidmarks10/CMakeLists.txt1
-rw-r--r--External/skidmarks10/lit.local.cfg1
-rw-r--r--MultiSource/CMakeLists.txt2
-rw-r--r--MultiSource/lit.local.cfg1
-rwxr-xr-xRunSafely.sh13
-rw-r--r--SingleSource/CMakeLists.txt2
-rw-r--r--SingleSource/lit.local.cfg1
-rw-r--r--lit.cfg3
12 files changed, 26 insertions, 2 deletions
diff --git a/External/Nurbs/CMakeLists.txt b/External/Nurbs/CMakeLists.txt
index 934f936c..d1057054 100644
--- a/External/Nurbs/CMakeLists.txt
+++ b/External/Nurbs/CMakeLists.txt
@@ -17,3 +17,4 @@ if(TEST_SUITE_NURBS_ROOT)
llvm_multisource()
endif()
+file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/External/Nurbs/lit.local.cfg b/External/Nurbs/lit.local.cfg
new file mode 100644
index 00000000..babebd99
--- /dev/null
+++ b/External/Nurbs/lit.local.cfg
@@ -0,0 +1 @@
+config.output_append_exitstatus = True
diff --git a/External/Povray/CMakeLists.txt b/External/Povray/CMakeLists.txt
index 1d6e5b3c..3287c27f 100644
--- a/External/Povray/CMakeLists.txt
+++ b/External/Povray/CMakeLists.txt
@@ -35,3 +35,4 @@ if(TEST_SUITE_POVRAY_ROOT)
llvm_multisource()
endif()
+file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/External/Povray/lit.local.cfg b/External/Povray/lit.local.cfg
new file mode 100644
index 00000000..babebd99
--- /dev/null
+++ b/External/Povray/lit.local.cfg
@@ -0,0 +1 @@
+config.output_append_exitstatus = True
diff --git a/External/skidmarks10/CMakeLists.txt b/External/skidmarks10/CMakeLists.txt
index 9ad6d299..8282f8da 100644
--- a/External/skidmarks10/CMakeLists.txt
+++ b/External/skidmarks10/CMakeLists.txt
@@ -15,3 +15,4 @@ if(TEST_SUITE_SKIDMARKS10_ROOT)
)
llvm_multisource()
endif()
+file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/External/skidmarks10/lit.local.cfg b/External/skidmarks10/lit.local.cfg
new file mode 100644
index 00000000..babebd99
--- /dev/null
+++ b/External/skidmarks10/lit.local.cfg
@@ -0,0 +1 @@
+config.output_append_exitstatus = True
diff --git a/MultiSource/CMakeLists.txt b/MultiSource/CMakeLists.txt
index 9f7fba62..aacfebdb 100644
--- a/MultiSource/CMakeLists.txt
+++ b/MultiSource/CMakeLists.txt
@@ -11,3 +11,5 @@ endif()
llvm_multisource()
llvm_add_subdirectories(${DIRS} ${PARALLEL_DIRS})
+
+file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/MultiSource/lit.local.cfg b/MultiSource/lit.local.cfg
new file mode 100644
index 00000000..babebd99
--- /dev/null
+++ b/MultiSource/lit.local.cfg
@@ -0,0 +1 @@
+config.output_append_exitstatus = True
diff --git a/RunSafely.sh b/RunSafely.sh
index 1b2f4c57..b88badca 100755
--- a/RunSafely.sh
+++ b/RunSafely.sh
@@ -17,7 +17,7 @@
# Syntax:
#
# RunSafely.sh [-r <rhost>] [-l <ruser>] [-rc <client>] [-rp <port>]
-# [-u <under>] [--show-errors] -t <timeit>
+# [-u <under>] [--show-errors] [--omit-exitval] -t <timeit>
# <timeout> <infile> <outfile> <program> <args...>
#
# where:
@@ -35,6 +35,8 @@
#
# If --show-errors is given, then the output file will be printed if the command
# fails (returns a non-zero exit code).
+# Unless --omit-exitval is given the last line of the outfile has the form
+# "exit NN" with NN being the exit status number of the program.
if [ $# -lt 4 ]; then
echo "./RunSafely.sh [-t <PATH>] <timeout> <infile> <outfile>" \
@@ -54,6 +56,11 @@ RCLIENT=rsh
RUN_UNDER=
TIMEIT=
SHOW_ERRORS=0
+OMIT_EXITVAL=0
+if [ $1 = "--omit-exitval" ]; then
+ OMIT_EXITVAL=1
+ shift 1
+fi
if [ $1 = "-r" ]; then
RHOST=$2
shift 2
@@ -172,7 +179,9 @@ elif [ "$SHOW_ERRORS" -eq 1 -a "$exitval" -ne 0 ] ; then
else
fail=no
fi
-echo "exit $exitval" >> $OUTFILE
+if [ "$OMIT_EXITVAL" -ne 1 ]; then
+ echo "exit $exitval" >> $OUTFILE
+fi
# If we detected a failure, print the name of the test executable to the
# output file. This will cause it to compare as different with other runs
diff --git a/SingleSource/CMakeLists.txt b/SingleSource/CMakeLists.txt
index 6f476398..95e1b358 100644
--- a/SingleSource/CMakeLists.txt
+++ b/SingleSource/CMakeLists.txt
@@ -12,3 +12,5 @@ list(APPEND LDFLAGS -lm)
llvm_singlesource()
llvm_add_subdirectories(${DIRS} ${PARALLEL_DIRS})
+
+file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/SingleSource/lit.local.cfg b/SingleSource/lit.local.cfg
new file mode 100644
index 00000000..babebd99
--- /dev/null
+++ b/SingleSource/lit.local.cfg
@@ -0,0 +1 @@
+config.output_append_exitstatus = True
diff --git a/lit.cfg b/lit.cfg
index 5a49444e..27e011fc 100644
--- a/lit.cfg
+++ b/lit.cfg
@@ -110,6 +110,8 @@ def prepareRunSafely(config, commandline, outfile):
runsafely = "%s/RunSafely.sh" % config.test_suite_root
runsafely_prefix = [ runsafely ]
+ if not config.output_append_exitstatus:
+ runsafely_prefix += ["--omit-exitval"]
if config.remote_host:
runsafely_prefix += [ "-r", config.remote_host ]
if config.remote_user:
@@ -215,5 +217,6 @@ config.name = 'test-suite'
config.test_format = TestSuiteTest()
config.suffixes = ['.test']
config.excludes = ['ABI-Testsuite']
+config.output_append_exitstatus = False
if 'SSH_AUTH_SOCK' in os.environ:
config.environment['SSH_AUTH_SOCK'] = os.environ['SSH_AUTH_SOCK']