Permalink
Browse files

integrate gtest for a piecemeal conversion

  • Loading branch information...
1 parent fd922a6 commit bcab7ca67f59adf6e5b2b3bdf682202947ce78f6 @novas0x2a novas0x2a committed Jul 4, 2009
View
@@ -101,7 +101,7 @@ all-headers:
grep '^#.*vw/' | sed -e 's#.*src/\(vw/[^"]\+\)".*#\1#' | sort -u
one-ctags-file:
- ctags -R --languages=C,C++ --exclude='*thirdparty/*' --exclude='*tests/*' . --exclude='' thirdparty/cxxtest/cxxtest/TestSuite.h
+ ctags -R --languages=C,C++ --exclude='*thirdparty/*' --exclude='*tests/*' . --exclude='' thirdparty/cxxtest/cxxtest/TestSuite.h thirdparty/gtest
.PHONY: coverage push-coverage instantiate-all instantiate-skipped all-headers one-ctags-file
View
@@ -5,24 +5,12 @@
# __END_LICENSE__
-########################################################################
-# tests (using cxxtest)
-########################################################################
-
-SUFFIXES = .cxx
-
-CXXTEST_DIR = $(top_srcdir)/thirdparty/cxxtest
-CXXTEST_GEN = $(CXXTEST_DIR)/cxxtestgen.pl
-CXXTEST_ARGS = --error-printer
-
-TEST_CPPFLAGS = -I$(CXXTEST_DIR) -DTEST_SRCDIR="\"$(top_srcdir)/$(subdir)\""
-
-.h.cxx:
- $(CXXTEST_GEN) $(CXXTEST_ARGS) -o $@ $<
-
newtest:
@if test -z "$(NAME)"; then echo "run make NAME=TestName [MODULE=ModuleName] newtest"; else $(top_srcdir)/scripts/create-test.sh $(NAME) $(MODULE); fi
.PHONY: newtest
+SUFFIXES = .totallyfakeplaceholder
include $(top_srcdir)/thirdparty/autotroll.mak
+
+# vim: filetype=automake:
View
@@ -0,0 +1,15 @@
+GTEST_DIR = $(top_srcdir)/thirdparty/gtest
+
+libgtest_la_SOURCES = $(GTEST_DIR)/src/gtest-all.cc $(GTEST_DIR)/src/gtest_main.cc
+# this empty assignment prevents AM_LDFLAGS from applying to libgtest
+libgtest_la_LDFLAGS =
+
+check_LTLIBRARIES = libgtest.la
+
+AM_CPPFLAGS += -DTEST_SRCDIR="\"$(top_srcdir)/$(subdir)\"" -I$(GTEST_DIR) -I$(GTEST_DIR)/include -g
+LDADD = libgtest.la
+
+# This makes sure we're using the c++ linker
+LINK = $(CXXLINK)
+
+# vim: filetype=automake:
View
@@ -0,0 +1,14 @@
+########################################################################
+# tests (using cxxtest)
+########################################################################
+
+SUFFIXES += .cxx
+
+CXXTEST_DIR = $(top_srcdir)/thirdparty/cxxtest
+CXXTEST_GEN = $(CXXTEST_DIR)/cxxtestgen.pl
+CXXTEST_ARGS = --error-printer
+
+TEST_CPPFLAGS = -I$(CXXTEST_DIR) -DTEST_SRCDIR="\"$(top_srcdir)/$(subdir)\""
+
+.h.cxx:
+ $(CXXTEST_GEN) $(CXXTEST_ARGS) -o $@ $<
@@ -40,3 +40,4 @@ EXTRA_DIST = $(TESTS:%=%.h) test.jpg
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -35,3 +35,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -39,3 +39,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx) log.txt
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -35,3 +35,4 @@ EXTRA_DIST = $(TESTS:%=%.h) rgb2x2.png rgb2x2.tif rgb2x2.jpg png16.png
CLEANFILES = $(TESTS:%=%.cxx) tmp.png tmp.tif rwtest.* test-png16.png
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -39,3 +39,4 @@ EXTRA_DIST = $(TESTS:%=%.h) test_images/lighthouse-1000x1000.png
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -32,3 +32,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -31,3 +31,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -48,3 +48,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -33,3 +33,4 @@ EXTRA_DIST = $(TESTS:%=%.h) sub.png noisy_gradient_60.png
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -52,3 +52,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -29,3 +29,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
@@ -33,3 +33,4 @@ EXTRA_DIST = $(TESTS:%=%.h)
CLEANFILES = $(TESTS:%=%.cxx)
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
View
@@ -32,3 +32,4 @@ EXTRA_DIST = $(TESTS:%=%.h) mural.png mural.jpg
CLEANFILES = $(TESTS:%=%.cxx) cropped.mural.* mural.tif
include $(top_srcdir)/config/rules.mak
+include $(top_srcdir)/config/tests_old.am
View
@@ -0,0 +1,18 @@
+#ifndef __VW_TESTS_CONFIG_TEST_H__
+#define __VW_TESTS_CONFIG_TEST_H__
+
+#include <vw/config.h>
+
+#if defined(VW_ENABLE_EXCEPTIONS) && (VW_ENABLE_EXCEPTIONS==1)
+#define HAS_EXCEPTIONS(x) x
+#else
+#define HAS_EXCEPTIONS(x) DISABLED_ ## x
+#endif
+
+#if defined(VW_ENABLE_CONFIG_FILE) && (VW_ENABLE_CONFIG_FILE==1)
+#define HAS_CONFIG_FILE(x) x
+#else
+#define HAS_CONFIG_FILE(x) DISABLED_ ## x
+#endif
+
+#endif

0 comments on commit bcab7ca

Please sign in to comment.