Skip to content

Commit 6b9eb4e

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 01ae1b5 commit 6b9eb4e

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

0 commit comments

Comments
 (0)