Skip to content

Commit b4c17b9

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 7405ba5 commit b4c17b9

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

0 commit comments

Comments
 (0)