You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2011/06/24 16:01:11 UTC
svn commit: r1139309 - in /thrift/trunk: ./ test/ test/cpp/ test/cpp/src/
Author: roger
Date: Fri Jun 24 14:01:10 2011
New Revision: 1139309
URL: http://svn.apache.org/viewvc?rev=1139309&view=rev
Log:
THRIFT-457 test/cpp makefiles do not honor --prefix configuration setting
Added:
thrift/trunk/test/cpp/Makefile.am (with props)
thrift/trunk/test/cpp/src/StressTest.cpp
- copied unchanged from r1138793, thrift/trunk/test/cpp/src/main.cpp
thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp
- copied unchanged from r1138793, thrift/trunk/test/cpp/src/nb-main.cpp
Removed:
thrift/trunk/test/cpp/Stress-test.mk
thrift/trunk/test/cpp/Thrift-test.mk
thrift/trunk/test/cpp/src/main.cpp
thrift/trunk/test/cpp/src/nb-main.cpp
Modified:
thrift/trunk/configure.ac
thrift/trunk/test/Makefile.am
thrift/trunk/test/cpp/ (props changed)
thrift/trunk/test/cpp/src/TestClient.cpp
thrift/trunk/test/cpp/src/TestServer.cpp
Modified: thrift/trunk/configure.ac
URL: http://svn.apache.org/viewvc/thrift/trunk/configure.ac?rev=1139309&r1=1139308&r2=1139309&view=diff
==============================================================================
--- thrift/trunk/configure.ac (original)
+++ thrift/trunk/configure.ac Fri Jun 24 14:01:10 2011
@@ -474,6 +474,7 @@ AC_CONFIG_FILES([
lib/py/Makefile
lib/rb/Makefile
test/Makefile
+ test/cpp/Makefile
test/hs/Makefile
test/py/Makefile
test/py.twisted/Makefile
Modified: thrift/trunk/test/Makefile.am
URL: http://svn.apache.org/viewvc/thrift/trunk/test/Makefile.am?rev=1139309&r1=1139308&r2=1139309&view=diff
==============================================================================
--- thrift/trunk/test/Makefile.am (original)
+++ thrift/trunk/test/Makefile.am Fri Jun 24 14:01:10 2011
@@ -19,6 +19,10 @@
SUBDIRS =
+if WITH_CPP
+SUBDIRS += cpp
+endif
+
if WITH_PYTHON
SUBDIRS += py
SUBDIRS += py.twisted
Propchange: thrift/trunk/test/cpp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Jun 24 14:01:10 2011
@@ -1,5 +1,9 @@
-stress-test
-stress-test-nb
+StressTest
+StressTestNonBlocking
TestServer
TestClient
gen-*
+Makefile.in
+Makefile
+.deps
+
Added: thrift/trunk/test/cpp/Makefile.am
URL: http://svn.apache.org/viewvc/thrift/trunk/test/cpp/Makefile.am?rev=1139309&view=auto
==============================================================================
--- thrift/trunk/test/cpp/Makefile.am (added)
+++ thrift/trunk/test/cpp/Makefile.am Fri Jun 24 14:01:10 2011
@@ -0,0 +1,112 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+noinst_LTLIBRARIES = libtestgencpp.la libstresstestgencpp.la
+nodist_libtestgencpp_la_SOURCES = \
+ gen-cpp/ThriftTest_constants.cpp \
+ gen-cpp/ThriftTest_types.cpp \
+ gen-cpp/ThriftTest_constants.h \
+ gen-cpp/ThriftTest_types.h \
+ gen-cpp/ThriftTest_types.tcc \
+ gen-cpp/ThriftTest.tcc
+
+libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
+
+nodist_libstresstestgencpp_la_SOURCES = \
+ gen-cpp/StressTest_constants.cpp \
+ gen-cpp/StressTest_types.cpp \
+ gen-cpp/StressTest_constants.h \
+ gen-cpp/StressTest_types.h \
+ gen-cpp/Service.cpp \
+ gen-cpp/Service.h
+
+libstresstestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
+
+check_PROGRAMS = \
+ TestServer \
+ TestClient \
+ StressTest \
+ StressTestNonBlocking
+
+# we currently do not run the testsuite, stop c++ server issue
+# TESTS = \
+# $(check_PROGRAMS)
+
+TestServer_SOURCES = \
+ src/TestServer.cpp
+
+TestServer_LDADD = \
+ libtestgencpp.la \
+ $(top_builddir)/lib/cpp/libthrift.la \
+ $(top_builddir)/lib/cpp/libthriftz.la \
+ $(top_builddir)/lib/cpp/libthriftnb.la \
+ -levent -lboost_program_options
+
+TestClient_SOURCES = \
+ src/TestClient.cpp
+
+TestClient_LDADD = \
+ libtestgencpp.la \
+ $(top_builddir)/lib/cpp/libthrift.la \
+ $(top_builddir)/lib/cpp/libthriftz.la \
+ $(top_builddir)/lib/cpp/libthriftnb.la \
+ -levent -lboost_program_options
+
+StressTest_SOURCES = \
+ src/StressTest.cpp
+
+StressTest_LDADD = \
+ libstresstestgencpp.la \
+ $(top_builddir)/lib/cpp/libthrift.la
+
+StressTestNonBlocking_SOURCES = \
+ src/StressTestNonBlocking.cpp
+
+StressTestNonBlocking_LDADD = \
+ libstresstestgencpp.la \
+ $(top_builddir)/lib/cpp/libthriftnb.la \
+ -levent
+#
+# Common thrift code generation rules
+#
+THRIFT = $(top_builddir)/compiler/cpp/thrift
+
+gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_constants.cpp: $(top_srcdir)/test/ThriftTest.thrift
+ $(THRIFT) --gen cpp:templates $<
+
+gen-cpp/ThriftTest.cpp gen-cpp/StressTest_types.cpp gen-cpp/StressTest_constants.cpp: $(top_srcdir)/test/StressTest.thrift
+ $(THRIFT) --gen cpp $<
+
+INCLUDES = \
+ -I$(top_srcdir)/lib/cpp/src -Igen-cpp
+
+AM_CPPFLAGS = $(BOOST_CPPFLAGS)
+AM_CXXFLAGS = -Wall
+
+clean-local:
+ $(RM) -r gen-cpp
+
+EXTRA_DIST = \
+ src/TestClient.cpp \
+ src/TestServer.cpp \
+ src/StressTest.cpp \
+ src/StressTestNonBlocking.cpp \
+ realloc/realloc_test.c \
+ realloc/Makefile
+
+
Propchange: thrift/trunk/test/cpp/Makefile.am
------------------------------------------------------------------------------
svn:executable = *
Modified: thrift/trunk/test/cpp/src/TestClient.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/TestClient.cpp?rev=1139309&r1=1139308&r2=1139309&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/TestClient.cpp (original)
+++ thrift/trunk/test/cpp/src/TestClient.cpp Fri Jun 24 14:01:10 2011
@@ -17,6 +17,9 @@
* under the License.
*/
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include <iostream>
#include <unistd.h>
#include <sys/time.h>
@@ -32,9 +35,6 @@
#include "ThriftTest.h"
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-
using namespace boost;
using namespace std;
using namespace apache::thrift;
Modified: thrift/trunk/test/cpp/src/TestServer.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/test/cpp/src/TestServer.cpp?rev=1139309&r1=1139308&r2=1139309&view=diff
==============================================================================
--- thrift/trunk/test/cpp/src/TestServer.cpp (original)
+++ thrift/trunk/test/cpp/src/TestServer.cpp Fri Jun 24 14:01:10 2011
@@ -17,6 +17,9 @@
* under the License.
*/
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include <concurrency/ThreadManager.h>
#include <concurrency/PosixThreadFactory.h>
#include <protocol/TBinaryProtocol.h>
@@ -39,8 +42,6 @@
#include <boost/program_options.hpp>
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
#include <signal.h>
using namespace std;
@@ -114,6 +115,22 @@ class TestHandler : public ThriftTestIf
out = thing;
}
+ void testStringMap(map<std::string, std::string> &out, const map<std::string, std::string> &thing) {
+ printf("testMap({");
+ map<std::string, std::string>::const_iterator m_iter;
+ bool first = true;
+ for (m_iter = thing.begin(); m_iter != thing.end(); ++m_iter) {
+ if (first) {
+ first = false;
+ } else {
+ printf(", ");
+ }
+ printf("%s => %s", (m_iter->first).c_str(), (m_iter->second).c_str());
+ }
+ printf("})\n");
+ out = thing;
+ }
+
void testSet(set<int32_t> &out, const set<int32_t> &thing) {
printf("testSet({");
set<int32_t>::const_iterator s_iter;