Run the build-time tests as part of the build
authorMichael R. Crusoe <crusoe@debian.org>
Sat, 23 Jan 2021 16:07:02 +0000 (17:07 +0100)
committerMichael R. Crusoe <crusoe@debian.org>
Sat, 23 Jan 2021 17:16:16 +0000 (18:16 +0100)
debian/changelog
debian/rules

index b310f351e6f9633928cf69261123fc90a714b797..be36dadf6e62066b6825221a30d4c0a62cd30275 100644 (file)
@@ -38,6 +38,7 @@ solvespace (3.0.rc2+repack1-1) UNRELEASED; urgency=medium
   * debian/patches/10_mimalloc_restrict_cpu_yield.patch: enhanced with better
     atomic yield for SSE2 (if available) and better/added ops for arm64,
     armel, and ppc64{el,}/powerpc. Closes: #980169
+  * Run the build-time tests as part of the build on amd64.
 
  -- Michael R. Crusoe <crusoe@debian.org>  Sat, 23 Jan 2021 15:40:21 +0100
 
index 30f5083e995f43e3c52707d9239207d90bc0eab8..276f08f4a392bfc81f192a00ca2cf1e7155b8cea 100755 (executable)
@@ -1,18 +1,34 @@
 #!/usr/bin/make -f
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
 
 ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc sh4))
        export DEB_CXXFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
        export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
 endif
-DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/default.mk
+
+# Tell CMake what the package version will be, to embed in the version string.
+# We do this for upstream's benefit, in lieu of including a git commit hash.
+CMAKEOPTS=-DDEBVERSION=$(DEB_VERSION)
+
+#speed up the build if we are skipping the tests
+ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ifneq (amd64,$(DEB_HOST_ARCH))
+CMAKEOPTS+= -DENABLE_TESTS=off
+endif
+endif
 
 %:
        dh $@
 
-# Tell CMake what the package version will be, to embed in the version string.
-# We do this for upstream's benefit, in lieu of including a git commit hash.
 override_dh_auto_configure:
-       dh_auto_configure -- -DDEBVERSION=$(DEB_VERSION)
+       dh_auto_configure -- $(CMAKEOPTS)
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ifeq (amd64,$(DEB_HOST_ARCH))
+       cd obj-* && $(MAKE) -j$(nproc) test_solvespace
+endif
+endif