Ver Fonte

Fix extension_test.go to work with new testing.Main.
Allow "make test" to work from the top-level.
Fix a typo in Make.protobuf.

R=r, PeterGo
CC=golang-dev
http://codereview.appspot.com/2953041

David Symonds há 15 anos atrás
pai
commit
c7b2123a4d
3 ficheiros alterados com 10 adições e 5 exclusões
  1. 1 1
      Make.protobuf
  2. 4 0
      Makefile
  3. 5 4
      compiler/testdata/extension_test.go

+ 1 - 1
Make.protobuf

@@ -39,7 +39,7 @@
 #		myproto.pb.go
 #
 #	include $(GOROOT)/src/Make.pkg
-#	include $(GOROOT)/src/pkg/goprotobuf.googlecode.com/hg/Make.proto
+#	include $(GOROOT)/src/pkg/goprotobuf.googlecode.com/hg/Make.protobuf
 
 %.pb.go:	%.proto
 	protoc --go_out=. $<

+ 4 - 0
Makefile

@@ -40,6 +40,10 @@ install:
 	cd compiler/plugin && make install
 	cd compiler && make install
 
+test:
+	cd proto && make test
+	cd compiler && make test
+
 clean:
 	cd proto && make clean
 	cd compiler && make clean

+ 5 - 4
compiler/testdata/extension_test.go

@@ -34,6 +34,7 @@
 package main
 
 import (
+	"regexp"
 	"testing"
 
 	"goprotobuf.googlecode.com/hg/proto"
@@ -153,9 +154,9 @@ func TestTopLevelExtension(t *testing.T) {
 
 func main() {
 	// simpler than rigging up gotest
-	testing.Main([]testing.Test{
-		testing.Test{"TestSingleFieldExtension", TestSingleFieldExtension},
-		testing.Test{"TestMessageExtension", TestMessageExtension},
-		testing.Test{"TestTopLevelExtension", TestTopLevelExtension},
+	testing.Main(regexp.MatchString, []testing.InternalTest{
+		{"TestSingleFieldExtension", TestSingleFieldExtension},
+		{"TestMessageExtension", TestMessageExtension},
+		{"TestTopLevelExtension", TestTopLevelExtension},
 	})
 }