summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Meier <roger@apache.org>2012-05-11 10:12:39 +0000
committerRoger Meier <roger@apache.org>2012-05-11 10:12:39 +0000
commit2b1a5289a7aa61377f2d20ee8dfffd72310cc886 (patch)
treea9ce76cdd0eb464f284666080f8378d50a9f0ce6 /lib
parent96efc26a3cc14e5b3a8a3f7c08cc2082ed42d197 (diff)
downloadthrift-2b1a5289a7aa61377f2d20ee8dfffd72310cc886.tar.gz
THRIFT-1336 thrift: added server and processor test code
move the tests from src to test: lib\cpp\src\thrift\concurrency\test to lib\cpp\test\concurrency lib\cpp\src\thrift\processor\test to lib\cpp\test\processor git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1337098 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib')
-rwxr-xr-xlib/cpp/Makefile.am44
-rwxr-xr-x[-rw-r--r--]lib/cpp/test/Makefile.am41
-rw-r--r--lib/cpp/test/concurrency/Tests.cpp (renamed from lib/cpp/src/thrift/concurrency/test/Tests.cpp)0
-rw-r--r--lib/cpp/test/concurrency/ThreadFactoryTests.h (renamed from lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h)0
-rw-r--r--lib/cpp/test/concurrency/ThreadManagerTests.h (renamed from lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h)0
-rw-r--r--lib/cpp/test/concurrency/TimerManagerTests.h (renamed from lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h)0
-rwxr-xr-x[-rw-r--r--]lib/cpp/test/processor/EventLog.cpp (renamed from lib/cpp/src/thrift/processor/test/EventLog.cpp)2
-rwxr-xr-x[-rw-r--r--]lib/cpp/test/processor/EventLog.h (renamed from lib/cpp/src/thrift/processor/test/EventLog.h)2
-rwxr-xr-x[-rw-r--r--]lib/cpp/test/processor/Handlers.h (renamed from lib/cpp/src/thrift/processor/test/Handlers.h)2
-rwxr-xr-xlib/cpp/test/processor/ProcessorTest.cpp (renamed from lib/cpp/src/thrift/processor/test/ProcessorTest.cpp)6
-rwxr-xr-x[-rw-r--r--]lib/cpp/test/processor/ServerThread.cpp (renamed from lib/cpp/src/thrift/processor/test/ServerThread.cpp)12
-rwxr-xr-x[-rw-r--r--]lib/cpp/test/processor/ServerThread.h (renamed from lib/cpp/src/thrift/processor/test/ServerThread.h)10
-rw-r--r--lib/cpp/test/processor/proc.thrift (renamed from lib/cpp/src/thrift/processor/test/proc.thrift)0
13 files changed, 55 insertions, 64 deletions
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index 6e2b2bafb..4834e9f04 100755
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -207,52 +207,8 @@ include_qt_HEADERS = \
src/thrift/qt/TQIODeviceTransport.h \
src/thrift/qt/TQTcpServer.h
-
-noinst_PROGRAMS = concurrency_test \
- processor_test
-
-concurrency_test_SOURCES = \
- src/thrift/concurrency/test/Tests.cpp \
- src/thrift/concurrency/test/ThreadFactoryTests.h \
- src/thrift/concurrency/test/ThreadManagerTests.h \
- src/thrift/concurrency/test/TimerManagerTests.h
-
-concurrency_test_LDADD = libthrift.la
-
-processor_test_SOURCES = src/thrift/processor/test/ProcessorTest.cpp \
- src/thrift/processor/test/EventLog.cpp \
- src/thrift/processor/test/ServerThread.cpp \
- src/thrift/processor/test/EventLog.h \
- src/thrift/processor/test/Handlers.h \
- src/thrift/processor/test/ServerThread.h
-
-processor_test_LDADD = libprocessortest.la \
- libthrift.la \
- libthriftnb.la \
- $(BOOST_LDFLAGS) \
- -levent \
- $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
-
-check_PROGRAMS = \
- concurrency_test \
- processor_test
-
-TESTS = \
- $(check_PROGRAMS)
-
-noinst_LTLIBRARIES = libprocessortest.la
-
THRIFT = $(top_builddir)/compiler/cpp/thrift
-gen-cpp/ChildService.cpp: $(top_srcdir)/lib/cpp/src/thrift/processor/test/proc.thrift
- $(THRIFT) --gen cpp:templates,cob_style $<
-
-nodist_libprocessortest_la_SOURCES = \
- src/thrift/processor/test/gen-cpp/ChildService.h \
- src/thrift/processor/test/gen-cpp/ChildService.cpp \
- src/thrift/processor/test/gen-cpp/ParentService.h \
- src/thrift/processor/test/gen-cpp/ParentService.cpp
-
WINDOWS_DIST = \
README_WINDOWS \
src/thrift/windows \
diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am
index bf419354c..f7b1c26cd 100644..100755
--- a/lib/cpp/test/Makefile.am
+++ b/lib/cpp/test/Makefile.am
@@ -17,7 +17,7 @@
# under the License.
#
-noinst_LTLIBRARIES = libtestgencpp.la
+noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
nodist_libtestgencpp_la_SOURCES = \
gen-cpp/DebugProtoTest_types.cpp \
gen-cpp/OptionalRequiredTest_types.cpp \
@@ -29,6 +29,14 @@ nodist_libtestgencpp_la_SOURCES = \
ThriftTest_extras.cpp \
DebugProtoTest_extras.cpp
+nodist_libprocessortest_la_SOURCES = \
+ gen-cpp/ChildService.cpp \
+ gen-cpp/ChildService.h \
+ gen-cpp/ParentService.cpp \
+ gen-cpp/ParentService.h \
+ gen-cpp/proc_types.cpp \
+ gen-cpp/proc_types.h
+
ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
@@ -52,7 +60,9 @@ check_PROGRAMS = \
TransportTest \
ZlibTest \
TFileTransportTest \
- UnitTests
+ UnitTests \
+ concurrency_test \
+ processor_test
TESTS_ENVIRONMENT= \
BOOST_TEST_LOG_SINK=tests.xml \
@@ -163,7 +173,29 @@ SpecializationTest_SOURCES = \
SpecializationTest_LDADD = libtestgencpp.la
-
+concurrency_test_SOURCES = \
+ concurrency/Tests.cpp \
+ concurrency/ThreadFactoryTests.h \
+ concurrency/ThreadManagerTests.h \
+ concurrency/TimerManagerTests.h
+
+concurrency_test_LDADD = \
+ $(top_builddir)/lib/cpp/libthrift.la
+
+processor_test_SOURCES = \
+ processor/ProcessorTest.cpp \
+ processor/EventLog.cpp \
+ processor/ServerThread.cpp \
+ processor/EventLog.h \
+ processor/Handlers.h \
+ processor/ServerThread.h
+
+processor_test_LDADD = libprocessortest.la \
+ $(top_builddir)/lib/cpp/libthrift.la \
+ $(top_builddir)/lib/cpp/libthriftnb.la \
+ $(BOOST_LDFLAGS) \
+ -levent \
+ $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
#
# Common thrift code generation rules
#
@@ -181,6 +213,9 @@ gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.
gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h: $(top_srcdir)/test/ThriftTest.thrift
$(THRIFT) --gen cpp:dense $<
+gen-cpp/ChildService.cpp: processor/proc.thrift
+ $(THRIFT) --gen cpp:templates,cob_style $<
+
INCLUDES = \
-I$(top_srcdir)/lib/cpp/src
diff --git a/lib/cpp/src/thrift/concurrency/test/Tests.cpp b/lib/cpp/test/concurrency/Tests.cpp
index c80bb883f..c80bb883f 100644
--- a/lib/cpp/src/thrift/concurrency/test/Tests.cpp
+++ b/lib/cpp/test/concurrency/Tests.cpp
diff --git a/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h b/lib/cpp/test/concurrency/ThreadFactoryTests.h
index b7e873ff1..b7e873ff1 100644
--- a/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
+++ b/lib/cpp/test/concurrency/ThreadFactoryTests.h
diff --git a/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h b/lib/cpp/test/concurrency/ThreadManagerTests.h
index b734f7a0f..b734f7a0f 100644
--- a/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
+++ b/lib/cpp/test/concurrency/ThreadManagerTests.h
diff --git a/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index 4fe966738..4fe966738 100644
--- a/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
diff --git a/lib/cpp/src/thrift/processor/test/EventLog.cpp b/lib/cpp/test/processor/EventLog.cpp
index 7d27569a9..0ac3028ad 100644..100755
--- a/lib/cpp/src/thrift/processor/test/EventLog.cpp
+++ b/lib/cpp/test/processor/EventLog.cpp
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-#include "processor/test/EventLog.h"
+#include "EventLog.h"
#include <stdarg.h>
diff --git a/lib/cpp/src/thrift/processor/test/EventLog.h b/lib/cpp/test/processor/EventLog.h
index 007b66609..d731cec2c 100644..100755
--- a/lib/cpp/src/thrift/processor/test/EventLog.h
+++ b/lib/cpp/test/processor/EventLog.h
@@ -19,7 +19,7 @@
#ifndef _THRIFT_TEST_EVENTLOG_H_
#define _THRIFT_TEST_EVENTLOG_H_ 1
-#include "concurrency/Monitor.h"
+#include <thrift/concurrency/Monitor.h>
namespace apache { namespace thrift { namespace test {
diff --git a/lib/cpp/src/thrift/processor/test/Handlers.h b/lib/cpp/test/processor/Handlers.h
index a4f5070e1..2be262af8 100644..100755
--- a/lib/cpp/src/thrift/processor/test/Handlers.h
+++ b/lib/cpp/test/processor/Handlers.h
@@ -19,7 +19,7 @@
#ifndef _THRIFT_PROCESSOR_TEST_HANDLERS_H_
#define _THRIFT_PROCESSOR_TEST_HANDLERS_H_ 1
-#include "processor/test/EventLog.h"
+#include "EventLog.h"
#include "gen-cpp/ParentService.h"
#include "gen-cpp/ChildService.h"
diff --git a/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp b/lib/cpp/test/processor/ProcessorTest.cpp
index fd43d14f3..58b82fbeb 100755
--- a/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp
+++ b/lib/cpp/test/processor/ProcessorTest.cpp
@@ -35,9 +35,9 @@
#include <thrift/server/TSimpleServer.h>
#include <thrift/transport/TSocket.h>
-#include <thrift/processor/test/EventLog.h>
-#include <thrift/processor/test/ServerThread.h>
-#include <thrift/processor/test/Handlers.h>
+#include "EventLog.h"
+#include "ServerThread.h"
+#include "Handlers.h"
#include "gen-cpp/ChildService.h"
using namespace std;
diff --git a/lib/cpp/src/thrift/processor/test/ServerThread.cpp b/lib/cpp/test/processor/ServerThread.cpp
index d90fdf3e1..9f2087c80 100644..100755
--- a/lib/cpp/src/thrift/processor/test/ServerThread.cpp
+++ b/lib/cpp/test/processor/ServerThread.cpp
@@ -19,13 +19,13 @@
#ifndef _THRIFT_TEST_SERVERTHREAD_TCC_
#define _THRIFT_TEST_SERVERTHREAD_TCC_ 1
-#include "processor/test/ServerThread.h"
+#include "ServerThread.h"
-#include "concurrency/PosixThreadFactory.h"
-#include "concurrency/ThreadManager.h"
-#include "server/TThreadPoolServer.h"
-#include "transport/TBufferTransports.h"
-#include "transport/TServerSocket.h"
+#include <thrift/concurrency/PosixThreadFactory.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TServerSocket.h>
namespace apache { namespace thrift { namespace test {
diff --git a/lib/cpp/src/thrift/processor/test/ServerThread.h b/lib/cpp/test/processor/ServerThread.h
index 76ceded8c..0dd512797 100644..100755
--- a/lib/cpp/src/thrift/processor/test/ServerThread.h
+++ b/lib/cpp/test/processor/ServerThread.h
@@ -19,12 +19,12 @@
#ifndef _THRIFT_TEST_SERVERTHREAD_H_
#define _THRIFT_TEST_SERVERTHREAD_H_ 1
-#include "TProcessor.h"
-#include "protocol/TProtocol.h"
-#include "server/TServer.h"
-#include "transport/TTransport.h"
+#include <thrift/TProcessor.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TTransport.h>
-#include "processor/test/EventLog.h"
+#include "EventLog.h"
namespace apache { namespace thrift { namespace test {
diff --git a/lib/cpp/src/thrift/processor/test/proc.thrift b/lib/cpp/test/processor/proc.thrift
index ac3c5f953..ac3c5f953 100644
--- a/lib/cpp/src/thrift/processor/test/proc.thrift
+++ b/lib/cpp/test/processor/proc.thrift