Skip to content

Commit 6207783

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 d5950c6 commit 6207783

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

config.mak.uname

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

0 commit comments

Comments
 (0)