Skip to content

Commit 3e2ca39

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 c85f9de commit 3e2ca39

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

0 commit comments

Comments
 (0)