Skip to content

Commit bada0fa

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 b9db74d commit bada0fa

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
@@ -728,6 +728,62 @@ ifeq ($(uname_S),MINGW)
728728
ETC_GITCONFIG = ../etc/gitconfig
729729
ETC_GITATTRIBUTES = ../etc/gitattributes
730730
endif
731+
ifeq (i686,$(uname_M))
732+
MINGW_PREFIX := mingw32
733+
endif
734+
ifeq (x86_64,$(uname_M))
735+
MINGW_PREFIX := mingw64
736+
endif
737+
738+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
739+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
740+
install-mingit-test-artifacts:
741+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
742+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
743+
"#!/mingw64/bin/busybox sh" \
744+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
745+
746+
install -m755 -d '$(DESTDIR_SQ)'
747+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
748+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
749+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
750+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
751+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
752+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
753+
"@echo Now, run 'helper\\test-run-command testsuite'"
754+
755+
install -m755 -d '$(DESTDIR_SQ)/test-git'
756+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
757+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
758+
759+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
760+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
761+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
762+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
763+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
764+
765+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
766+
(cd templates && $(TAR) cf - blt) | \
767+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
768+
769+
# po/build/locale for t0200
770+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
771+
(cd po/build/locale && $(TAR) cf - .) | \
772+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
773+
774+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
775+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
776+
install -m755 git-daemon.exe git-http-backend.exe \
777+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
778+
779+
# git-upload-archive (dashed) for t5000
780+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
781+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
782+
783+
# git-difftool--helper for t7800
784+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
785+
install -m755 git-difftool--helper \
786+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
731787
endif
732788
ifeq ($(uname_S),QNX)
733789
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)