Skip to content

Commit 0268a45

Browse files
committed
mingw: add a Makefile target to copy test artifacts
The Makefile target `install-mingit-test-artifacts` simply copies stuff and things directly into a MinGit directory, including an init.bat script to set everything up so that the tests can be run in a cmd window. Sadly, Git's test suite still relies on a Perl interpreter even if compiled with NO_PERL=YesPlease. We punt for now, installing a small script into /usr/bin/perl that hands off to an existing Perl of a Git for Windows SDK. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c50ae35 commit 0268a45

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

config.mak.uname

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,57 @@ ifeq ($(uname_S),MINGW)
781781
ETC_GITCONFIG = ../etc/gitconfig
782782
ETC_GITATTRIBUTES = ../etc/gitattributes
783783
endif
784+
MINGW_PREFIX := $(subst /,,$(prefix))
785+
786+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
787+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
788+
install-mingit-test-artifacts:
789+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
790+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
791+
"#!/mingw64/bin/busybox sh" \
792+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
793+
794+
install -m755 -d '$(DESTDIR_SQ)'
795+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
796+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
797+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
798+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
799+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
800+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
801+
"@echo Now, run 'helper\\test-run-command testsuite'"
802+
803+
install -m755 -d '$(DESTDIR_SQ)/test-git'
804+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
805+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
806+
807+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
808+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
809+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
810+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
811+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
812+
813+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
814+
(cd templates && $(TAR) cf - blt) | \
815+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
816+
817+
# po/build/locale for t0200
818+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
819+
(cd po/build/locale && $(TAR) cf - .) | \
820+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
821+
822+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
823+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
824+
install -m755 git-daemon.exe git-http-backend.exe \
825+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
826+
827+
# git-upload-archive (dashed) for t5000
828+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
829+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
830+
831+
# git-difftool--helper for t7800
832+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
833+
install -m755 git-difftool--helper \
834+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
784835
endif
785836
ifeq ($(uname_S),QNX)
786837
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)