Skip to content

Commit cf3e90c

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. This patch is now required to build mingw-w64-git packages in Git for Windows, therefore it is backported to allow for a MinGit-only v2.13.1(4) to be built & published. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent cdf40a8 commit cf3e90c

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

config.mak.uname

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,65 @@ else
678678
NO_CURL = YesPlease
679679
endif
680680
endif
681+
ifeq (i686,$(uname_M))
682+
MINGW_PREFIX := mingw32
683+
endif
684+
ifeq (x86_64,$(uname_M))
685+
MINGW_PREFIX := mingw64
686+
endif
687+
688+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
689+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
690+
install-mingit-test-artifacts:
691+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
692+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
693+
"#!/mingw64/bin/busybox sh" \
694+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
695+
696+
install -m755 -d '$(DESTDIR_SQ)'
697+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
698+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
699+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
700+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
701+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
702+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
703+
"@echo Now, run 'helper\\test-run-command testsuite'"
704+
705+
install -m755 -d '$(DESTDIR_SQ)/test-git'
706+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
707+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
708+
709+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
710+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
711+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
712+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
713+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
714+
715+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
716+
(cd templates && $(TAR) cf - blt) | \
717+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
718+
719+
# po/build/locale for t0200
720+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
721+
(cd po/build/locale && $(TAR) cf - .) | \
722+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
723+
724+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
725+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
726+
install -m755 git-daemon.exe git-http-backend.exe \
727+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
728+
729+
# git-remote-testgit for t5801
730+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
731+
install -m755 git-remote-testgit \
732+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
733+
734+
# git-upload-archive (dashed) for t5000
735+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
736+
737+
# git-difftool--helper for t7800
738+
install -m755 git-difftool--helper \
739+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
681740
endif
682741
ifeq ($(uname_S),QNX)
683742
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)