aboutsummaryrefslogtreecommitdiff
path: root/paludis/Makefile.am.m4
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/Makefile.am.m4')
-rw-r--r--paludis/Makefile.am.m416
1 files changed, 16 insertions, 0 deletions
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index 5c116fb..3b19ce5 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -7,6 +7,7 @@ include $(top_srcdir)/misc/common-makefile.am
define(`filelist', `')dnl
define(`testlist', `')dnl
+define(`gtestlist', `')dnl
define(`headerlist', `')dnl
define(`selist', `')dnl
define(`secleanlist', `')dnl
@@ -21,6 +22,16 @@ $1_TEST_LDADD = \
$(DYNAMIC_LD_LIBS)
$1_TEST_CXXFLAGS = -I$(top_srcdir) $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
')dnl
+define(`addgtest', `define(`gtestlist', gtestlist `$1_TEST')dnl
+$1_TEST_SOURCES = $1_TEST.cc
+$1_TEST_LDADD = \
+ $(top_builddir)/paludis/util/gtest_runner.o \
+ libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(DYNAMIC_LD_LIBS)
+$1_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
+$1_TEST_CXXFLAGS = -I$(top_srcdir) $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @GTESTDEPS_CXXFLAGS@
+')dnl
define(`addtestscript', `define(`testscriptlist', testscriptlist `$1_TEST_setup.sh $1_TEST_cleanup.sh')')dnl
define(`addhh', `define(`filelist', filelist `$1.hh')define(`headerlist', headerlist `$1.hh')')dnl
define(`addfwd', `define(`filelist', filelist `$1-fwd.hh')define(`headerlist', headerlist `$1-fwd.hh')')dnl
@@ -45,6 +56,7 @@ ifelse(`$2', `cc', `addcc(`$1')', `')dnl
ifelse(`$2', `se', `addse(`$1')', `')dnl
ifelse(`$2', `impl', `addimpl(`$1')', `')dnl
ifelse(`$2', `test', `addtest(`$1')', `')dnl
+ifelse(`$2', `gtest', `addgtest(`$1')', `')dnl
ifelse(`$2', `testscript', `addtestscript(`$1')', `')')dnl
define(`add', `addthis(`$1',`$2')addthis(`$1',`$3')addthis(`$1',`$4')dnl
addthis(`$1',`$5')addthis(`$1',`$6')addthis(`$1',`$7')addthis(`$1',`$8')')dnl
@@ -127,7 +139,11 @@ libpaludis_@PALUDIS_PC_SLOT@_la_LIBADD = \
@DYNAMIC_LD_LIBS@ \
$(PTHREAD_LIBS)
+if HAVE_GTEST
+TESTS = testlist gtestlist
+else
TESTS = testlist
+endif
check_PROGRAMS = $(TESTS) stripper_TEST_binary
check_SCRIPTS = testscriptlist