diff options
author | Roger Meier <roger@apache.org> | 2015-03-24 22:30:40 +0100 |
---|---|---|
committer | Roger Meier <roger@apache.org> | 2015-03-24 22:30:40 +0100 |
commit | 41ad4342c5a0389ab2cf2dbf098086413ac01204 (patch) | |
tree | 1ce9c7d4e70a7370f132ce5d4fd245a20a68e45e /test/go | |
parent | a2d12b6ee3d9aa66f2c16dc6a5ee6eef5f1eba92 (diff) | |
download | thrift-41ad4342c5a0389ab2cf2dbf098086413ac01204.tar.gz |
THRIFT-847 Test Framework harmonization across all languages
THRIFT-2946 Enhance usability of cross test framework
Patch: Nobuaki Sukegawa
This closes: #358
Diffstat (limited to 'test/go')
-rw-r--r-- | test/go/Makefile.am | 6 | ||||
-rw-r--r-- | test/go/src/bin/testserver/main.go | 3 | ||||
-rw-r--r-- | test/go/src/common/clientserver_test.go | 2 | ||||
-rw-r--r-- | test/go/src/common/server.go | 1 |
4 files changed, 8 insertions, 4 deletions
diff --git a/test/go/Makefile.am b/test/go/Makefile.am index 66f81ad69..7357f506a 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 @@ bin/stress: gopath 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 cd32f921e..ebcd8e50e 100644 --- a/test/go/src/bin/testserver/main.go +++ b/test/go/src/bin/testserver/main.go @@ -31,10 +31,11 @@ var domain_socket = flag.String("domain-socket", "", "Domain Socket (e.g. /tmp/T 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 3b512add4..1b833c9e7 100644 --- a/test/go/src/common/clientserver_test.go +++ b/test/go/src/common/clientserver_test.go @@ -56,7 +56,7 @@ func doUnit(t *testing.T, unit *test_unit) { 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 e77cd374f..d354b3206 100644 --- a/test/go/src/common/server.go +++ b/test/go/src/common/server.go @@ -43,6 +43,7 @@ func StartServer( transport string, protocol string, ssl bool, + certPath string, handler thrifttest.ThriftTest) (srv *thrift.TSimpleServer, err error) { hostPort := fmt.Sprintf("%s:%d", host, port) |