Skip to content

Commit 0153067

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
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 a91c7c5 commit 0153067

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
@@ -765,6 +765,57 @@ ifeq ($(uname_S),MINGW)
765765
ETC_GITCONFIG = ../etc/gitconfig
766766
ETC_GITATTRIBUTES = ../etc/gitattributes
767767
endif
768+
MINGW_PREFIX := $(subst /,,$(prefix))
769+
770+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
771+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
772+
install-mingit-test-artifacts:
773+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
774+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
775+
"#!/mingw64/bin/busybox sh" \
776+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
777+
778+
install -m755 -d '$(DESTDIR_SQ)'
779+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
780+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
781+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
782+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
783+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
784+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
785+
"@echo Now, run 'helper\\test-run-command testsuite'"
786+
787+
install -m755 -d '$(DESTDIR_SQ)/test-git'
788+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
789+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
790+
791+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
792+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
793+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
794+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
795+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
796+
797+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
798+
(cd templates && $(TAR) cf - blt) | \
799+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
800+
801+
# po/build/locale for t0200
802+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
803+
(cd po/build/locale && $(TAR) cf - .) | \
804+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
805+
806+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
807+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
808+
install -m755 git-daemon.exe git-http-backend.exe \
809+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
810+
811+
# git-upload-archive (dashed) for t5000
812+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
813+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
814+
815+
# git-difftool--helper for t7800
816+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
817+
install -m755 git-difftool--helper \
818+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
768819
endif
769820
ifeq ($(uname_S),QNX)
770821
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)