From 8180c0c028d11086f6dd042e637af7c38db073f2 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Mon, 4 Feb 2008 21:14:14 +0000 Subject: [PATCH] Thrift: "make check" support. Summary: Add a Makefile.am in the test directory that runs some of the test programs when "make check" is executed. Also removed some obsolete comments. Reviewed By: mcslee Test Plan: Ran make check, saw all tests pass. Ran make install, saw no test programs installed. Ran ./cleanup.sh, saw a pristine workspace. Revert Plan: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665458 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.am | 2 +- cleanup.sh | 3 +- configure.ac | 1 + test/DebugProtoTest.cpp | 8 ---- test/DebugProtoTest.thrift | 8 ---- test/Makefile.am | 67 ++++++++++++++++++++++++++++++++ test/OptionalRequiredTest.cpp | 8 ---- test/OptionalRequiredTest.thrift | 8 ---- test/ReflectionTest.cpp | 11 ------ 9 files changed, 71 insertions(+), 45 deletions(-) create mode 100644 test/Makefile.am diff --git a/Makefile.am b/Makefile.am index 6bcb61f1..30398bc0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ACLOCAL_AMFLAGS = -I ./aclocal -SUBDIRS = compiler/cpp lib if +SUBDIRS = compiler/cpp lib if test ## Don't run make dist from a subversion working copy ## because it will pull in your .svn directories. EXTRA_DIST = bootstrap.sh cleanup.sh doc test tutorial \ diff --git a/cleanup.sh b/cleanup.sh index 878bf628..4760f435 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -33,4 +33,5 @@ compiler/cpp/Makefile.in \ if/Makefile.in \ lib/Makefile.in \ lib/cpp/Makefile.in \ -lib/py/Makefile.in +lib/py/Makefile.in \ +test/Makefile.in diff --git a/configure.ac b/configure.ac index 9e68a5d0..de9d704c 100644 --- a/configure.ac +++ b/configure.ac @@ -106,6 +106,7 @@ AC_CONFIG_FILES([ lib/cpp/thrift-z.pc lib/py/Makefile if/Makefile + test/Makefile ]) AC_OUTPUT diff --git a/test/DebugProtoTest.cpp b/test/DebugProtoTest.cpp index bae2a162..d736d957 100644 --- a/test/DebugProtoTest.cpp +++ b/test/DebugProtoTest.cpp @@ -1,11 +1,3 @@ -/* -thrift -cpp DebugProtoTest.thrift -g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ - DebugProtoTest.cpp gen-cpp/DebugProtoTest_types.cpp \ - ../lib/cpp/.libs/libthrift.a -o DebugProtoTest -./DebugProtoTest -*/ - #include #include #include "gen-cpp/DebugProtoTest_types.h" diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift index e669fb3d..aa3ecef6 100644 --- a/test/DebugProtoTest.thrift +++ b/test/DebugProtoTest.thrift @@ -1,11 +1,3 @@ -/* -thrift -cpp DebugProtoTest.thrift -g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ - DebugProtoTest.cpp gen-cpp/DebugProtoTest_types.cpp \ - ../lib/cpp/.libs/libthrift.a -o DebugProtoTest -./DebugProtoTest -*/ - cpp_namespace thrift.test struct OneOfEach { diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 00000000..1a95001d --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,67 @@ +check_PROGRAMS = \ + DebugProtoTest \ + OptionalRequiredTest \ + ReflectionTest + +TESTS = \ + $(check_PROGRAMS) + + +# +# DebugProtoTest +# +DebugProtoTest_SOURCES = \ + gen-cpp/DebugProtoTest_types.cpp \ + DebugProtoTest.cpp + +DebugProtoTest_LDADD = \ + $(top_srcdir)/lib/cpp/libthrift.la + + +# +# OptionalRequiredTest +# +OptionalRequiredTest_SOURCES = \ + gen-cpp/OptionalRequiredTest_types.cpp \ + OptionalRequiredTest.cpp + +OptionalRequiredTest_LDADD = \ + $(top_srcdir)/lib/cpp/libthrift.la + + +# +# ReflectionTest +# +ReflectionTest_SOURCES = \ + gen-cpp/DebugProtoTest_types.cpp \ + gen-cpp/PartiallyReflectable.cpp \ + gen-cpp/Service.cpp \ + gen-cpp/StressTest_types.cpp \ + ReflectionTest.cpp + +ReflectionTest_LDADD = \ + $(top_srcdir)/lib/cpp/libthrift.la + + +# +# Common thrift code generation rules +# +THRIFT = $(top_srcdir)/compiler/cpp/thrift + +gen-cpp/DebugProtoTest_types.cpp gen-cpp/PartiallyReflectable.cpp: DebugProtoTest.thrift + $(THRIFT) -cpp $< + +gen-cpp/OptionalRequiredTest_types.cpp: OptionalRequiredTest.thrift + $(THRIFT) -cpp $< + +gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: StressTest.thrift + $(THRIFT) -cpp $< + + +INCLUDES = \ + -I$(top_srcdir)/lib/cpp/src + +AM_CPPFLAGS = $(BOOST_CPPFLAGS) + +clean-local: + rm -rf gen-cpp diff --git a/test/OptionalRequiredTest.cpp b/test/OptionalRequiredTest.cpp index 643cbe95..1fbc1f8d 100644 --- a/test/OptionalRequiredTest.cpp +++ b/test/OptionalRequiredTest.cpp @@ -1,11 +1,3 @@ -/* -../compiler/cpp/thrift -cpp OptionalRequiredTest.thrift -g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ - OptionalRequiredTest.cpp gen-cpp/OptionalRequiredTest_types.cpp \ - ../lib/cpp/.libs/libthrift.a -o OptionalRequiredTest -./OptionalRequiredTest -*/ - #include #include #include diff --git a/test/OptionalRequiredTest.thrift b/test/OptionalRequiredTest.thrift index 431a0b00..42e78790 100644 --- a/test/OptionalRequiredTest.thrift +++ b/test/OptionalRequiredTest.thrift @@ -1,11 +1,3 @@ -/* -../compiler/cpp/thrift -cpp OptionalRequiredTest.thrift -g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ - OptionalRequiredTest.cpp gen-cpp/OptionalRequiredTest_types.cpp \ - ../lib/cpp/.libs/libthrift.a -o OptionalRequiredTest -./OptionalRequiredTest -*/ - cpp_namespace thrift.test struct OldSchool { diff --git a/test/ReflectionTest.cpp b/test/ReflectionTest.cpp index 614c6138..8193a3ec 100644 --- a/test/ReflectionTest.cpp +++ b/test/ReflectionTest.cpp @@ -1,14 +1,3 @@ -/* -../compiler/cpp/thrift -cpp DebugProtoTest.thrift -../compiler/cpp/thrift -cpp StressTest.thrift -g++ -Wall -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \ - ReflectionTest.cpp \ - gen-cpp/StressTest_types.cpp gen-cpp/DebugProtoTest_types.cpp \ - gen-cpp/Service.cpp gen-cpp/PartiallyReflectable.cpp \ - ../lib/cpp/.libs/libthrift.a -o ReflectionTest -./ReflectionTest -*/ - #include #include "gen-cpp/PartiallyReflectable.h" #include "gen-cpp/Service.h" -- 2.17.1