瀏覽代碼

Use full import paths for test protos.

David Symonds 11 年之前
父節點
當前提交
a8de284881

+ 0 - 1
Makefile

@@ -50,4 +50,3 @@ regenerate:
 	make -C protoc-gen-go/descriptor regenerate
 	make -C protoc-gen-go/plugin regenerate
 	make -C proto/testdata regenerate
-	make -C proto/proto3_proto regenerate

+ 1 - 1
proto/Makefile

@@ -39,5 +39,5 @@ test: install generate-test-pbs
 generate-test-pbs:
 	make install
 	make -C testdata
-	make -C proto3_proto
+	protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata:. proto3_proto/proto3.proto
 	make

+ 1 - 1
proto/all_test.go

@@ -44,8 +44,8 @@ import (
 	"testing"
 	"time"
 
-	. "./testdata"
 	. "github.com/golang/protobuf/proto"
+	. "github.com/golang/protobuf/proto/testdata"
 )
 
 var globalO *Buffer

+ 1 - 1
proto/clone_test.go

@@ -36,7 +36,7 @@ import (
 
 	"github.com/golang/protobuf/proto"
 
-	pb "./testdata"
+	pb "github.com/golang/protobuf/proto/testdata"
 )
 
 var cloneTestMessage = &pb.MyMessage{

+ 1 - 1
proto/equal_test.go

@@ -34,8 +34,8 @@ package proto_test
 import (
 	"testing"
 
-	pb "./testdata"
 	. "github.com/golang/protobuf/proto"
+	pb "github.com/golang/protobuf/proto/testdata"
 )
 
 // Four identical base messages.

+ 1 - 1
proto/extensions_test.go

@@ -34,8 +34,8 @@ package proto_test
 import (
 	"testing"
 
-	pb "./testdata"
 	"github.com/golang/protobuf/proto"
+	pb "github.com/golang/protobuf/proto/testdata"
 )
 
 func TestGetExtensionsWithMissingExtensions(t *testing.T) {

+ 0 - 44
proto/proto3_proto/Makefile

@@ -1,44 +0,0 @@
-# Go support for Protocol Buffers - Google's data interchange format
-#
-# Copyright 2014 The Go Authors.  All rights reserved.
-# https://github.com/golang/protobuf
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-include ../../Make.protobuf
-
-all:	regenerate
-
-regenerate:
-	rm -f proto3.pb.go
-	make proto3.pb.go
-
-# The following rules are just aids to development. Not needed for typical testing.
-
-diff:	regenerate
-	git diff proto3.pb.go

+ 1 - 1
proto/proto3_test.go

@@ -34,8 +34,8 @@ package proto_test
 import (
 	"testing"
 
-	pb "./proto3_proto"
 	"github.com/golang/protobuf/proto"
+	pb "github.com/golang/protobuf/proto/proto3_proto"
 )
 
 func TestProto3ZeroValues(t *testing.T) {

+ 2 - 2
proto/size_test.go

@@ -35,9 +35,9 @@ import (
 	"log"
 	"testing"
 
-	proto3pb "./proto3_proto"
-	pb "./testdata"
 	. "github.com/golang/protobuf/proto"
+	proto3pb "github.com/golang/protobuf/proto/proto3_proto"
+	pb "github.com/golang/protobuf/proto/testdata"
 )
 
 var messageWithExtension1 = &pb.MyMessage{Count: Int32(7)}

+ 1 - 1
proto/testdata/test.proto

@@ -33,7 +33,7 @@
 
 syntax = "proto2";
 
-package test_proto;
+package testdata;
 
 enum FOO { FOO1 = 1; };
 

+ 2 - 2
proto/text_parser_test.go

@@ -36,9 +36,9 @@ import (
 	"reflect"
 	"testing"
 
-	proto3pb "./proto3_proto"
-	. "./testdata"
 	. "github.com/golang/protobuf/proto"
+	proto3pb "github.com/golang/protobuf/proto/proto3_proto"
+	. "github.com/golang/protobuf/proto/testdata"
 )
 
 type UnmarshalTextTest struct {

+ 2 - 2
proto/text_test.go

@@ -41,8 +41,8 @@ import (
 
 	"github.com/golang/protobuf/proto"
 
-	proto3pb "./proto3_proto"
-	pb "./testdata"
+	proto3pb "github.com/golang/protobuf/proto/proto3_proto"
+	pb "github.com/golang/protobuf/proto/testdata"
 )
 
 // textMessage implements the methods that allow it to marshal and unmarshal