diff options
Diffstat (limited to 'test/partest')
-rwxr-xr-x | test/partest | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/partest b/test/partest index ec66f5c048..8243316cca 100755 --- a/test/partest +++ b/test/partest @@ -1,7 +1,8 @@ -#!/bin/sh +#!/usr/bin/env bash +# ############################################################################## -# Scala test runner 2.8.0 +# Scala test runner 2.10.0 ############################################################################## # (c) 2002-2013 LAMP/EPFL # @@ -10,6 +11,16 @@ # PARTICULAR PURPOSE. ############################################################################## +# Use tput to detect color-capable terminal. +term_colors=$(tput colors 2>/dev/null) +if [[ $? == 0 ]] && [[ $term_colors -gt 2 ]]; then + git_diff_options="--color=always --word-diff" + color_opts="-Dpartest.colors=$term_colors" +else + unset color_opts + git_diff_options="--nocolor" +fi + cygwin=false; darwin=false; case "`uname`" in @@ -98,6 +109,7 @@ fi "${JAVACMD:=java}" \ $JAVA_OPTS -cp "$EXT_CLASSPATH" \ ${partestDebugStr} \ + "$color_opts" \ -Dscala.home="${SCALA_HOME}" \ -Dpartest.javacmd="${JAVACMD}" \ -Dpartest.java_opts="${JAVA_OPTS}" \ |