summaryrefslogtreecommitdiff
path: root/libgo/testsuite
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-01 23:19:24 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-01 23:19:24 +0000
commit74e836ee6e860ab9ec17cfd23d226991db82b574 (patch)
tree785728d7da32e48edda7da9938acfc4bf0835f12 /libgo/testsuite
parent55adf62176d38e2baaa332cb96ce88e1a5213b2c (diff)
downloadgcc-74e836ee6e860ab9ec17cfd23d226991db82b574.tar.gz
runtime: introduce build targets for running benchmarks
This introduces the "bench" build target, which can be used to run all benchmarks. It is also possible to run subsets of benchmarks with the "package/check" build targets by setting GOBENCH to a matching regex. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212212 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/testsuite')
-rwxr-xr-xlibgo/testsuite/gotest46
1 files changed, 32 insertions, 14 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 155c7a8619a..39beac393c6 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -36,6 +36,7 @@ dejagnu=no
GOARCH=""
timeout=240
testname=""
+bench=""
trace=false
while $loop; do
case "x$1" in
@@ -124,6 +125,15 @@ while $loop; do
testname=`echo $1 | sed -e 's/^--testname=//'`
shift
;;
+ x--bench)
+ bench=$2
+ shift
+ shift
+ ;;
+ x--bench=*)
+ bench=`echo $1 | sed -e 's/^--bench=//'`
+ shift
+ ;;
x--trace)
trace=true
shift
@@ -473,20 +483,28 @@ xno)
fi
${GL} *.o ${GOLIBS}
- if test "$trace" = "true"; then
- echo ./a.out -test.short -test.timeout=${timeout}s "$@"
- fi
- ./a.out -test.short -test.timeout=${timeout}s "$@" &
- pid=$!
- (sleep `expr $timeout + 10`
- echo > gotest-timeout
- echo "timed out in gotest" 1>&2
- kill -9 $pid) &
- alarmpid=$!
- wait $pid
- status=$?
- if ! test -f gotest-timeout; then
- kill $alarmpid
+ if test "$bench" = ""; then
+ if test "$trace" = "true"; then
+ echo ./a.out -test.short -test.timeout=${timeout}s "$@"
+ fi
+ ./a.out -test.short -test.timeout=${timeout}s "$@" &
+ pid=$!
+ (sleep `expr $timeout + 10`
+ echo > gotest-timeout
+ echo "timed out in gotest" 1>&2
+ kill -9 $pid) &
+ alarmpid=$!
+ wait $pid
+ status=$?
+ if ! test -f gotest-timeout; then
+ kill $alarmpid
+ fi
+ else
+ if test "$trace" = "true"; then
+ echo ./a.out -test.run=^\$ -test.bench="${bench}" "$@"
+ fi
+ ./a.out -test.run=^\$ -test.bench="${bench}" "$@"
+ status=$?
fi
exit $status
;;