[med-svn] [pbdagcon] 03/08: Enable build-time testing

Afif Elghraoui afif-guest at moszumanska.debian.org
Fri Dec 11 08:57:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

afif-guest pushed a commit to branch master
in repository pbdagcon.

commit 627dcb2dc618604bc381049d101aa969a1ca2cd4
Author: Afif Elghraoui <afif at ghraoui.name>
Date:   Fri Dec 11 00:03:24 2015 -0800

    Enable build-time testing
---
 debian/control                            |  2 +
 debian/patches/disable-dazcon-tests.patch | 16 ++++++
 debian/patches/gtest-directory.patch      | 86 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  2 +
 debian/rules                              |  3 +-
 5 files changed, 107 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 2d7a278..aeb14d0 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,8 @@ Build-Depends:
 	libpbdata-dev,
 	libblasr-dev,
 	libpbihdf-dev,
+# Test-Depends:
+	libgtest-dev,
 Standards-Version: 3.9.6
 Homepage: https://github.com/PacificBiosciences/pbdagcon
 Vcs-Git: git://anonscm.debian.org/debian-med/pbdagcon.git
diff --git a/debian/patches/disable-dazcon-tests.patch b/debian/patches/disable-dazcon-tests.patch
new file mode 100644
index 0000000..0937528
--- /dev/null
+++ b/debian/patches/disable-dazcon-tests.patch
@@ -0,0 +1,16 @@
+Description: Don't run tests requiring dazcon
+ We don't have Dazzler headers yet, so these will probably fail.
+Author: Afif Elghraoui <afif at ghraoui.name>
+Forwarded: not-needed
+Last-Update: 2015-12-10
+--- pbdagcon.orig/test/cpp/Makefile
++++ pbdagcon/test/cpp/Makefile
+@@ -29,7 +28,7 @@
+ 
+ all: check
+ 
+-check: test_target_hit test_alngraph test_alignment test_simple_aligner
++check: test_alngraph test_alignment test_simple_aligner
+ 
+ # XXX: need to mock out db_ in order to run test_target
+ 
diff --git a/debian/patches/gtest-directory.patch b/debian/patches/gtest-directory.patch
new file mode 100644
index 0000000..be34822
--- /dev/null
+++ b/debian/patches/gtest-directory.patch
@@ -0,0 +1,86 @@
+Description: Set gtest source directory to system-wide directory
+Author: Afif Elghraoui <afif at ghraoui.name>
+Forwarded: not-needed
+Last-Update: 2015-12-10
+
+--- pbdagcon.orig/test/cpp/Makefile
++++ pbdagcon/test/cpp/Makefile
+@@ -6,10 +6,10 @@
+ include $(SRCDIR)/boost.mk
+ include gtest.mk
+ 
+-GTEST_CPPFLAGS += -isystem $(GTEST_DIR)/include
++GTEST_CPPFLAGS += -isystem /usr/include
+ GTEST_CXXFLAGS += -g -Wall -Wextra -pthread
+ 
+-INCDIRS := -I$(PBDATA) -I$(BLASR) -I$(BOOST_HEADERS) -I$(GTEST_DIR)/include -I$(GTEST_DIR) $(EXTRA_INCDIRS)
++INCDIRS := -I$(PBDATA) -I$(BLASR) -I$(BOOST_HEADERS) -I$(GTEST_DIR) $(EXTRA_INCDIRS)
+ LDFLAGS := -L$(PBDATA) -L$(BLASR) $(EXTRA_LDFLAGS)
+ LDLIBS := -lpbdata -lblasr -lpthread ${EXTRA_LDLIBS}
+ 
+@@ -20,8 +20,10 @@
+ 			      $(SRCDIR)/DazAlnProvider.o
+ 
+ PBDAGCON_OBJECTS := $(SRCDIR)/AlnGraphBoost.o $(SRCDIR)/Alignment.o \
+-					$(SRCDIR)/SimpleAligner.o 
+-vpath %.cc $(gtest_version)/src
++					$(SRCDIR)/SimpleAligner.o
++
++GTEST_SRCDIR = $(GTEST_DIR)/src
++vpath %.cc $(GTEST_SRCDIR)
+ 
+ BUILDMSG = "=== Building $@ ==="
+ 
+@@ -31,35 +33,38 @@
+ 
+ # XXX: need to mock out db_ in order to run test_target
+ 
+-test_target_hit: $(GTEST_OBJECTS) $(DAZCON_OBJECTS) TargetHitTest.o 
++test_target_hit: gtest_main.a $(DAZCON_OBJECTS) TargetHitTest.o
+ 	@echo $(BUILDMSG)
+ 	$(CXX) $^ -o $@ -lpthread
+ 	./$@
+ 
+-test_target: $(GTEST_OBJECTS) $(DAZCON_OBJECTS) TargetTest.o
++test_target: gtest_main.a $(DAZCON_OBJECTS) TargetTest.o
+ 	@echo $(BUILDMSG)
+ 	$(CXX) $^ -o $@ -lpthread
+ 	./$@
+ 
+-test_alngraph: $(GTEST_OBJECTS) $(PBDAGCON_OBJECTS) AlnGraphBoostTest.o
++test_alngraph: gtest_main.a $(PBDAGCON_OBJECTS) AlnGraphBoostTest.o
+ 	@echo $(BUILDMSG)
+-	$(CXX) $^ -static -o $@ $(LDFLAGS) $(LDLIBS)
++	$(CXX) $^ -o $@ $(LDFLAGS) $(LDLIBS)
+ 	./$@
+ 
+-test_alignment: $(GTEST_OBJECTS) $(PBDAGCON_OBJECTS) AlignmentTest.o
++test_alignment: gtest_main.a $(PBDAGCON_OBJECTS) AlignmentTest.o
+ 	@echo $(BUILDMSG)
+-	$(CXX) $^ -static -o $@ $(LDFLAGS) $(LDLIBS)
++	$(CXX) $^ -o $@ $(LDFLAGS) $(LDLIBS)
+ 	./$@
+ 
+-test_simple_aligner: $(GTEST_OBJECTS) $(PBDAGCON_OBJECTS) SimpleAlignerTest.o
++test_simple_aligner: gtest_main.a $(PBDAGCON_OBJECTS) SimpleAlignerTest.o
+ 	@echo $(BUILDMSG)
+-	$(CXX) $^ -static -o $@ $(LDFLAGS) $(LDLIBS)
++	$(CXX) $^ -o $@ $(LDFLAGS) $(LDLIBS)
+ 	./$@
+ 
+ $(SRCDIR)/AlnGraphBoost.o: $(BOOST_HEADERS)
+ 
++gtest_main.a: $(GTEST_OBJECTS)
++	$(AR) $(ARFLAGS) $@ $^
++
+ $(GTEST_OBJECTS): $(GTEST_DIR)
+-	$(CXX) $(GTEST_CPPFLAGS) -I$(GTEST_DIR) $(GTEST_CXXFLAGS) -c $</src/$(@:.o=.cc)
++	$(CXX) $(GTEST_CPPFLAGS) -I$(GTEST_DIR) $(GTEST_CXXFLAGS) -c $(GTEST_SRCDIR)/$(@:.o=.cc)
+ 
+ $(BOOST_HEADERS):
+ 	@echo Fetching boost headers from $(URI)
+@@ -75,3 +80,4 @@
+ 	$(RM) $(SRCDIR)/*.o
+ 	$(RM) *.o
+ 	$(RM) test_*
++	$(RM) gtest_main.a
diff --git a/debian/patches/series b/debian/patches/series
index 7e67dce..97e8f6a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 external-libs.patch
+gtest-directory.patch
+disable-dazcon-tests.patch
diff --git a/debian/rules b/debian/rules
index 65711d4..40deaec 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,8 +5,7 @@
 export boost := /usr/include/boost
 export BLASR := /usr/include/blasr
 export PBDATA := /usr/include/pbdata
+export gtest := /usr/src/gtest
 
 %:
 	dh $@ --parallel
-
-override_dh_auto_test: ;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/pbdagcon.git



More information about the debian-med-commit mailing list