Skip to content

Commit 6959e47

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 0251ece commit 6959e47

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
@@ -712,6 +712,65 @@ else
712712
NO_CURL = YesPlease
713713
endif
714714
endif
715+
ifeq (i686,$(uname_M))
716+
MINGW_PREFIX := mingw32
717+
endif
718+
ifeq (x86_64,$(uname_M))
719+
MINGW_PREFIX := mingw64
720+
endif
721+
722+
DESTDIR_WINDOWS = $(shell cygpath -aw '$(DESTDIR_SQ)')
723+
DESTDIR_MIXED = $(shell cygpath -am '$(DESTDIR_SQ)')
724+
install-mingit-test-artifacts:
725+
install -m755 -d '$(DESTDIR_SQ)/usr/bin'
726+
printf '%s\n%s\n' >'$(DESTDIR_SQ)/usr/bin/perl' \
727+
"#!/mingw64/bin/busybox sh" \
728+
"exec \"$(shell cygpath -am /usr/bin/perl.exe)\" \"\$$@\""
729+
730+
install -m755 -d '$(DESTDIR_SQ)'
731+
printf '%s%s\n%s\n%s\n%s\n%s\n' >'$(DESTDIR_SQ)/init.bat' \
732+
"PATH=$(DESTDIR_WINDOWS)\\$(MINGW_PREFIX)\\bin;" \
733+
"C:\\WINDOWS;C:\\WINDOWS\\system32" \
734+
"@set GIT_TEST_INSTALLED=$(DESTDIR_MIXED)/$(MINGW_PREFIX)/bin" \
735+
"@`echo "$(DESTDIR_WINDOWS)" | sed 's/:.*/:/'`" \
736+
"@cd `echo "$(DESTDIR_WINDOWS)" | sed 's/^.://'`\\test-git\\t" \
737+
"@echo Now, run 'helper\\test-run-command testsuite'"
738+
739+
install -m755 -d '$(DESTDIR_SQ)/test-git'
740+
sed 's/^\(NO_PERL\|NO_PYTHON\)=.*/\1=YesPlease/' \
741+
<GIT-BUILD-OPTIONS >'$(DESTDIR_SQ)/test-git/GIT-BUILD-OPTIONS'
742+
743+
install -m755 -d '$(DESTDIR_SQ)/test-git/t/helper'
744+
install -m755 $(TEST_PROGRAMS) '$(DESTDIR_SQ)/test-git/t/helper'
745+
(cd t && $(TAR) cf - t[0-9][0-9][0-9][0-9] diff-lib) | \
746+
(cd '$(DESTDIR_SQ)/test-git/t' && $(TAR) xf -)
747+
install -m755 t/t556x_common t/*.sh '$(DESTDIR_SQ)/test-git/t'
748+
749+
install -m755 -d '$(DESTDIR_SQ)/test-git/templates'
750+
(cd templates && $(TAR) cf - blt) | \
751+
(cd '$(DESTDIR_SQ)/test-git/templates' && $(TAR) xf -)
752+
753+
# po/build/locale for t0200
754+
install -m755 -d '$(DESTDIR_SQ)/test-git/po/build/locale'
755+
(cd po/build/locale && $(TAR) cf - .) | \
756+
(cd '$(DESTDIR_SQ)/test-git/po/build/locale' && $(TAR) xf -)
757+
758+
# git-daemon.exe for t5802, git-http-backend.exe for t5560
759+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
760+
install -m755 git-daemon.exe git-http-backend.exe \
761+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
762+
763+
# git-remote-testgit for t5801
764+
install -m755 -d '$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
765+
install -m755 git-remote-testgit \
766+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
767+
768+
# git-upload-archive (dashed) for t5000
769+
install -m755 git-upload-archive.exe '$(DESTDIR_SQ)/$(MINGW_PREFIX)/bin'
770+
771+
# git-difftool--helper for t7800
772+
install -m755 git-difftool--helper \
773+
'$(DESTDIR_SQ)/$(MINGW_PREFIX)/libexec/git-core'
715774
endif
716775
ifeq ($(uname_S),QNX)
717776
COMPAT_CFLAGS += -DSA_RESTART=0

0 commit comments

Comments
 (0)