Skip to content

Commit d8dc279

Browse files
committed
Test that the Sage git repo is clean by adding a new 'make' target.
1 parent dc99dc8 commit d8dc279

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Makefile

+14-2
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,19 @@ TEST_TARGET = $@
253253

254254
TEST = ./sage -t --logfile=$(TEST_LOG) $(TEST_FLAGS) --optional=$(TEST_OPTIONAL) $(TEST_FILES)
255255

256+
test-git-no-uncommitted-changes:
257+
@UNCOMMITTED=$$(git status --porcelain); \
258+
if [ -n "$$UNCOMMITTED" ]; then \
259+
echo "Error: the git repo has uncommitted changes:"; \
260+
echo "$$UNCOMMITTED"; \
261+
echo; \
262+
exit 1; \
263+
fi
264+
256265
test: all
257266
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)
258-
$(TEST)
267+
$(TEST); \
268+
$(MAKE) test-git-no-uncommitted-changes
259269

260270
check:
261271
@$(MAKE) test
@@ -302,7 +312,8 @@ ptestoptionallong:
302312
test-nodoc: TEST_OPTIONAL := $(TEST_OPTIONAL),!sagemath_doc_html,!sagemath_doc_pdf
303313
test-nodoc: build
304314
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)
305-
$(TEST)
315+
$(TEST); \
316+
$(MAKE) test-git-no-uncommitted-changes
306317

307318
check-nodoc:
308319
@$(MAKE) test-nodoc
@@ -387,5 +398,6 @@ list:
387398
misc-clean bdist-clean distclean bootstrap-clean maintainer-clean \
388399
test check testoptional testall testlong testoptionallong testallong \
389400
ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong \
401+
test-git-no-uncommitted-changes \
390402
list \
391403
doc-clean clean sagelib-clean build-clean

0 commit comments

Comments
 (0)