[sagemath] 02/02: No need to have a separate test target

Ximin Luo infinity0 at debian.org
Sun Jan 8 02:06:13 UTC 2017


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

infinity0 pushed a commit to branch master
in repository sagemath.

commit 42d0a9505e3b33b103a36586240067b1a60ac3cf
Author: Ximin Luo <infinity0 at debian.org>
Date:   Sun Jan 8 03:05:33 2017 +0100

    No need to have a separate test target
---
 debian/README.source |  2 +-
 debian/rules         | 44 +++++++++++++++++++++-----------------------
 2 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/debian/README.source b/debian/README.source
index f2eacd4..3b3487c 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -114,7 +114,7 @@ There are three cases:
 
 You may also find this useful:
 
- $ debian/rules EXTRA_SAGE_TEST_FLAGS=-f ptestlong
+ $ debian/rules EXTRA_SAGE_TEST_FLAGS=-f override_dh_auto_test
 
 It will run all previously-failed tests again, which is useful if you're on a
 mass test-fixing spree and forget to count which ones you've fixed. However
diff --git a/debian/rules b/debian/rules
index 485bc8b..7e68f91 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,7 +80,27 @@ override_dh_auto_build: prune
 	MAKE='make -j$(NUMJOBS)' make --directory=sage $(DEB_BUILD_TARGET)
 	! grep Error sage/logs/dochtml.log
 
-override_dh_auto_test: ptestlong
+run_tests = cd sage && ./sage -t -p $(NUMJOBS) --all --long $(EXTRA_SAGE_TEST_FLAGS) --logfile=logs/ptestlong.log
+override_dh_auto_test:
+	cd sage && $(SAGE_LOCAL)/bin/sage-starts
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	# We do the below instead of `$(MAKE) --directory=sage ptestlong` because
+	# it has a bug where it can't detect a previous successful build. So it
+	# will try to rebuild some sagelib files, then the docbuild, then those
+	# files again, even after a "make all" that was previously successful. This
+	# is not incorrect, but is a massive waste of time. OTOH debhelper is able
+	# to detect a previous successful (override_)dh_auto_build, so if we run
+	# `debian/rules build` twice it will go directly to (override_)dh_auto_test
+	# (and then this target) without trying (override_)dh_auto_build again.
+	$(run_tests) || true
+	# If tests fail but not by too many more, then retry them once
+	if $(is_prerelease); then :; \
+	elif debian/rules -s had-few-failures; then :; else \
+	  debian/rules -s had-not-too-many-failures && \
+	  mv sage/logs/ptestlong.log sage/logs/ptestlong.log.1 && \
+	  { $(run_tests) -f; cd "$(CURDIR)" && debian/rules -s had-few-failures; }; \
+	fi
+endif
 
 override_dh_auto_install:
 	rm -rf debian/build/usr/var/tmp/sage/build
@@ -163,28 +183,6 @@ prune: debian/control
 	cd sage && python ../debian/pruner/pruner.py || $(is_prerelease)
 	touch prune
 
-run_tests = cd sage && ./sage -t -p $(NUMJOBS) --all --long $(EXTRA_SAGE_TEST_FLAGS) --logfile=logs/ptestlong.log
-ptestlong:
-	cd sage && $(SAGE_LOCAL)/bin/sage-starts
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	# We do the below instead of `$(MAKE) --directory=sage ptestlong` because
-	# it has a bug where it can't detect a previous successful build. So it
-	# will try to rebuild some sagelib files, then the docbuild, then those
-	# files again, even after a "make all" that was previously successful. This
-	# is not incorrect, but is a massive waste of time. OTOH debhelper is able
-	# to detect a previous successful (override_)dh_auto_build, so if we run
-	# `debian/rules build` twice it will go directly to (override_)dh_auto_test
-	# (and then this target) without trying (override_)dh_auto_build again.
-	$(run_tests) || true
-	# If tests fail but not by too many more, then retry them once
-	if $(is_prerelease); then :; \
-	elif debian/rules -s had-few-failures; then :; else \
-	  debian/rules -s had-not-too-many-failures && \
-	  mv sage/logs/ptestlong.log sage/logs/ptestlong.log.1 && \
-	  { $(run_tests) -f; cd "$(CURDIR)" && debian/rules -s had-few-failures; }; \
-	fi
-endif
-
 # If the docbuild fails and you want to try again, you should run this first.
 # Otherwise the docbuild gets slower and slower as it re-reads information from
 # its build directory. At least that's my (infinity0) impression; I didn't

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list