]> Cypherpunks repositories - gostls13.git/commitdiff
produce helpful error when gotest doesn't find a Makefile
authorRob Pike <r@golang.org>
Thu, 12 Nov 2009 22:28:45 +0000 (14:28 -0800)
committerRob Pike <r@golang.org>
Thu, 12 Nov 2009 22:28:45 +0000 (14:28 -0800)
Fixes #117.

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/152107

src/cmd/gotest/gotest

index 8d43cb7dc73994a61093344eefeb8bceff3fbae4..b43fe4d28364607bd3affec81da11d8b0ac84257 100755 (executable)
@@ -16,10 +16,15 @@ export LC_CTYPE=C
 
 _GC=$GC        # Make.$GOARCH will overwrite this
 
+if [ ! -f [Mm]akefile ]; then
+       echo 'please create a Makefile for gotest; see http://golang.org/doc/contribute.html (sic) for details' 1>&2
+       exit 2
+fi
+
 . $GOROOT/src/Make.$GOARCH
 if [ -z "$O" ]; then
        echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
-       exit 1
+       exit 2
 fi
 
 E=""
@@ -66,7 +71,7 @@ esac
 case "x$gofiles" in
 x)
        echo 'no test files found' 1>&2
-       exit 1
+       exit 2
 esac
 
 # Run any commands given in sources, like