From 56a8f295190f31bfb90d2503364ad462dc0726f5 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Wed, 18 Aug 2021 12:00:07 +0200 Subject: [PATCH] Add support for hash generation for git repository (local modifier not implemented) --- tests/Makefile | 13 ++++++++++++- tests/Makefile.fpc | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 5e714a34b7..470b8f4b73 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2756,12 +2756,23 @@ distclean: clean fpc_distclean digest : utils -$(DIGEST) $(LOG) SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))) +GIT:=$(firstword $(wildcard $(addsuffix /git$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(wildcard ../.git),) +ifneq ($(GIT),) +GIT_GET_HASH=$(GIT) log -1 --format=%h +SVN_TESTS_REV_STR=$(shell $(GIT_GET_HASH) .) +SVN_COMPILER_REV_STR=$(shell $(GIT_GET_HASH) ../compiler) +SVN_RTL_REV_STR=$(shell $(GIT_GET_HASH) ../rtl) +SVN_PACKAGES_REV_STR=$(shell $(GIT_GET_HASH) ../packages) +else ifneq ($(SVNVERSION),) SVN_TESTS_REV_STR=$(shell $(SVNVERSION) -c .) SVN_COMPILER_REV_STR=$(shell $(SVNVERSION) -c ../compiler) SVN_RTL_REV_STR=$(shell $(SVNVERSION) -c ../rtl) SVN_PACKAGES_REV_STR=$(shell $(SVNVERSION) -c ../packages) endif +endif +endif ifeq ($(TEST_COMMENT),) TEST_COMMENT=$(TEST_OPT) endif @@ -2785,7 +2796,7 @@ endif ifneq ($(TEST_FPC_FULLVERSION),) $(ECHOREDIR) CompilerFullVersion=$(TEST_FPC_FULLVERSION) >> $(TEST_OUTPUTDIR)/dbdigest.cfg endif -ifneq ($(SVNVERSION),) +ifneq ($(SVN_TESTS_REV_STR),) $(ECHOREDIR) svntestsrevision=$(SVN_TESTS_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg $(ECHOREDIR) svncompilerrevision=$(SVN_COMPILER_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg $(ECHOREDIR) svnrtlrevision=$(SVN_RTL_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg diff --git a/tests/Makefile.fpc b/tests/Makefile.fpc index 4d15c48be5..61fe423b44 100644 --- a/tests/Makefile.fpc +++ b/tests/Makefile.fpc @@ -620,12 +620,23 @@ digest : utils SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))) +GIT:=$(firstword $(wildcard $(addsuffix /git$(SRCEXEEXT),$(SEARCHPATH)))) +ifneq ($(wildcard ../.git),) +ifneq ($(GIT),) +GIT_GET_HASH=$(GIT) log -1 --format=%h +SVN_TESTS_REV_STR=$(shell $(GIT_GET_HASH) .) +SVN_COMPILER_REV_STR=$(shell $(GIT_GET_HASH) ../compiler) +SVN_RTL_REV_STR=$(shell $(GIT_GET_HASH) ../rtl) +SVN_PACKAGES_REV_STR=$(shell $(GIT_GET_HASH) ../packages) +else ifneq ($(SVNVERSION),) SVN_TESTS_REV_STR=$(shell $(SVNVERSION) -c .) SVN_COMPILER_REV_STR=$(shell $(SVNVERSION) -c ../compiler) SVN_RTL_REV_STR=$(shell $(SVNVERSION) -c ../rtl) SVN_PACKAGES_REV_STR=$(shell $(SVNVERSION) -c ../packages) endif +endif +endif ifeq ($(TEST_COMMENT),) TEST_COMMENT=$(TEST_OPT) @@ -651,7 +662,7 @@ endif ifneq ($(TEST_FPC_FULLVERSION),) $(ECHOREDIR) CompilerFullVersion=$(TEST_FPC_FULLVERSION) >> $(TEST_OUTPUTDIR)/dbdigest.cfg endif -ifneq ($(SVNVERSION),) +ifneq ($(SVN_TESTS_REV_STR),) $(ECHOREDIR) svntestsrevision=$(SVN_TESTS_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg $(ECHOREDIR) svncompilerrevision=$(SVN_COMPILER_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg $(ECHOREDIR) svnrtlrevision=$(SVN_RTL_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg