diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-08-08 20:34:05 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-08-08 20:34:05 +0000 |
commit | 242eae8e39b0bb78b4274e04ad8f71ff43fd1d53 (patch) | |
tree | 4735149406c8ca5022361e23e4fe0cbad73a5b7e /libgo/testsuite | |
parent | 7091ff70d87836820f284ce491808889ce9c929a (diff) | |
download | gcc-242eae8e39b0bb78b4274e04ad8f71ff43fd1d53.tar.gz |
testsuite: fix gotest for absolute srcdir
The recent changes to Makefile.am mean that if you configure with an
absolute path as srcdir then gotest will be invoked with absolute paths
for the files. That case never worked. This patch fixes it.
Reviewed-on: https://go-review.googlesource.com/25587
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239256 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/testsuite')
-rwxr-xr-x | libgo/testsuite/gotest | 66 |
1 files changed, 42 insertions, 24 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index 77722c2dd0f..5fc888bddec 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -217,18 +217,27 @@ x) ;; *) for f in $pkgfiles; do - if test -f $basedir/$f; then - b=`basename $f` - rm -f $b - cp $basedir/$f $b - elif test -f ../../$f; then - b=`basename $f` - rm -f $b - cp ../../$f $b - else - echo "file $f not found" 1>&2 - exit 1 - fi + case $f in + /*) + b=`basename $f` + rm -f $b + cp $f $b + ;; + *) + if test -f $basedir/$f; then + b=`basename $f` + rm -f $b + cp $basedir/$f $b + elif test -f ../../$f; then + b=`basename $f` + rm -f $b + cp ../../$f $b + else + echo "file $f not found" 1>&2 + exit 1 + fi + ;; + esac done for f in `cd $srcdir; ls *_test.go`; do rm -f $f @@ -252,18 +261,27 @@ x) ;; *) for f in $pkgfiles; do - if test -f $basedir/$f; then - b=`basename $f` - rm -f $b - cp $basedir/$f $b - elif test -f ../../$f; then - b=`basename $f` - rm -f $b - cp ../../$f $b - else - echo "file $f not found" 1>&2 - exit 1 - fi + case $f in + /*) + b=`basename $f` + rm -f $b + cp $f $b + ;; + *) + if test -f $basedir/$f; then + b=`basename $f` + rm -f $b + cp $basedir/$f $b + elif test -f ../../$f; then + b=`basename $f` + rm -f $b + cp ../../$f $b + else + echo "file $f not found" 1>&2 + exit 1 + fi + ;; + esac done ;; esac |