Skip to content

Commit 446eaca

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 <johannes.schindelin@gmx.de>
1 parent 170bd46 commit 446eaca

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

config.mak.uname

+56
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,62 @@ ifeq ($(uname_S),MINGW)
754754
ETC_GITCONFIG = ../etc/gitconfig
755755
ETC_GITATTRIBUTES = ../etc/gitattributes
756756
endif
757+
ifeq (i686,$(uname_M))
758+
MINGW_PREFIX := mingw32
759+
endif
760+
ifeq (x86_64,$(uname_M))
761+
MINGW_PREFIX := mingw64
762+
endif
763+
764+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
765+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
766+
install-mingit-test-artifacts:
767+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
768+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
769+
"#!/mingw64/bin/busybox sh" \
770+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
771+
772+
install -m755 -d '$(DESTDIR_SQ)'
773+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
774+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
775+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
776+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
777+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
778+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
779+
"@echo Now, run 'helper\\test-run-command testsuite'"
780+
781+
install -m755 -d '$(DESTDIR_SQ)/test-git'
782+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
783+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
784+
785+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
786+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
787+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
788+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
789+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
790+
791+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
792+
(cd templates && $(TAR) cf - blt) | \
793+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
794+
795+
# po/build/locale for t0200
796+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
797+
(cd po/build/locale && $(TAR) cf - .) | \
798+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
799+
800+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
801+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
802+
install -m755 git-daemon.exe git-http-backend.exe \
803+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
804+
805+
# git-upload-archive (dashed) for t5000
806+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
807+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
808+
809+
# git-difftool--helper for t7800
810+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
811+
install -m755 git-difftool--helper \
812+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
757813
endif
758814
ifeq ($(uname_S),QNX)
759815
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)