summaryrefslogtreecommitdiff
path: root/test/partest
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-08-08 19:09:52 -0700
committerSom Snytt <som.snytt@gmail.com>2013-08-08 19:09:52 -0700
commita9927445a3033fef56d802595ee3423de33765f1 (patch)
treec4e87bb0600ea57a5c7b0106a57c8399f0bb44c8 /test/partest
parent3dd0dd480e7464e316f283fdd84b62314e47db68 (diff)
downloadscala-a9927445a3033fef56d802595ee3423de33765f1.tar.gz
scala-a9927445a3033fef56d802595ee3423de33765f1.tar.bz2
scala-a9927445a3033fef56d802595ee3423de33765f1.zip
SI-7729 Does Par-Test work? Absolutely!
Testicolor just passed file arguments through; this commit does either toAbsolute or getAbsoluteFile (depending on the File API impedance mismatch) at ConsoleRunner (command line) and Runner (ant supplies absolute paths, but in case sbt runner doesn't, and who knows). It also sprinkles toAbsolute internally, where it may be redundant. Do I mean redundant or redolent? I noticed that my branch from last year relativized to test root always; so this is one of those choices one commits to. The point of breakage in this case was, if a path is not absolute, use test root / path, which only works (of course) if the relative path is relative to test root, which is no longer the case. Because all paths are now calculated with respect to the test file path, the "out" dir would change its relative path depending on the invocation.
Diffstat (limited to 'test/partest')
-rwxr-xr-xtest/partest30
1 files changed, 12 insertions, 18 deletions
diff --git a/test/partest b/test/partest
index 0259cdb791..b74e04a208 100755
--- a/test/partest
+++ b/test/partest
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
#
-
##############################################################################
# Scala test runner 2.10.0
##############################################################################
@@ -11,6 +10,17 @@
# PARTICULAR PURPOSE.
##############################################################################
+findScalaHome () {
+ # see SI-2092 and SI-5792
+ local source="${BASH_SOURCE[0]}"
+ while [ -h "$source" ] ; do
+ local linked="$(readlink "$source")"
+ local dir="$( cd -P $(dirname "$source") && cd -P $(dirname "$linked") && pwd )"
+ source="$dir/$(basename "$linked")"
+ done
+ ( ( cd -P "$(dirname "$source")/.." > /dev/null ) && pwd )
+}
+
# Use tput to detect color-capable terminal.
term_colors=$(tput colors 2>/dev/null)
if [[ $? == 0 ]] && [[ $term_colors -gt 2 ]]; then
@@ -29,23 +39,7 @@ case "`uname`" in
esac
# Finding the root folder for this Scala distribution
-SOURCE=$0;
-SCRIPT=`basename "$SOURCE"`;
-while [ -h "$SOURCE" ]; do
- SCRIPT=`basename "$SOURCE"`;
- LOOKUP=`ls -ld "$SOURCE"`;
- TARGET=`expr "$LOOKUP" : '.*-> \(.*\)$'`;
- if expr "${TARGET:-.}/" : '/.*/$' > /dev/null; then
- SOURCE=${TARGET:-.};
- else
- SOURCE=`dirname "$SOURCE"`/${TARGET:-.};
- fi;
-done;
-
-# see #2092
-SCALA_HOME=`dirname "$SOURCE"`
-SCALA_HOME=`cd "$SCALA_HOME"; pwd -P`
-SCALA_HOME=`cd "$SCALA_HOME"/..; pwd`
+SCALA_HOME="$(findScalaHome)"
if $cygwin; then
SCALA_HOME=`cygpath --windows --short-name "$SCALA_HOME"`