Skip to content

Commit

Permalink
Test that the Sage git repo is clean by adding a new 'make' target.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpalmieri committed Jan 29, 2025
1 parent dc99dc8 commit d8dc279
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,19 @@ TEST_TARGET = $@

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

test-git-no-uncommitted-changes:
@UNCOMMITTED=$$(git status --porcelain); \
if [ -n "$$UNCOMMITTED" ]; then \
echo "Error: the git repo has uncommitted changes:"; \
echo "$$UNCOMMITTED"; \
echo; \
exit 1; \
fi

test: all
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)
$(TEST)
$(TEST); \
$(MAKE) test-git-no-uncommitted-changes

check:
@$(MAKE) test
Expand Down Expand Up @@ -302,7 +312,8 @@ ptestoptionallong:
test-nodoc: TEST_OPTIONAL := $(TEST_OPTIONAL),!sagemath_doc_html,!sagemath_doc_pdf
test-nodoc: build
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)
$(TEST)
$(TEST); \
$(MAKE) test-git-no-uncommitted-changes

check-nodoc:
@$(MAKE) test-nodoc
Expand Down Expand Up @@ -387,5 +398,6 @@ list:
misc-clean bdist-clean distclean bootstrap-clean maintainer-clean \
test check testoptional testall testlong testoptionallong testallong \
ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong \
test-git-no-uncommitted-changes \
list \
doc-clean clean sagelib-clean build-clean

0 comments on commit d8dc279

Please sign in to comment.