THRIFT-847 Test Framework harmonization across all languages
THRIFT-2946 Enhance usability of cross test framework
Patch: Nobuaki Sukegawa
This closes: #358
diff --git a/test/go/Makefile.am b/test/go/Makefile.am
index 66f81ad..7357f50 100644
--- a/test/go/Makefile.am
+++ b/test/go/Makefile.am
@@ -17,11 +17,11 @@
# under the License.
#
-THRIFT = $(top_srcdir)/compiler/cpp/thrift
+THRIFT = $(top_builddir)/compiler/cpp/thrift
THRIFTCMD = $(THRIFT) -out src/gen --gen go:thrift_import=thrift
THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
-all: bin/testclient bin/testserver bin/stress
+precross: bin/testclient bin/testserver
ThriftTest.thrift: $(THRIFTTEST)
grep -v list.*map.*list.*map $(THRIFTTEST) > ThriftTest.thrift
@@ -47,6 +47,8 @@
clean-local:
$(RM) -r src/gen src/code.google.com src/thrift bin pkg gopath ThriftTest.thrift
+check_PROGRAMS: bin/testclient bin/testserver bin/stress
+
check: gopath
GOPATH=`pwd` $(GO) test -v common/...
diff --git a/test/go/src/bin/testserver/main.go b/test/go/src/bin/testserver/main.go
index cd32f92..ebcd8e5 100644
--- a/test/go/src/bin/testserver/main.go
+++ b/test/go/src/bin/testserver/main.go
@@ -31,10 +31,11 @@
var transport = flag.String("transport", "buffered", "Transport: buffered, framed, http")
var protocol = flag.String("protocol", "binary", "Protocol: binary, compact, json")
var ssl = flag.Bool("ssl", false, "Encrypted Transport using SSL")
+var certPath = flag.String("certPath", "keys", "Directory that contains SSL certificates")
func main() {
flag.Parse()
- server, err := common.StartServer(*host, *port, *domain_socket, *transport, *protocol, *ssl, common.PrintingHandler)
+ server, err := common.StartServer(*host, *port, *domain_socket, *transport, *protocol, *ssl, *certPath, common.PrintingHandler)
if err != nil {
log.Fatalf("Unable to start server: ", err)
}
diff --git a/test/go/src/common/clientserver_test.go b/test/go/src/common/clientserver_test.go
index 3b512ad..1b833c9 100644
--- a/test/go/src/common/clientserver_test.go
+++ b/test/go/src/common/clientserver_test.go
@@ -56,7 +56,7 @@
ctrl := gomock.NewController(t)
defer ctrl.Finish()
handler := NewMockThriftTest(ctrl)
- server, err := StartServer(unit.host, unit.port, unit.domain_socket, unit.transport, unit.protocol, unit.ssl, handler)
+ server, err := StartServer(unit.host, unit.port, unit.domain_socket, unit.transport, unit.protocol, unit.ssl, "../../../keys", handler)
if err != nil {
t.Errorf("Unable to start server", err)
t.FailNow()
diff --git a/test/go/src/common/server.go b/test/go/src/common/server.go
index e77cd37..d354b32 100644
--- a/test/go/src/common/server.go
+++ b/test/go/src/common/server.go
@@ -43,6 +43,7 @@
transport string,
protocol string,
ssl bool,
+ certPath string,
handler thrifttest.ThriftTest) (srv *thrift.TSimpleServer, err error) {
hostPort := fmt.Sprintf("%s:%d", host, port)