1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/usr/bin/make -f
# export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- -DUSE_OPENMP=ON
# Note that the build-time tests are pretty much redundant with autopkgtest.
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
dh_auto_build -- ensmallen_tests
endif
# There was a heisenbug, and this was used to help track it down.
# Number of times to run test suite.
n_test = 2
# Number of times to rerun test suite assuming it failed one of the first $(n_test) runs.
n_retest = 3
override_dh_auto_test:
ok=true; \
for i in $$(seq $(n_test)); do \
echo "Test Run $$i"; \
if env CTEST_OUTPUT_ON_FAILURE=1 dh_auto_test; then \
echo "success"; \
else \
echo "failure"; \
ok=false; \
fi; \
done; \
if $${ok}; then \
echo "All $(n_test) test runs succeeded."; \
else \
for i in $$(seq $(n_retest)); do \
echo "Test Rerun $$i"; \
if env CTEST_OUTPUT_ON_FAILURE=1 dh_auto_test; then \
echo "success"; \
else \
echo "failure"; \
fi; \
done; \
fi; \
$${ok}
|