Thrift: "make check" support.
authorDavid Reiss <dreiss@apache.org>
Mon, 4 Feb 2008 21:14:14 +0000 (21:14 +0000)
committerDavid Reiss <dreiss@apache.org>
Mon, 4 Feb 2008 21:14:14 +0000 (21:14 +0000)
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
cleanup.sh
configure.ac
test/DebugProtoTest.cpp
test/DebugProtoTest.thrift
test/Makefile.am [new file with mode: 0644]
test/OptionalRequiredTest.cpp
test/OptionalRequiredTest.thrift
test/ReflectionTest.cpp

index 6bcb61f..30398bc 100644 (file)
@@ -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 \
index 878bf62..4760f43 100755 (executable)
@@ -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
index 9e68a5d..de9d704 100644 (file)
@@ -106,6 +106,7 @@ AC_CONFIG_FILES([
   lib/cpp/thrift-z.pc
   lib/py/Makefile
   if/Makefile
+  test/Makefile
 ])
 
 AC_OUTPUT
index bae2a16..d736d95 100644 (file)
@@ -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 <iostream>
 #include <cmath>
 #include "gen-cpp/DebugProtoTest_types.h"
index e669fb3..aa3ecef 100644 (file)
@@ -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 (file)
index 0000000..1a95001
--- /dev/null
@@ -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
index 643cbe9..1fbc1f8 100644 (file)
@@ -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 <cassert>
 #include <map>
 #include <iostream>
index 431a0b0..42e7879 100644 (file)
@@ -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 {
index 614c613..8193a3e 100644 (file)
@@ -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 <iostream>
 #include "gen-cpp/PartiallyReflectable.h"
 #include "gen-cpp/Service.h"