summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@apache.org>2008-02-04 21:14:14 +0000
committerDavid Reiss <dreiss@apache.org>2008-02-04 21:14:14 +0000
commit8180c0c028d11086f6dd042e637af7c38db073f2 (patch)
tree3a2fc8f2f962c46e2ac63516973eadc0e8be3f5a
parent20f009d6251af0f838c4ef8799d6b238cd230606 (diff)
downloadthrift-8180c0c028d11086f6dd042e637af7c38db073f2.tar.gz
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
-rw-r--r--Makefile.am2
-rwxr-xr-xcleanup.sh3
-rw-r--r--configure.ac1
-rw-r--r--test/DebugProtoTest.cpp8
-rw-r--r--test/DebugProtoTest.thrift8
-rw-r--r--test/Makefile.am67
-rw-r--r--test/OptionalRequiredTest.cpp8
-rw-r--r--test/OptionalRequiredTest.thrift8
-rw-r--r--test/ReflectionTest.cpp11
9 files changed, 71 insertions, 45 deletions
diff --git a/Makefile.am b/Makefile.am
index 6bcb61f1b..30398bc02 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 878bf628e..4760f4354 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 9e68a5d0d..de9d704cc 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 bae2a1622..d736d9573 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 <iostream>
#include <cmath>
#include "gen-cpp/DebugProtoTest_types.h"
diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift
index e669fb3d0..aa3ecef64 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 000000000..1a95001d0
--- /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 643cbe953..1fbc1f8dd 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 <cassert>
#include <map>
#include <iostream>
diff --git a/test/OptionalRequiredTest.thrift b/test/OptionalRequiredTest.thrift
index 431a0b006..42e787906 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 614c6138f..8193a3ecf 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 <iostream>
#include "gen-cpp/PartiallyReflectable.h"
#include "gen-cpp/Service.h"