diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-24 20:13:12 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-24 20:13:12 +0000 |
commit | c76e5dd85df2e413f7a5f2c75fbd4b0a9b5b7b85 (patch) | |
tree | 74b2e86a24eb0dedc80d2e30ee6beccd38fcaa98 /libgo | |
parent | c224fa34178e236fd7e96702e5bcae0bc27f8506 (diff) | |
download | gcc-c76e5dd85df2e413f7a5f2c75fbd4b0a9b5b7b85.tar.gz |
gotest: Remove race in use of ../testdata.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186781 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rwxr-xr-x | libgo/testsuite/gotest | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index c6966fa7d4c..40d32ed3d2d 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -136,18 +136,20 @@ rm -rf $DIR mkdir $DIR cd $DIR +mkdir test +cd test if test $keep = false; then - trap "cd ..; rm -rf $DIR" 0 1 2 3 14 15 + trap "cd ../..; rm -rf $DIR" 0 1 2 3 14 15 else - trap "cd ..; echo Keeping $DIR" 0 1 2 3 14 15 + trap "cd ../..; echo Keeping $DIR" 0 1 2 3 14 15 fi case "$srcdir" in /*) ;; *) - srcdir="../$srcdir" + srcdir="../../$srcdir" ;; esac @@ -158,7 +160,7 @@ case "$basedir" in /*) ;; *) - basedir="../$basedir" + basedir="../../$basedir" ;; esac @@ -189,10 +191,10 @@ x) b=`basename $f` rm -f $b cp $basedir/$f $b - elif test -f ../$f; then + elif test -f ../../$f; then b=`basename $f` rm -f $b - cp ../$f $b + cp ../../$f $b else echo "file $f not found" 1>&2 exit 1 @@ -224,10 +226,10 @@ x) b=`basename $f` rm -f $b cp $basedir/$f $b - elif test -f ../$f; then + elif test -f ../../$f; then b=`basename $f` rm -f $b - cp ../$f $b + cp ../../$f $b else echo "file $f not found" 1>&2 exit 1 @@ -455,27 +457,27 @@ xno) exit $status ;; xyes) - rm -rf ../testsuite/*.o + rm -rf ../../testsuite/*.o files=`echo *` for f in $files; do if test "$f" = "_obj" || test "$f" = "_test"; then continue fi - rm -rf ../testsuite/$f + rm -rf ../../testsuite/$f if test -f $f; then - cp $f ../testsuite/ + cp $f ../../testsuite/ else - ln -s ../$DIR/$f ../testsuite/ + ln -s ../$DIR/test/$f ../../testsuite/ fi done - cd ../testsuite + cd ../../testsuite rm -rf _obj _test mkdir _obj _test if test "$testname" != ""; then GOTESTNAME="$testname" export GOTESTNAME fi - $MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR" + $MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR/test" # Useful when using make check-target-libgo cat libgo.log >> libgo-all.log cat libgo.sum >> libgo-all.sum |