Skip to content

Commit e03bc6d

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 2c7b3b7 commit e03bc6d

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

0 commit comments

Comments
 (0)