Skip to content

Commit 9eae7de

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 1a37f15 commit 9eae7de

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
@@ -749,6 +749,62 @@ else
749749
NO_PYTHON = YesPlease
750750
endif
751751
endif
752+
ifeq (i686,$(uname_M))
753+
MINGW_PREFIX := mingw32
754+
endif
755+
ifeq (x86_64,$(uname_M))
756+
MINGW_PREFIX := mingw64
757+
endif
758+
759+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
760+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
761+
install-mingit-test-artifacts:
762+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
763+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
764+
"#!/mingw64/bin/busybox sh" \
765+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
766+
767+
install -m755 -d '$(DESTDIR_SQ)'
768+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
769+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
770+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
771+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
772+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
773+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
774+
"@echo Now, run 'helper\\test-run-command testsuite'"
775+
776+
install -m755 -d '$(DESTDIR_SQ)/test-git'
777+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
778+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
779+
780+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
781+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
782+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] lib-diff) | \
783+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
784+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
785+
786+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
787+
(cd templates && $(TAR) cf - blt) | \
788+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
789+
790+
# po/build/locale for t0200
791+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
792+
(cd po/build/locale && $(TAR) cf - .) | \
793+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
794+
795+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
796+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
797+
install -m755 git-daemon.exe git-http-backend.exe \
798+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
799+
800+
# git-upload-archive (dashed) for t5000
801+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
802+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
803+
804+
# git-difftool--helper for t7800
805+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
806+
install -m755 git-difftool--helper \
807+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
752808
endif
753809
ifeq ($(uname_S),QNX)
754810
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)