summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-01-26 20:07:12 +0000
committerGitHub <noreply@github.com>2020-01-26 20:07:12 +0000
commit20d637a0f834a4ed50dd87bce496be5e1604986b (patch)
tree0041739499a1d964b4cc0ea58531018a924fcbf3 /Makefile
parent6a5e8d0d4f6182ba42306ea81eed2f7db6e9d1f8 (diff)
downloadgitea-20d637a0f834a4ed50dd87bce496be5e1604986b.tar.gz
gitea-20d637a0f834a4ed50dd87bce496be5e1604986b.zip
Enforce tests do not change files in source tree (#9625)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7f79e5de9e..f5d0fb7f77 100644
--- a/Makefile
+++ b/Makefile
@@ -226,6 +226,18 @@ fmt-check:
test:
GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
+PHONY: test-check
+test-check:
+ @echo "Checking if tests have changed the source tree...";
+ @diff=$$(git status -s); \
+ if [ -n "$$diff" ]; then \
+ echo "make test has changed files in the source tree:"; \
+ echo "$${diff}"; \
+ echo "You should change the tests to create these files in a temporary directory."; \
+ echo "Do not simply add these files to .gitignore"; \
+ exit 1; \
+ fi;
+
.PHONY: test\#%
test\#%:
GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -run $* $(PACKAGES)