[med-svn] [Git][med-team/libbdsg][master] 3 commits: Run the upstream test_libbdsg test suite at build time.
Andreas Tille (@tille)
gitlab at salsa.debian.org
Mon Nov 2 17:44:00 GMT 2026
Andreas Tille pushed to branch master at Debian Med / libbdsg
Commits:
27d0369d by Andreas Tille at 2026-11-02T18:36:26+01:00
Run the upstream test_libbdsg test suite at build time.
- - - - -
a31c4e87 by Andreas Tille at 2026-11-02T18:38:51+01:00
Redesign the autopkgtest as run-unit-test
- - - - -
4880336e by Andreas Tille at 2026-11-02T18:42:52+01:00
Upload to unstable
- - - - -
10 changed files:
- + debian/README.test
- debian/changelog
- + debian/examples/Makefile
- + debian/examples/README
- + debian/libbdsg-dev.docs
- + debian/libbdsg-dev.examples
- debian/rules
- − debian/tests/compile
- debian/tests/control
- + debian/tests/run-unit-test
Changes:
=====================================
debian/README.test
=====================================
@@ -0,0 +1,25 @@
+Notes on how this package can be tested
+=======================================
+
+The upstream C++ test suite is compiled and run at build time from the
+CMake build tree:
+
+ ./build/bin/test_libbdsg
+
+The autopkgtest in debian/tests/run-unit-test verifies that a consumer
+can compile, link and run the same upstream test suite against the
+installed libbdsg-dev package. It uses the examples installed in
+
+ /usr/share/doc/libbdsg-dev/examples/
+
+which are also meant as user documentation.
+
+After installing libbdsg-dev and the dependencies listed in
+debian/tests/control, the same test can be run manually with
+
+ sh /usr/share/doc/libbdsg-dev/run-unit-test
+
+or with "sh debian/tests/run-unit-test" from the source package. From
+the source package the autopkgtest can also be run with:
+
+ autopkgtest . -- null
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+libbdsg (0.3+git20261016.485b32b+dfsg-2) unstable; urgency=medium
+
+ * Run the upstream test_libbdsg test suite at build time.
+ * Redesign the autopkgtest as run-unit-test
+
+ -- Andreas Tille <tille at debian.org> Mon, 02 Nov 2026 18:38:59 +0100
+
libbdsg (0.3+git20261016.485b32b+dfsg-1) unstable; urgency=medium
* Initial release (Closes: #1152344).
=====================================
debian/examples/Makefile
=====================================
@@ -0,0 +1,19 @@
+CXX ?= c++
+
+# The upstream test suite uses the public libbdsg headers and also calls
+# functions from libhandlegraph and SDSL directly.
+CXXFLAGS ?= -O2 -g -std=c++20 -fopenmp
+LDLIBS = -lbdsg -lhandlegraph -lsdsl
+
+.PHONY: all check clean
+
+all: test_libbdsg
+
+test_libbdsg: test_libbdsg.cpp
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS)
+
+check: test_libbdsg
+ ./test_libbdsg
+
+clean:
+ rm -f test_libbdsg test.dat tmp??????
=====================================
debian/examples/README
=====================================
@@ -0,0 +1,17 @@
+Examples for using libbdsg-dev
+==============================
+
+test_libbdsg.cpp is the upstream libbdsg test suite. It exercises the
+public C++ API, including the graph implementations, overlays and
+serialization, and shows how a program is built against libbdsg.
+
+Build and run it against the installed library with:
+
+ make check
+
+The package's autopkgtest uses the same Makefile. The script installed as
+
+ /usr/share/doc/libbdsg-dev/run-unit-test
+
+copies these files to a temporary directory, builds them and runs the
+test suite. It can also be run directly after installing libbdsg-dev.
=====================================
debian/libbdsg-dev.docs
=====================================
@@ -0,0 +1,2 @@
+debian/tests/run-unit-test
+debian/README.test
=====================================
debian/libbdsg-dev.examples
=====================================
@@ -0,0 +1,2 @@
+debian/examples/*
+bdsg/src/test_libbdsg.cpp
=====================================
debian/rules
=====================================
@@ -14,4 +14,9 @@ override_dh_auto_configure:
-DOPTIMIZE=OFF
override_dh_auto_test:
- # The upstream test harness is a standalone binary, not integrated with CTest.
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ # The upstream test harness is a standalone binary, not integrated with
+ # CTest. It needs the build-tree library because Debian builds with
+ # CMAKE_SKIP_RPATH=ON.
+ cd build && LD_LIBRARY_PATH=$(CURDIR)/build/lib ./bin/test_libbdsg
+endif
=====================================
debian/tests/compile deleted
=====================================
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-set -e
-
-tmpdir=$(mktemp -d)
-trap 'rm -rf "$tmpdir"' EXIT
-
-cat > "$tmpdir/test.cpp" <<'EOF'
-#include <bdsg/hash_graph.hpp>
-#include <bdsg/packed_graph.hpp>
-
-int main() {
- bdsg::HashGraph hash_graph;
- auto hash_handle = hash_graph.create_handle("ACGT");
- if (hash_graph.get_sequence(hash_handle) != "ACGT") {
- return 1;
- }
-
- bdsg::PackedGraph packed_graph;
- auto packed_handle = packed_graph.create_handle("ACGT");
- if (packed_graph.get_sequence(packed_handle) != "ACGT") {
- return 1;
- }
-
- return 0;
-}
-EOF
-
-g++ -std=c++20 -fopenmp "$tmpdir/test.cpp" -o "$tmpdir/test" -lbdsg -lhandlegraph -lsdsl
-"$tmpdir/test"
=====================================
debian/tests/control
=====================================
@@ -1,2 +1,3 @@
-Tests: compile
+Tests: run-unit-test
Depends: @, build-essential
+Restrictions: allow-stderr
=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+pkg=libbdsg-dev
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+ AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+ trap 'rm -rf "${AUTOPKGTEST_TMP}"' 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/. "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+# Build and run the upstream test suite against the installed library.
+make check
View it on GitLab: https://salsa.debian.org/med-team/libbdsg/-/compare/c9ec30d0c114b6904a5a6716cb1956e0eacdba8e...4880336ea3d3e25adb776e9d1f19e00fed452d31
--
View it on GitLab: https://salsa.debian.org/med-team/libbdsg/-/compare/c9ec30d0c114b6904a5a6716cb1956e0eacdba8e...4880336ea3d3e25adb776e9d1f19e00fed452d31
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261102/5f8a4476/attachment-0001.htm>
More information about the debian-med-commit
mailing list