From 351e22b52afcbe9b40e0933f80b06b479dff50f4 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Tue, 31 Aug 2010 16:51:19 +0000 Subject: [PATCH] THRIFT-503. cpp: Move the tests built by "make check" under lib/cpp git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991246 13f79535-47bb-0310-9956-ffa450edef68 --- .gitignore | 30 ++-- configure.ac | 1 + lib/cpp/Makefile.am | 2 + {test => lib/cpp/test}/AllProtocolTests.cpp | 0 {test => lib/cpp/test}/AllProtocolTests.tcc | 0 {test => lib/cpp/test}/Benchmark.cpp | 0 {test => lib/cpp/test}/DebugProtoTest.cpp | 0 .../cpp/test}/DebugProtoTest_extras.cpp | 0 {test => lib/cpp/test}/DenseProtoTest.cpp | 0 {test => lib/cpp/test}/GenericHelpers.h | 0 {test => lib/cpp/test}/JSONProtoTest.cpp | 0 lib/cpp/test/Makefile.am | 147 ++++++++++++++++++ .../cpp/test}/OptionalRequiredTest.cpp | 0 {test => lib/cpp/test}/TBufferBaseTest.cpp | 0 {test => lib/cpp/test}/TFDTransportTest.cpp | 0 {test => lib/cpp/test}/TMemoryBufferTest.cpp | 0 .../cpp/test}/TPipedTransportTest.cpp | 0 {test => lib/cpp/test}/ThriftTest_extras.cpp | 0 {test => lib/cpp/test}/UnitTestMain.cpp | 0 {test => lib/cpp/test}/ZlibTest.cpp | 0 test/Makefile.am | 129 +-------------- 21 files changed, 167 insertions(+), 142 deletions(-) rename {test => lib/cpp/test}/AllProtocolTests.cpp (100%) rename {test => lib/cpp/test}/AllProtocolTests.tcc (100%) rename {test => lib/cpp/test}/Benchmark.cpp (100%) rename {test => lib/cpp/test}/DebugProtoTest.cpp (100%) rename {test => lib/cpp/test}/DebugProtoTest_extras.cpp (100%) rename {test => lib/cpp/test}/DenseProtoTest.cpp (100%) rename {test => lib/cpp/test}/GenericHelpers.h (100%) rename {test => lib/cpp/test}/JSONProtoTest.cpp (100%) create mode 100644 lib/cpp/test/Makefile.am rename {test => lib/cpp/test}/OptionalRequiredTest.cpp (100%) rename {test => lib/cpp/test}/TBufferBaseTest.cpp (100%) rename {test => lib/cpp/test}/TFDTransportTest.cpp (100%) rename {test => lib/cpp/test}/TMemoryBufferTest.cpp (100%) rename {test => lib/cpp/test}/TPipedTransportTest.cpp (100%) rename {test => lib/cpp/test}/ThriftTest_extras.cpp (100%) rename {test => lib/cpp/test}/UnitTestMain.cpp (100%) rename {test => lib/cpp/test}/ZlibTest.cpp (100%) diff --git a/.gitignore b/.gitignore index a9d981bb..e89b041a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,22 @@ /lib/cpp/.libs /lib/cpp/Makefile /lib/cpp/Makefile.in +/lib/cpp/test/.deps +/lib/cpp/test/.libs +/lib/cpp/test/gen-cpp +/lib/cpp/test/Makefile +/lib/cpp/test/Makefile.in +/lib/cpp/test/Benchmark +/lib/cpp/test/DebugProtoTest +/lib/cpp/test/JSONProtoTest +/lib/cpp/test/OptionalRequiredTest +/lib/cpp/test/ReflectionTest +/lib/cpp/test/TFDTransportTest +/lib/cpp/test/TPipedTransportTest +/lib/cpp/test/UnitTests +/lib/cpp/test/*.la +/lib/cpp/test/*.lo +/lib/cpp/test/*.o /lib/cpp/concurrency_test /lib/cpp/*.o /lib/cpp/*.la @@ -68,22 +84,8 @@ /ltmain.sh /missing /stamp-h1 -/test/.deps -/test/.libs -/test/*.o -/test/*.la -/test/*.lo -/test/Benchmark -/test/DebugProtoTest -/test/JSONProtoTest -/test/TFDTransportTest -/test/TPipedTransportTest -/test/UnitTests /test/Makefile /test/Makefile.in -/test/OptionalRequiredTest -/test/ReflectionTest -/test/gen-cpp /test/py/Makefile /test/py/Makefile.in /test/py/gen-py diff --git a/configure.ac b/configure.ac index 3175a7be..b440ccbf 100644 --- a/configure.ac +++ b/configure.ac @@ -292,6 +292,7 @@ AC_CONFIG_FILES([ compiler/cpp/version.h lib/Makefile lib/cpp/Makefile + lib/cpp/test/Makefile lib/cpp/thrift.pc lib/cpp/thrift-nb.pc lib/cpp/thrift-z.pc diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index e83b1828..664a58a4 100644 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -17,6 +17,8 @@ # under the License. # +SUBDIRS = . test + pkgconfigdir = $(libdir)/pkgconfig lib_LTLIBRARIES = libthrift.la diff --git a/test/AllProtocolTests.cpp b/lib/cpp/test/AllProtocolTests.cpp similarity index 100% rename from test/AllProtocolTests.cpp rename to lib/cpp/test/AllProtocolTests.cpp diff --git a/test/AllProtocolTests.tcc b/lib/cpp/test/AllProtocolTests.tcc similarity index 100% rename from test/AllProtocolTests.tcc rename to lib/cpp/test/AllProtocolTests.tcc diff --git a/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp similarity index 100% rename from test/Benchmark.cpp rename to lib/cpp/test/Benchmark.cpp diff --git a/test/DebugProtoTest.cpp b/lib/cpp/test/DebugProtoTest.cpp similarity index 100% rename from test/DebugProtoTest.cpp rename to lib/cpp/test/DebugProtoTest.cpp diff --git a/test/DebugProtoTest_extras.cpp b/lib/cpp/test/DebugProtoTest_extras.cpp similarity index 100% rename from test/DebugProtoTest_extras.cpp rename to lib/cpp/test/DebugProtoTest_extras.cpp diff --git a/test/DenseProtoTest.cpp b/lib/cpp/test/DenseProtoTest.cpp similarity index 100% rename from test/DenseProtoTest.cpp rename to lib/cpp/test/DenseProtoTest.cpp diff --git a/test/GenericHelpers.h b/lib/cpp/test/GenericHelpers.h similarity index 100% rename from test/GenericHelpers.h rename to lib/cpp/test/GenericHelpers.h diff --git a/test/JSONProtoTest.cpp b/lib/cpp/test/JSONProtoTest.cpp similarity index 100% rename from test/JSONProtoTest.cpp rename to lib/cpp/test/JSONProtoTest.cpp diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am new file mode 100644 index 00000000..0585250f --- /dev/null +++ b/lib/cpp/test/Makefile.am @@ -0,0 +1,147 @@ +# +# 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 +nodist_libtestgencpp_la_SOURCES = \ + gen-cpp/DebugProtoTest_types.cpp \ + gen-cpp/OptionalRequiredTest_types.cpp \ + gen-cpp/DebugProtoTest_types.cpp \ + gen-cpp/ThriftTest_types.cpp \ + gen-cpp/DebugProtoTest_types.h \ + gen-cpp/OptionalRequiredTest_types.h \ + gen-cpp/ThriftTest_types.h \ + ThriftTest_extras.cpp \ + DebugProtoTest_extras.cpp + +ThriftTest_extras.o: gen-cpp/ThriftTest_types.h +DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h + +libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la + +noinst_PROGRAMS = Benchmark + +Benchmark_SOURCES = \ + Benchmark.cpp + +Benchmark_LDADD = libtestgencpp.la + +check_PROGRAMS = \ + TFDTransportTest \ + TPipedTransportTest \ + DebugProtoTest \ + JSONProtoTest \ + OptionalRequiredTest \ + AllProtocolsTest \ + UnitTests + +TESTS = \ + $(check_PROGRAMS) + +UnitTests_SOURCES = \ + UnitTestMain.cpp \ + TMemoryBufferTest.cpp \ + TBufferBaseTest.cpp + +UnitTests_LDADD = libtestgencpp.la -lboost_unit_test_framework + +# +# TFDTransportTest +# +TFDTransportTest_SOURCES = \ + TFDTransportTest.cpp + +TFDTransportTest_LDADD = \ + $(top_builddir)/lib/cpp/libthrift.la + + +# +# TPipedTransportTest +# +TPipedTransportTest_SOURCES = \ + TPipedTransportTest.cpp + +TPipedTransportTest_LDADD = \ + $(top_builddir)/lib/cpp/libthrift.la + +# +# AllProtocolsTest +# +AllProtocolsTest_SOURCES = \ + AllProtocolTests.cpp \ + AllProtocolTests.tcc \ + GenericHelpers.h + +AllProtocolsTest_LDADD = libtestgencpp.la + +# +# DebugProtoTest +# +DebugProtoTest_SOURCES = \ + DebugProtoTest.cpp + +DebugProtoTest_LDADD = libtestgencpp.la + + +# +# JSONProtoTest +# +JSONProtoTest_SOURCES = \ + JSONProtoTest.cpp + +JSONProtoTest_LDADD = libtestgencpp.la + +# +# OptionalRequiredTest +# +OptionalRequiredTest_SOURCES = \ + OptionalRequiredTest.cpp + +OptionalRequiredTest_LDADD = libtestgencpp.la + + +# +# Common thrift code generation rules +# +THRIFT = $(top_builddir)/compiler/cpp/thrift + +gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift + $(THRIFT) --gen cpp:dense $< + +gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift + $(THRIFT) --gen cpp:dense $< + +gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift + $(THRIFT) --gen cpp:dense $< + +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 $< + +INCLUDES = \ + -I$(top_srcdir)/lib/cpp/src + +AM_CPPFLAGS = $(BOOST_CPPFLAGS) + +clean-local: + $(RM) -r gen-cpp + +EXTRA_DIST = \ + ZlibTest.cpp \ + DenseProtoTest.cpp \ + ThriftTest_extras.cpp \ + DebugProtoTest_extras.cpp diff --git a/test/OptionalRequiredTest.cpp b/lib/cpp/test/OptionalRequiredTest.cpp similarity index 100% rename from test/OptionalRequiredTest.cpp rename to lib/cpp/test/OptionalRequiredTest.cpp diff --git a/test/TBufferBaseTest.cpp b/lib/cpp/test/TBufferBaseTest.cpp similarity index 100% rename from test/TBufferBaseTest.cpp rename to lib/cpp/test/TBufferBaseTest.cpp diff --git a/test/TFDTransportTest.cpp b/lib/cpp/test/TFDTransportTest.cpp similarity index 100% rename from test/TFDTransportTest.cpp rename to lib/cpp/test/TFDTransportTest.cpp diff --git a/test/TMemoryBufferTest.cpp b/lib/cpp/test/TMemoryBufferTest.cpp similarity index 100% rename from test/TMemoryBufferTest.cpp rename to lib/cpp/test/TMemoryBufferTest.cpp diff --git a/test/TPipedTransportTest.cpp b/lib/cpp/test/TPipedTransportTest.cpp similarity index 100% rename from test/TPipedTransportTest.cpp rename to lib/cpp/test/TPipedTransportTest.cpp diff --git a/test/ThriftTest_extras.cpp b/lib/cpp/test/ThriftTest_extras.cpp similarity index 100% rename from test/ThriftTest_extras.cpp rename to lib/cpp/test/ThriftTest_extras.cpp diff --git a/test/UnitTestMain.cpp b/lib/cpp/test/UnitTestMain.cpp similarity index 100% rename from test/UnitTestMain.cpp rename to lib/cpp/test/UnitTestMain.cpp diff --git a/test/ZlibTest.cpp b/lib/cpp/test/ZlibTest.cpp similarity index 100% rename from test/ZlibTest.cpp rename to lib/cpp/test/ZlibTest.cpp diff --git a/test/Makefile.am b/test/Makefile.am index 5fd4f0d7..7256f21a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -27,128 +27,6 @@ if WITH_RUBY SUBDIRS += rb endif -noinst_LTLIBRARIES = libtestgencpp.la -nodist_libtestgencpp_la_SOURCES = \ - gen-cpp/DebugProtoTest_types.cpp \ - gen-cpp/OptionalRequiredTest_types.cpp \ - gen-cpp/DebugProtoTest_types.cpp \ - gen-cpp/ThriftTest_types.cpp \ - gen-cpp/DebugProtoTest_types.h \ - gen-cpp/OptionalRequiredTest_types.h \ - gen-cpp/ThriftTest_types.h \ - ThriftTest_extras.cpp \ - DebugProtoTest_extras.cpp - -ThriftTest_extras.o: gen-cpp/ThriftTest_types.h -DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h - -libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la - -noinst_PROGRAMS = Benchmark - -Benchmark_SOURCES = \ - Benchmark.cpp - -Benchmark_LDADD = libtestgencpp.la - -check_PROGRAMS = \ - TFDTransportTest \ - TPipedTransportTest \ - DebugProtoTest \ - JSONProtoTest \ - OptionalRequiredTest \ - AllProtocolsTest \ - UnitTests - -TESTS = \ - $(check_PROGRAMS) - -UnitTests_SOURCES = \ - UnitTestMain.cpp \ - TMemoryBufferTest.cpp \ - TBufferBaseTest.cpp - -UnitTests_LDADD = libtestgencpp.la -lboost_unit_test_framework - -# -# TFDTransportTest -# -TFDTransportTest_SOURCES = \ - TFDTransportTest.cpp - -TFDTransportTest_LDADD = \ - $(top_builddir)/lib/cpp/libthrift.la - - -# -# TPipedTransportTest -# -TPipedTransportTest_SOURCES = \ - TPipedTransportTest.cpp - -TPipedTransportTest_LDADD = \ - $(top_builddir)/lib/cpp/libthrift.la - -# -# AllProtocolsTest -# -AllProtocolsTest_SOURCES = \ - AllProtocolTests.cpp \ - AllProtocolTests.tcc \ - GenericHelpers.h - -AllProtocolsTest_LDADD = libtestgencpp.la - -# -# DebugProtoTest -# -DebugProtoTest_SOURCES = \ - DebugProtoTest.cpp - -DebugProtoTest_LDADD = libtestgencpp.la - - -# -# JSONProtoTest -# -JSONProtoTest_SOURCES = \ - JSONProtoTest.cpp - -JSONProtoTest_LDADD = libtestgencpp.la - -# -# OptionalRequiredTest -# -OptionalRequiredTest_SOURCES = \ - OptionalRequiredTest.cpp - -OptionalRequiredTest_LDADD = libtestgencpp.la - - -# -# Common thrift code generation rules -# -THRIFT = $(top_builddir)/compiler/cpp/thrift - -gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: DebugProtoTest.thrift - $(THRIFT) --gen cpp:dense $< - -gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: OptionalRequiredTest.thrift - $(THRIFT) --gen cpp:dense $< - -gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: StressTest.thrift - $(THRIFT) --gen cpp:dense $< - -gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h: ThriftTest.thrift - $(THRIFT) --gen cpp:dense $< - -INCLUDES = \ - -I$(top_srcdir)/lib/cpp/src - -AM_CPPFLAGS = $(BOOST_CPPFLAGS) - -clean-local: - $(RM) -r gen-cpp EXTRA_DIST = \ cpp \ @@ -173,9 +51,4 @@ EXTRA_DIST = \ SmallTest.thrift \ StressTest.thrift \ ThriftTest.thrift \ - ZlibTest.cpp \ - DenseProtoTest.cpp \ - FastbinaryTest.py \ - ThriftTest_extras.cpp \ - DebugProtoTest_extras.cpp - + FastbinaryTest.py -- 2.17.1