From f116753ae83e5f2d8766d06c9bdfd78aac4dbe42 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sat, 23 Jan 2021 17:07:02 +0100 Subject: [PATCH] Run the build-time tests as part of the build --- debian/changelog | 1 + debian/rules | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b310f35..be36dad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sat, 23 Jan 2021 15:40:21 +0100 diff --git a/debian/rules b/debian/rules index 30f5083..276f08f 100755 --- a/debian/rules +++ b/debian/rules @@ -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 -- 2.30.2