Skip to content

Commit 97727eb

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 fd052e5 commit 97727eb

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

0 commit comments

Comments
 (0)