Skip to content

Commit 2acdac4

Browse files
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 f1ca1a7 commit 2acdac4

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

config.mak.uname

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

0 commit comments

Comments
 (0)