Skip to content

Commit 9d2b2a4

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
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 b1fba20 commit 9d2b2a4

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

0 commit comments

Comments
 (0)